From 845f54da998b1edd1b5ba2f3d5188198c6c87eb4 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 7 Sep 2017 00:18:39 +0800 Subject: [PATCH 001/197] [Java] fix bug to only remove "CustomInstantDeserializer" for Play v2.5 (#6444) * fix bug to only remove CustomInstantDeserializer for play25 * revise logic * fix logic for CustomInstantDeserializer.java --- .../io/swagger/codegen/languages/JavaClientCodegen.java | 4 ++-- .../io/swagger/client/model/AdditionalPropertiesClass.java | 4 ++-- .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 2 +- .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 2 +- .../src/main/java/io/swagger/client/model/ArrayTest.java | 6 +++--- .../src/main/java/io/swagger/client/model/EnumArrays.java | 2 +- .../src/main/java/io/swagger/client/model/MapTest.java | 4 ++-- .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 2 +- .../src/main/java/io/swagger/client/model/Pet.java | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index cfd47ff081a..84aa2fbee54 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -280,8 +280,8 @@ public void processOpts() { if (additionalProperties.containsKey("jackson")) { supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java")); - if (!"threetenbp".equals(dateLibrary)) { - supportingFiles.remove("CustomInstantDeserializer.mustache"); + if ("threetenbp".equals(dateLibrary) && !usePlayWS) { + supportingFiles.add(new SupportingFile("CustomInstantDeserializer.mustache", invokerFolder, "CustomInstantDeserializer.java")); } } } 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..7fe69e168fd 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 @@ -41,7 +41,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; @@ -67,7 +67,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/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..b7e59a030a4 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 @@ -38,7 +38,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/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..fdfeb6856f3 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 @@ -38,7 +38,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/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..62665c2536a 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 @@ -44,7 +44,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; @@ -70,7 +70,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; @@ -96,7 +96,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/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..12caa480285 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 @@ -128,7 +128,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/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..e6344a1df0f 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 @@ -76,7 +76,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; @@ -102,7 +102,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/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..b0736f316e3 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 @@ -83,7 +83,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/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..4c351dec3e4 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 @@ -39,7 +39,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; @@ -168,7 +168,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; From 565844585ef27a2614c9cba241ab2ab26f8a3a64 Mon Sep 17 00:00:00 2001 From: jaz-ah Date: Wed, 6 Sep 2017 09:56:48 -0700 Subject: [PATCH 002/197] [Swift3/Swift4] update all cocoapods for swift3/swift4 (#6441) * [Swift] update all cocoapods for swift3/swift4 * fix subspec specification --- .../main/resources/swift3/Podspec.mustache | 4 +- .../main/resources/swift4/Podspec.mustache | 4 +- .../swift3/default/PetstoreClient.podspec | 2 +- .../default/SwaggerClientTests/Podfile.lock | 12 +- .../Pods/Alamofire/README.md | 185 +- .../Pods/Alamofire/Source/Alamofire.swift | 2 +- .../Alamofire/Source/MultipartFormData.swift | 2 +- .../Source/NetworkReachabilityManager.swift | 23 +- .../Alamofire/Source/ParameterEncoding.swift | 5 +- .../Pods/Alamofire/Source/Request.swift | 4 +- .../Source/ResponseSerialization.swift | 3 +- .../Pods/Alamofire/Source/Result.swift | 99 +- .../Alamofire/Source/SessionDelegate.swift | 16 +- .../Alamofire/Source/SessionManager.swift | 8 + .../PetstoreClient.podspec.json | 4 +- .../SwaggerClientTests/Pods/Manifest.lock | 12 +- .../Pods/Pods.xcodeproj/project.pbxproj | 872 +++++---- .../Alamofire/Alamofire-prefix.pch | 8 + .../Alamofire/Alamofire-umbrella.h | 8 + .../Alamofire/Alamofire.xcconfig | 1 + .../Target Support Files/Alamofire/Info.plist | 2 +- .../PetstoreClient/PetstoreClient-prefix.pch | 8 + .../PetstoreClient/PetstoreClient-umbrella.h | 8 + .../PetstoreClient/PetstoreClient.xcconfig | 1 + .../Pods-SwaggerClient-frameworks.sh | 41 +- .../Pods-SwaggerClient-resources.sh | 28 +- .../Pods-SwaggerClient-umbrella.h | 8 + .../Pods-SwaggerClient.debug.xcconfig | 2 +- .../Pods-SwaggerClient.release.xcconfig | 2 +- .../Pods-SwaggerClientTests-frameworks.sh | 33 +- .../Pods-SwaggerClientTests-resources.sh | 28 +- .../Pods-SwaggerClientTests-umbrella.h | 8 + .../Pods-SwaggerClientTests.debug.xcconfig | 2 +- .../Pods-SwaggerClientTests.release.xcconfig | 2 +- .../SwaggerClient.xcodeproj/project.pbxproj | 15 +- .../swift3/promisekit/PetstoreClient.podspec | 4 +- .../SwaggerClientTests/Podfile.lock | 28 +- .../Pods/Alamofire/README.md | 185 +- .../Pods/Alamofire/Source/Alamofire.swift | 2 +- .../Alamofire/Source/MultipartFormData.swift | 2 +- .../Source/NetworkReachabilityManager.swift | 23 +- .../Alamofire/Source/ParameterEncoding.swift | 5 +- .../Pods/Alamofire/Source/Request.swift | 4 +- .../Source/ResponseSerialization.swift | 3 +- .../Pods/Alamofire/Source/Result.swift | 99 +- .../Alamofire/Source/SessionDelegate.swift | 16 +- .../Alamofire/Source/SessionManager.swift | 8 + .../PetstoreClient.podspec.json | 8 +- .../SwaggerClientTests/Pods/Manifest.lock | 28 +- .../Pods/Pods.xcodeproj/project.pbxproj | 1471 +++++++--------- .../Sources/NSNotificationCenter+AnyPromise.h | 44 - .../Sources/NSNotificationCenter+AnyPromise.m | 16 - .../NSNotificationCenter+Promise.swift | 45 - .../Foundation/Sources/NSObject+Promise.swift | 64 - .../Foundation/Sources/NSTask+AnyPromise.h | 53 - .../Foundation/Sources/NSTask+AnyPromise.m | 46 - .../Sources/NSURLSession+AnyPromise.h | 66 - .../Sources/NSURLSession+AnyPromise.m | 113 -- .../Sources/NSURLSession+Promise.swift | 50 - .../Foundation/Sources/PMKFoundation.h | 3 - .../Foundation/Sources/Process+Promise.swift | 146 -- .../Foundation/Sources/URLDataPromise.swift | 121 -- .../Foundation/Sources/afterlife.swift | 26 - .../QuartzCore/Sources/CALayer+AnyPromise.h | 40 - .../QuartzCore/Sources/CALayer+AnyPromise.m | 36 - .../QuartzCore/Sources/PMKQuartzCore.h | 1 - .../UIKit/Sources/PMKAlertController.swift | 96 - .../Extensions/UIKit/Sources/PMKUIKit.h | 2 - .../UIKit/Sources/UIView+AnyPromise.h | 80 - .../UIKit/Sources/UIView+AnyPromise.m | 64 - .../UIKit/Sources/UIView+Promise.swift | 46 - .../Sources/UIViewController+AnyPromise.h | 71 - .../Sources/UIViewController+AnyPromise.m | 140 -- .../Sources/UIViewController+Promise.swift | 111 -- .../Pods/PromiseKit/README.md | 241 +-- .../PromiseKit/Sources/AnyPromise+Private.h | 2 +- .../Pods/PromiseKit/Sources/AnyPromise.h | 40 + .../Pods/PromiseKit/Sources/AnyPromise.m | 30 +- .../Pods/PromiseKit/Sources/AnyPromise.swift | 4 +- .../Pods/PromiseKit/Sources/Error.swift | 1 + .../Pods/PromiseKit/Sources/Promise.swift | 9 + .../Pods/PromiseKit/Sources/after.swift | 25 + .../Pods/PromiseKit/Sources/fwd.h | 2 +- .../Pods/PromiseKit/Sources/when.swift | 8 + .../Pods/PromiseKit/Sources/wrap.swift | 4 + .../Alamofire/Alamofire-prefix.pch | 8 + .../Alamofire/Alamofire-umbrella.h | 8 + .../Alamofire/Alamofire.xcconfig | 1 + .../Target Support Files/Alamofire/Info.plist | 2 +- .../PetstoreClient/PetstoreClient-prefix.pch | 8 + .../PetstoreClient/PetstoreClient-umbrella.h | 8 + .../PetstoreClient/PetstoreClient.xcconfig | 1 + .../Pods-SwaggerClient-frameworks.sh | 45 +- .../Pods-SwaggerClient-resources.sh | 28 +- .../Pods-SwaggerClient-umbrella.h | 8 + .../Pods-SwaggerClient.debug.xcconfig | 2 +- .../Pods-SwaggerClient.release.xcconfig | 2 +- .../Pods-SwaggerClientTests-frameworks.sh | 33 +- .../Pods-SwaggerClientTests-resources.sh | 28 +- .../Pods-SwaggerClientTests-umbrella.h | 8 + .../Pods-SwaggerClientTests.debug.xcconfig | 2 +- .../Pods-SwaggerClientTests.release.xcconfig | 2 +- .../PromiseKit/Info.plist | 2 +- .../PromiseKit/PromiseKit-prefix.pch | 8 + .../PromiseKit/PromiseKit-umbrella.h | 17 +- .../PromiseKit/PromiseKit.xcconfig | 3 +- .../SwaggerClient.xcodeproj/project.pbxproj | 17 +- .../swift3/rxswift/PetstoreClient.podspec | 2 +- .../rxswift/SwaggerClientTests/Podfile.lock | 12 +- .../Pods/Alamofire/README.md | 185 +- .../Pods/Alamofire/Source/Alamofire.swift | 2 +- .../Alamofire/Source/MultipartFormData.swift | 2 +- .../Source/NetworkReachabilityManager.swift | 23 +- .../Alamofire/Source/ParameterEncoding.swift | 5 +- .../Pods/Alamofire/Source/Request.swift | 4 +- .../Source/ResponseSerialization.swift | 3 +- .../Pods/Alamofire/Source/Result.swift | 99 +- .../Alamofire/Source/SessionDelegate.swift | 16 +- .../Alamofire/Source/SessionManager.swift | 8 + .../PetstoreClient.podspec.json | 4 +- .../SwaggerClientTests/Pods/Manifest.lock | 12 +- .../Pods/Pods.xcodeproj/project.pbxproj | 907 +++++----- .../Alamofire/Alamofire-prefix.pch | 8 + .../Alamofire/Alamofire-umbrella.h | 8 + .../Alamofire/Alamofire.xcconfig | 1 + .../Target Support Files/Alamofire/Info.plist | 2 +- .../PetstoreClient/PetstoreClient-prefix.pch | 8 + .../PetstoreClient/PetstoreClient-umbrella.h | 8 + .../PetstoreClient/PetstoreClient.xcconfig | 1 + .../Pods-SwaggerClient-frameworks.sh | 45 +- .../Pods-SwaggerClient-resources.sh | 28 +- .../Pods-SwaggerClient-umbrella.h | 8 + .../Pods-SwaggerClient.debug.xcconfig | 2 +- .../Pods-SwaggerClient.release.xcconfig | 2 +- .../Pods-SwaggerClientTests-frameworks.sh | 33 +- .../Pods-SwaggerClientTests-resources.sh | 28 +- .../Pods-SwaggerClientTests-umbrella.h | 8 + .../Pods-SwaggerClientTests.debug.xcconfig | 2 +- .../Pods-SwaggerClientTests.release.xcconfig | 2 +- .../RxSwift/RxSwift-prefix.pch | 8 + .../RxSwift/RxSwift-umbrella.h | 8 + .../RxSwift/RxSwift.xcconfig | 1 + .../SwaggerClient.xcodeproj/project.pbxproj | 17 +- .../unwraprequired/PetstoreClient.podspec | 2 +- .../default/SwaggerClientTests/Podfile.lock | 4 +- .../PetstoreClient.podspec.json | 2 +- .../SwaggerClientTests/Pods/Manifest.lock | 4 +- .../Pods/Pods.xcodeproj/project.pbxproj | 910 +++++----- .../Alamofire/Alamofire-prefix.pch | 8 + .../Alamofire/Alamofire-umbrella.h | 8 + .../Alamofire/Alamofire.xcconfig | 1 + .../PetstoreClient/PetstoreClient-prefix.pch | 8 + .../PetstoreClient/PetstoreClient-umbrella.h | 8 + .../PetstoreClient/PetstoreClient.xcconfig | 1 + .../Pods-SwaggerClient-frameworks.sh | 41 +- .../Pods-SwaggerClient-resources.sh | 28 +- .../Pods-SwaggerClient-umbrella.h | 8 + .../Pods-SwaggerClient.debug.xcconfig | 2 +- .../Pods-SwaggerClient.release.xcconfig | 2 +- .../Pods-SwaggerClientTests-frameworks.sh | 33 +- .../Pods-SwaggerClientTests-resources.sh | 28 +- .../Pods-SwaggerClientTests-umbrella.h | 8 + .../Pods-SwaggerClientTests.debug.xcconfig | 2 +- .../Pods-SwaggerClientTests.release.xcconfig | 2 +- .../SwaggerClient.xcodeproj/project.pbxproj | 15 +- .../swift4/promisekit/PetstoreClient.podspec | 2 +- .../SwaggerClientTests/Podfile.lock | 20 +- .../PetstoreClient.podspec.json | 6 +- .../SwaggerClientTests/Pods/Manifest.lock | 20 +- .../Pods/Pods.xcodeproj/project.pbxproj | 1569 ++++++++--------- .../Sources/NSNotificationCenter+AnyPromise.h | 44 - .../Sources/NSNotificationCenter+AnyPromise.m | 16 - .../NSNotificationCenter+Promise.swift | 45 - .../Foundation/Sources/NSObject+Promise.swift | 64 - .../Foundation/Sources/NSTask+AnyPromise.h | 53 - .../Foundation/Sources/NSTask+AnyPromise.m | 46 - .../Sources/NSURLSession+AnyPromise.h | 66 - .../Sources/NSURLSession+AnyPromise.m | 113 -- .../Sources/NSURLSession+Promise.swift | 50 - .../Foundation/Sources/PMKFoundation.h | 3 - .../Foundation/Sources/Process+Promise.swift | 146 -- .../Foundation/Sources/URLDataPromise.swift | 121 -- .../Foundation/Sources/afterlife.swift | 26 - .../QuartzCore/Sources/CALayer+AnyPromise.h | 40 - .../QuartzCore/Sources/CALayer+AnyPromise.m | 36 - .../QuartzCore/Sources/PMKQuartzCore.h | 1 - .../UIKit/Sources/PMKAlertController.swift | 96 - .../Extensions/UIKit/Sources/PMKUIKit.h | 2 - .../UIKit/Sources/UIView+AnyPromise.h | 80 - .../UIKit/Sources/UIView+AnyPromise.m | 64 - .../UIKit/Sources/UIView+Promise.swift | 46 - .../Sources/UIViewController+AnyPromise.h | 71 - .../Sources/UIViewController+AnyPromise.m | 140 -- .../Sources/UIViewController+Promise.swift | 111 -- .../Pods/PromiseKit/README.md | 241 +-- .../PromiseKit/Sources/AnyPromise+Private.h | 2 +- .../Pods/PromiseKit/Sources/AnyPromise.h | 40 + .../Pods/PromiseKit/Sources/AnyPromise.m | 30 +- .../Pods/PromiseKit/Sources/AnyPromise.swift | 4 +- .../Pods/PromiseKit/Sources/Error.swift | 1 + .../Pods/PromiseKit/Sources/Promise.swift | 9 + .../Pods/PromiseKit/Sources/after.swift | 25 + .../Pods/PromiseKit/Sources/fwd.h | 2 +- .../Pods/PromiseKit/Sources/when.swift | 8 + .../Pods/PromiseKit/Sources/wrap.swift | 4 + .../Alamofire/Alamofire-prefix.pch | 8 + .../Alamofire/Alamofire-umbrella.h | 8 + .../Alamofire/Alamofire.xcconfig | 1 + .../PetstoreClient/PetstoreClient-prefix.pch | 8 + .../PetstoreClient/PetstoreClient-umbrella.h | 8 + .../PetstoreClient/PetstoreClient.xcconfig | 1 + .../Pods-SwaggerClient-frameworks.sh | 45 +- .../Pods-SwaggerClient-resources.sh | 28 +- .../Pods-SwaggerClient-umbrella.h | 8 + .../Pods-SwaggerClient.debug.xcconfig | 2 +- .../Pods-SwaggerClient.release.xcconfig | 2 +- .../Pods-SwaggerClientTests-frameworks.sh | 33 +- .../Pods-SwaggerClientTests-resources.sh | 28 +- .../Pods-SwaggerClientTests-umbrella.h | 8 + .../Pods-SwaggerClientTests.debug.xcconfig | 2 +- .../Pods-SwaggerClientTests.release.xcconfig | 2 +- .../PromiseKit/Info.plist | 2 +- .../PromiseKit/PromiseKit-prefix.pch | 8 + .../PromiseKit/PromiseKit-umbrella.h | 17 +- .../PromiseKit/PromiseKit.xcconfig | 3 +- .../SwaggerClient.xcodeproj/project.pbxproj | 17 +- 226 files changed, 4761 insertions(+), 7013 deletions(-) delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m delete mode 100644 samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift diff --git a/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache index 5625223534d..e628b9da5d0 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/Podspec.mustache @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}} s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}} s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}} - s.dependency 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}} + s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}} s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}} - s.dependency 'Alamofire', '~> 4.0' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/modules/swagger-codegen/src/main/resources/swift4/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift4/Podspec.mustache index b842f571069..e628b9da5d0 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/Podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/Podspec.mustache @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}} s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}} s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}} - s.dependency 'PromiseKit', '~> 4.2.2'{{/usePromiseKit}}{{#useRxSwift}} + s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}} s.dependency 'RxSwift', '~> 3.4.1'{{/useRxSwift}} - s.dependency 'Alamofire', '~> 4.5' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift3/default/PetstoreClient.podspec b/samples/client/petstore/swift3/default/PetstoreClient.podspec index 21af9e9df50..7a28d478bf8 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/default/PetstoreClient.podspec @@ -9,5 +9,5 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.0' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock index 59e6e5c12ae..187218299fb 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock @@ -1,19 +1,19 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) + - Alamofire (~> 4.5.0) DEPENDENCIES: - PetstoreClient (from `../`) EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 0f65d85b2a09becd32938348b3783a9394a07346 + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: bbb95cd0adc059bbdbe541b384f8294f4e241226 PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md index 12ea4c74775..e1966fdca00 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md @@ -57,8 +57,8 @@ In order to keep Alamofire focused specifically on core networking implementatio ## Requirements - iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1+ -- Swift 3.0+ +- Xcode 8.1, 8.2, 8.3, and 9.0 +- Swift 3.0, 3.1, 3.2, and 4.0 ## Migration Guides @@ -137,21 +137,21 @@ dependencies: [ ### Manually -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. #### Embedded Framework - Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: ```bash -$ git init -``` + $ git init + ``` - Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: ```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` - Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. @@ -191,13 +191,16 @@ Handling the `Response` of a `Request` made in Alamofire involves chaining a res ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.request) // original URL request - print(response.response) // HTTP URL response - print(response.data) // server data - print(response.result) // result of response serialization + print("Request: \(String(describing: response.request))") // original url request + print("Response: \(String(describing: response.response))") // http url response + print("Result: \(response.result)") // response serialization result - if let JSON = response.result.value { - print("JSON: \(JSON)") + if let json = response.result.value { + print("JSON: \(json)") // serialized json response + } + + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") // original server data as UTF8 string } } ``` @@ -243,7 +246,7 @@ func responsePropertyList( None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. -> For example, response status codes in the `400..<499` and `500..<599` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. +> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. #### Response Handler @@ -345,18 +348,18 @@ Alamofire.request("https://httpbin.org/get") .validate(statusCode: 200..<300) .validate(contentType: ["application/json"]) .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } } ``` #### Automatic Validation -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. +Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. ```swift Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in @@ -491,7 +494,7 @@ struct JSONStringArrayEncoding: ParameterEncoding { } func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = urlRequest.urlRequest + var urlRequest = try urlRequest.asURLRequest() let data = try JSONSerialization.data(withJSONObject: array, options: []) @@ -612,9 +615,9 @@ Requests made in Alamofire that fetch data from a server can download the data i ```swift Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -629,8 +632,8 @@ You can also provide a `DownloadFileDestination` closure to move the file from t ```swift let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) } @@ -638,16 +641,16 @@ let destination: DownloadRequest.DownloadFileDestination = { _, _ in Alamofire.download(urlString, to: destination).response { response in print(response) - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } + if response.error == nil, let imagePath = response.destinationURL?.path { + let image = UIImage(contentsOfFile: imagePath) + } } ``` You can also use the suggested download destination API. ```swift -let destination = DownloadRequest.suggestedDownloadDestination(directory: .documentDirectory) +let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download("https://httpbin.org/image/png", to: destination) ``` @@ -661,9 +664,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -677,9 +680,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -691,34 +694,34 @@ If a `DownloadRequest` is cancelled or interrupted, the underlying URL session m ```swift class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? + private var resumeData: Data? + private var image: UIImage? func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } + guard image == nil else { completion(image) ; return } - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) + } - let request: DownloadRequest + let request: DownloadRequest if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") + request = Alamofire.download(resumingWith: resumeData) + } else { + request = Alamofire.download("https://httpbin.org/image/png") } request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } + switch response.result { + case .success(let data): + self.image = UIImage(data: data) + case .failure: + self.resumeData = response.resumeData + } } } } @@ -816,7 +819,7 @@ In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetr ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) + print(response.metrics) } ``` @@ -824,8 +827,8 @@ It's important to note that these APIs are only available on iOS and tvOS 10 and ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0. *) { - print(response.metrics) + if #available(iOS 10.0, *) { + print(response.metrics) } } ``` @@ -854,10 +857,10 @@ Outputs: ```bash $ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" + -H "User-Agent: Alamofire/4.0.0" \ + -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "https://httpbin.org/get?foo=bar" ``` --- @@ -1183,20 +1186,20 @@ The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` t ```swift class AccessTokenAdapter: RequestAdapter { - private let accessToken: String + private let accessToken: String - init(accessToken: String) { - self.accessToken = accessToken - } + init(accessToken: String) { + self.accessToken = accessToken + } - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } - return urlRequest + return urlRequest } } ``` @@ -1414,7 +1417,7 @@ func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alam } loadUser { response in - if let user = userResponse.value { + if let user = response.value { print("User: { username: \(user.username), name: \(user.name) }") } } @@ -1749,24 +1752,24 @@ If you run into this problem (high probability with self-signed certificates), y ```xml - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - + NSAppTransportSecurity + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.2 + + + ``` @@ -1851,4 +1854,4 @@ The community adoption of the ASF libraries has been amazing. We are greatly hum ## License -Alamofire is released under the MIT license. See LICENSE for details. +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift index 86d54d85932..edcf717ca9e 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -53,7 +53,7 @@ extension URL: URLConvertible { } extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherise throws an `Error`. + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. /// /// - throws: An `AFError.invalidURL` if `url` is `nil`. /// diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift index 6d0d5560666..c5093f9f857 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -92,7 +92,7 @@ open class MultipartFormData { // MARK: - Properties /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open var contentType: String { return "multipart/form-data; boundary=\(boundary)" } + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift index 888818df77c..30443b99b29 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -182,21 +182,24 @@ public class NetworkReachabilityManager { // MARK: - Internal - Network Reachability Status func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.reachable) else { return .notReachable } + guard isNetworkReachable(with: flags) else { return .notReachable } - var networkStatus: NetworkReachabilityStatus = .notReachable + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - if !flags.contains(.connectionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif - if flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) { - if !flags.contains(.interventionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } - } + return networkStatus + } - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - return networkStatus + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) } } diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift index 242f6a83dc1..959af6f9365 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -241,8 +241,11 @@ public struct URLEncoding: ParameterEncoding { let value = parameters[key]! components += queryComponents(fromKey: key, value: value) } - + #if swift(>=4.0) + return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") + #else return components.map { "\($0)=\($1)" }.joined(separator: "&") + #endif } private func encodesParametersInURL(with method: HTTPMethod) -> Bool { diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift index 78864952dca..4f6350c5bfe 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -46,7 +46,7 @@ public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: Tim public protocol RequestRetrier { /// Determines whether the `Request` should be retried by calling the `completion` closure. /// - /// This operation is fully asychronous. Any amount of time can be taken to determine whether the request needs + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly /// cleaned up after. /// @@ -269,7 +269,7 @@ extension Request: CustomDebugStringConvertible { } func cURLRepresentation() -> String { - var components = ["$ curl -i"] + var components = ["$ curl -v"] guard let request = self.request, let url = request.url, diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift index 47780fd611b..1a59da550a7 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -88,11 +88,12 @@ public struct DownloadResponseSerializer: DownloadResponseSerializerProto extension Request { var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime return Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), + requestStartTime: requestStartTime, initialResponseTime: initialResponseTime, requestCompletedTime: requestCompletedTime, serializationCompletedTime: CFAbsoluteTimeGetCurrent() diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift index c13b1fcf77b..bf7e70255b7 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -162,7 +162,7 @@ extension Result { /// try print(noInt.unwrap()) /// // Throws error /// - /// - parameter transform: A closure that takes the success value of the result instance. + /// - parameter transform: A closure that takes the success value of the `Result` instance. /// /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the /// same failure. @@ -200,4 +200,101 @@ extension Result { return .failure(error) } } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) -> Void) -> Result { + if case let .success(value) = self { closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) -> Void) -> Result { + if case let .failure(error) = self { closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () -> Void) -> Result { + if isSuccess { closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () -> Void) -> Result { + if isFailure { closure() } + + return self + } } diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift index 27ad88124c2..8edb492b699 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -36,7 +36,7 @@ open class SessionDelegate: NSObject { open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? @@ -48,21 +48,21 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, (URLRequest?) -> Void) -> Void)? + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, (InputStream?) -> Void) -> Void)? + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? @@ -77,7 +77,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, (URLSession.ResponseDisposition) -> Void) -> Void)? + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? @@ -90,7 +90,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, (CachedURLResponse?) -> Void) -> Void)? + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? // MARK: URLSessionDownloadDelegate Overrides @@ -462,8 +462,8 @@ extension SessionDelegate: URLSessionTaskDelegate { // Determine whether an error has occurred var error: Error? = error - if let taskDelegate = self[task]?.delegate, taskDelegate.error != nil { - error = taskDelegate.error + if request.delegate.error != nil { + error = request.delegate.error } /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift index 450f750de41..493ce29cb4e 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -58,10 +58,18 @@ open class SessionManager { let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + #if swift(>=4.0) + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in + let (index, languageCode) = enumeratedLanguage + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + #else let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in let quality = 1.0 - (Double(index) * 0.1) return "\(languageCode);q=\(quality)" }.joined(separator: ", ") + #endif // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index b8acea6409f..ba5d67322e3 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -13,10 +13,10 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", + "source_files": "PetstoreClient/Classes/**/*.swift", "dependencies": { "Alamofire": [ - "~> 4.0" + "~> 4.5.0" ] } } diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock index 59e6e5c12ae..187218299fb 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock @@ -1,19 +1,19 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) + - Alamofire (~> 4.5.0) DEPENDENCIES: - PetstoreClient (from `../`) EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 0f65d85b2a09becd32938348b3783a9394a07346 + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: bbb95cd0adc059bbdbe541b384f8294f4e241226 PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index eb1eb49cb2a..346e9509029 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,84 +7,84 @@ objects = { /* Begin PBXBuildFile section */ - 00872D6B6ACEE96C198B5510C0997538 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */; }; + 00433565417D8EB2877B80870AA37FC5 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 057D51272B35EEE9D412EE4A012F273B /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */; }; + 05AA1D0A4880C8B2E820E8AB9DB0CA0C /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */; }; + 09CF911587060356512E13F57A1746E9 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */; }; 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; - 165C454DEEB69E70196BFE087994A0BD /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */; }; - 19034A372FA3E67283FD2169CBD43FCF /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */; }; 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1BB6AAECC938CDE37E479B85AD357A19 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */; }; - 1F321A176227AA1FA599E45A0565C781 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */; }; - 20240BAF3D28AFA92FDD48BF9DEC3A43 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */; }; - 2177EDDA664C0BA1EB3ADC61C2655372 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */; }; - 21A619259418281F1FB820852336FE4C /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */; }; - 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + 1C48756766427E6BB17C6F5C7672F0EF /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */; }; + 245C4B7A64DD93E776A57C420002ED8B /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */; }; + 2E4FA060FD9624B60A1B8A4AF3FB70EF /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */; }; 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 340CA80395279A0C39FA07FBBE3645FB /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */; }; + 327DFA0268018413C4C6D9EAEE45FFF4 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */; }; + 33854474ACF02E42AD42AC08C523B54F /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */; }; 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; - 36DE19C6C668C624F87DC0FFCBAEEE14 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */; }; - 3B4EE43319D9BB7B458AD7DE01D46330 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */; }; + 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + 4164BE89CE07197B165DE11BE00C81B6 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */; }; + 41A4833A4104452384C8200FECA468F7 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */; }; 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 44F3B8E74A9272812C4F544304823A16 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */; }; - 45E47E4344253C5B77E3E9ED1C05E47F /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */; }; + 43ECF64E02DB84925FBE5EC2F6569B22 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */; }; + 44990E3C6099A47299E6E39B9BD01214 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */; }; + 45B9E69F6558F40D6C4AA9C1BCFA9FEA /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */; }; + 473587DCDFAD50A5A2D7FEB93F3D28E1 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */; }; + 4C172288F3ACD041084677D2C05DEF02 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */; }; 4CF609068BF29F02DFDBF05320064219 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; - 4D54B448BA8F0F2B02C444D7563CAC0A /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */; }; 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; - 59F7A33B2152645DE6D53A43F2BB0A8C /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */; }; + 58501155D7B20CF99109A4DC953CC266 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */; }; + 5887440665FFCF423171C4E5C3EFB9D1 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */; }; + 5B01F54B86EA75E6E4A4C2A2EB2E8B07 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 580886F727A89668FA28D3BA11678585 /* Order.swift */; }; + 609113D6244720A747DD150234AB431C /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */; }; + 60A9299604ADCB164294555D66DD507F /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */; }; 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; - 6442625C7F3126D0BA36BB66830EE724 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */; }; - 69CF0E67E1F9B8DDB0A6B1F74ADC2B54 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A3989139854636389CEF47FEAE202A /* Tag.swift */; }; - 7A6D9CD78F32A7E76D6F01A0419EFCC6 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */; }; - 7B0462D90AD9B8227E19A0E02C95D3B0 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */; }; + 65C5109AD09965C1BD747668037F7895 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */; }; + 6872374F425855C8CADA536A71CD5DBE /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */; }; + 69F05AAB871A087A719B6B4383CBEA0F /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */; }; + 71F5C69A53E4AAB624587E0966CDFD0B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - 7F5A356FDD6E0F0F5ED900C457775533 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */; }; - 805BA9618E7C950EE263D0D16B69F06F /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */; }; - 80939CE9D0E3A352AA29C9C288EB6615 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */; }; - 85C2ABE16D0EAD296BB6B91D9168B30C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - 88015C0F7BF74C07BBCECCD07639AE13 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */; }; + 7FF14684D2EDBA8FF4B8785919108F4A /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */; }; + 81C4DD7F2D22A02649BF8D76955BDCB6 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */; }; + 863FA751BBFDA85195E1B17CA2392236 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 901AB84DD73213A5C6F0263B25D600B7 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */; }; - 90297F453E151E8545F92BDBC73D45D5 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */; }; - 915898DFD89053345BBBD0139432F962 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */; }; - 92DCC761211B09FE7DBD9A59923F2506 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 93D17EEA1A373AD5CFBFAB1C87363E28 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */; }; - 99F517121515275CE8DDDC093B8175E3 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */; }; + 953F99387D4F96C3CDA56DBF619716FD /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */; }; + 9CD67121D1D4F1093AF9F7ADBFAF9BD6 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */; }; + 9E4253E1905B0A36CAE0C590902BC030 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */; }; 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; - A3515AD9F536A0FD2CAD67B3C0C6C271 /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */; }; + A7FDA0F12CCF0FE7407C4EE1D88D63D1 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */; }; + A9E7F7A86DB2E1A97F472E8184EB8D62 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */; }; A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; + AAB6E3FF4C203D1B4418B604C704EC5E /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */; }; AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; - B120FBCC8FD9FF11983E822E3BFC1034 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */; }; - B51D2940B88C55A4122A1B0C5053A7D4 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */; }; + B3E582D71CDFDDC17D542DBB2CC569D5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; - B87EE5307B9A0705B565A43F38CA548C /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - B9ECE5F907BFE83230757B6B8CD23ADC /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */; }; + BB44263B22784220295C8DE96281AC0D /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */; }; BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; - BD0559EE6DB46E08B85340DA18AAAB19 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */; }; - BD10A9B97B6A589B7EEA28008CF9DA25 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 294315D43C85053FB22B37668F5D511C /* Dog.swift */; }; - BDDB3097BDBA28591D744D8B83E0A348 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */; }; BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; - C04301A4207549D74AEDDA2501F6FB63 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BE96A09834700FF4412EC718B536E9 /* Client.swift */; }; - C0E01396AB8A57813746A94842C7FB94 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */; }; - C1F7E595163DC7E970EB4FACCF9EC30F /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */; }; - C4FE1444409BDBD0C1850A7D0C24E0E2 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C64DBEC4A4254294548D699017753990 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */; }; + C1C8EAD6D96212CEE77AE32B4C5B4689 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */; }; + C454A045AA0C3821D4143B435AADB863 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */; }; + C4FE1444409BDBD0C1850A7D0C24E0E2 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CB57E535A1515E3590E3ECFF8DD3040C /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */; }; CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - CBCEE0519DD8043634653442B6BAE099 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */; }; - CDD2B7AF43D0DA455FBFD6E018802BDF /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; + CCE24F24BF3EB1A2C514AB41B9BBF722 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */; }; + CFDC2507829B1FEF8C1319EFB91B9B2E /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */; }; + D329D405FF7D2A9DEE1F03F00587E132 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */; }; D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - D9BF79730EE762AC51A1E80AF07630FF /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */; }; + D7214BDCBD49ABCB18F79A04C8225B07 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */; }; + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + EA63D6A5D6D3063FEDC68902C60F7C44 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */; }; + EAFE09F156DA9CE33520DE9A83A0063A /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */; }; EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - F54A908073C5E36A97E0D518775847CE /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; - F761113D92752856107A5C94B8C59AD2 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34799A80ED15D28ACA081A72E275921F /* List.swift */; }; - F802493057754569CDC9C3F559585098 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */; }; + F8284F679BA0722A2847F6DF984D3CC9 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */; }; F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; - F9FCA34627D89660E8AD6F7CF58FF919 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */; }; - FFE9B8A97889D749F05027DFAFFB15D7 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */; }; + FC41F2E7439517DE7A562E935DA992F7 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */; }; + FE01173D208EA67C931846F08230E37F /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */; }; + FEA39C941A98DB246BE23697A4C556F1 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885795F7A7783B007F026944B55862FF /* Models.swift */; }; + FEDEAFA3F155ACC48A61243BE97DC0FD /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -112,110 +112,110 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = ""; }; 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/Swaggers/APIHelper.swift; sourceTree = ""; }; + 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; 13A0A663B36A229C69D5274A83E93F88 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 294315D43C85053FB22B37668F5D511C /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; + 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/Swaggers/Configuration.swift; sourceTree = ""; }; 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - 34799A80ED15D28ACA081A72E275921F /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; - 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - 39BE96A09834700FF4412EC718B536E9 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/Swaggers/APIs.swift; sourceTree = ""; }; + 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 63A3989139854636389CEF47FEAE202A /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 580886F727A89668FA28D3BA11678585 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 5E79C2313007533BFFA709832BE18FDC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; + 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 694EDDB57CDB8FB6CB5088BF3F66CE8A /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 855FBD05ABAD1AE4A03E58EEBA975DAA /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; + 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 885795F7A7783B007F026944B55862FF /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/Swaggers/Models.swift; sourceTree = ""; }; + 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = ""; }; A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; BCCA9CA7D9C1A2047BB93336C5708DFD /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; + D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; + D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; + E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; + F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -224,7 +224,7 @@ buildActionMask = 2147483647; files = ( 4CF609068BF29F02DFDBF05320064219 /* Alamofire.framework in Frameworks */, - 85C2ABE16D0EAD296BB6B91D9168B30C /* Foundation.framework in Frameworks */, + B3E582D71CDFDDC17D542DBB2CC569D5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -232,7 +232,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -240,7 +240,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */, + 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -248,13 +248,30 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0BDA8E0BE198EED1AD88B926509C3382 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */, + 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */, + 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */, + 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */, + 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */, + 885795F7A7783B007F026944B55862FF /* Models.swift */, + 45EE0834297896279B488DCD3D66C373 /* APIs */, + 28BE76357A2CB1D1115C90F572A15193 /* Models */, + E44C17565AC7C2BF978747A8E3FBDEAA /* Support Files */, + ); + name = PetstoreClient; + path = ../..; + sourceTree = ""; + }; 200D10EB20F0397D47F022B50CF0433F /* Alamofire */ = { isa = PBXGroup; children = ( @@ -281,12 +298,48 @@ path = Alamofire; sourceTree = ""; }; - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { + 28BE76357A2CB1D1115C90F572A15193 /* Models */ = { isa = PBXGroup; children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, + 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */, + DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */, + 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */, + 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */, + 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */, + 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */, + 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */, + 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */, + 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */, + 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */, + 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */, + 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */, + D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */, + 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */, + CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */, + 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */, + 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */, + F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */, + A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */, + 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */, + 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */, + 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */, + B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */, + 580886F727A89668FA28D3BA11678585 /* Order.swift */, + 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */, + FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */, + 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */, + D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */, + 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */, + 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */, + DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */, + 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */, + 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */, + 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */, + 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */, ); - name = "Development Pods"; + name = Models; + path = PetstoreClient/Classes/Swaggers/Models; sourceTree = ""; }; 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { @@ -297,6 +350,36 @@ name = Pods; sourceTree = ""; }; + 45EE0834297896279B488DCD3D66C373 /* APIs */ = { + isa = PBXGroup; + children = ( + 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */, + 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */, + F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */, + 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */, + 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */, + 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */, + ); + name = APIs; + path = PetstoreClient/Classes/Swaggers/APIs; + sourceTree = ""; + }; + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 0BDA8E0BE198EED1AD88B926509C3382 /* PetstoreClient */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 51A9B78D6A7E7FB5A465754528750815 /* iOS */ = { + isa = PBXGroup; + children = ( + 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */ = { isa = PBXGroup; children = ( @@ -315,30 +398,16 @@ isa = PBXGroup; children = ( 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */, - 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */, + 51A9B78D6A7E7FB5A465754528750815 /* iOS */, ); name = Frameworks; sourceTree = ""; }; - 73F0D31DF4F27DE88D6E071DB2438D69 /* APIs */ = { - isa = PBXGroup; - children = ( - 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */, - 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */, - 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */, - 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */, - AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */, - 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */, - ); - name = APIs; - path = APIs; - sourceTree = ""; - }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */, 59B91F212518421F271EBA85D5530651 /* Frameworks */, 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */, 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */, @@ -346,14 +415,6 @@ ); sourceTree = ""; }; - 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */ = { - isa = PBXGroup; - children = ( - 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { isa = PBXGroup; children = ( @@ -372,20 +433,6 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { - isa = PBXGroup; - children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */ = { isa = PBXGroup; children = ( @@ -397,50 +444,6 @@ name = Products; sourceTree = ""; }; - B19BE75563CE9621CA3D4D00B3E97DAC /* Models */ = { - isa = PBXGroup; - children = ( - 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */, - E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */, - 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */, - 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */, - 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */, - 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */, - 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */, - 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */, - 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */, - 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */, - 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */, - 39BE96A09834700FF4412EC718B536E9 /* Client.swift */, - 294315D43C85053FB22B37668F5D511C /* Dog.swift */, - 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */, - B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */, - 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */, - E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */, - 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */, - 34799A80ED15D28ACA081A72E275921F /* List.swift */, - C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */, - A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */, - D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */, - 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */, - B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */, - D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */, - 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */, - 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */, - EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */, - FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */, - 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */, - E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */, - 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */, - DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */, - 63A3989139854636389CEF47FEAE202A /* Tag.swift */, - E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */, - ); - name = Models; - path = Models; - sourceTree = ""; - }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { isa = PBXGroup; children = ( @@ -468,48 +471,18 @@ path = "Target Support Files/Pods-SwaggerClientTests"; sourceTree = ""; }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */, - ); - name = PetstoreClient; - path = PetstoreClient; - sourceTree = ""; - }; - E9A1A08411D27DA5CE28FA5CE7147C23 /* Swaggers */ = { - isa = PBXGroup; - children = ( - 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */, - E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */, - 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */, - 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */, - D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */, - 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */, - 73F0D31DF4F27DE88D6E071DB2438D69 /* APIs */, - B19BE75563CE9621CA3D4D00B3E97DAC /* Models */, - ); - name = Swaggers; - path = Swaggers; - sourceTree = ""; - }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */ = { + E44C17565AC7C2BF978747A8E3FBDEAA /* Support Files */ = { isa = PBXGroup; children = ( - E9A1A08411D27DA5CE28FA5CE7147C23 /* Swaggers */, + 5E79C2313007533BFFA709832BE18FDC /* Info.plist */, + 855FBD05ABAD1AE4A03E58EEBA975DAA /* PetstoreClient.modulemap */, + E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */, + 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */, + 694EDDB57CDB8FB6CB5088BF3F66CE8A /* PetstoreClient-prefix.pch */, + E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */, ); - name = Classes; - path = Classes; + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; sourceTree = ""; }; /* End PBXGroup section */ @@ -590,7 +563,7 @@ isa = PBXNativeTarget; buildConfigurationList = F3A56D5CC2C98220366FF2A73BD8D5DD /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - CD3DAB19C57804848F7D66F5279E6843 /* Sources */, + 4C5A005C2839A42D2561421760901B18 /* Sources */, 77F528E4BD190E29EBDB108102752C9A /* Frameworks */, F94F31E62A698E5D7EB3976F18400028 /* Headers */, ); @@ -627,7 +600,7 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; @@ -676,75 +649,75 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9A1B5AE4D97D5E0097B7054904D06663 /* Sources */ = { + 4C5A005C2839A42D2561421760901B18 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */, + AAB6E3FF4C203D1B4418B604C704EC5E /* AdditionalPropertiesClass.swift in Sources */, + 05AA1D0A4880C8B2E820E8AB9DB0CA0C /* AlamofireImplementations.swift in Sources */, + CB57E535A1515E3590E3ECFF8DD3040C /* Animal.swift in Sources */, + 58501155D7B20CF99109A4DC953CC266 /* AnimalFarm.swift in Sources */, + 33854474ACF02E42AD42AC08C523B54F /* APIHelper.swift in Sources */, + FEDEAFA3F155ACC48A61243BE97DC0FD /* ApiResponse.swift in Sources */, + F8284F679BA0722A2847F6DF984D3CC9 /* APIs.swift in Sources */, + C454A045AA0C3821D4143B435AADB863 /* ArrayOfArrayOfNumberOnly.swift in Sources */, + A7FDA0F12CCF0FE7407C4EE1D88D63D1 /* ArrayOfNumberOnly.swift in Sources */, + 81C4DD7F2D22A02649BF8D76955BDCB6 /* ArrayTest.swift in Sources */, + 057D51272B35EEE9D412EE4A012F273B /* Capitalization.swift in Sources */, + CFDC2507829B1FEF8C1319EFB91B9B2E /* Cat.swift in Sources */, + 9E4253E1905B0A36CAE0C590902BC030 /* Category.swift in Sources */, + C1C8EAD6D96212CEE77AE32B4C5B4689 /* ClassModel.swift in Sources */, + 44990E3C6099A47299E6E39B9BD01214 /* Client.swift in Sources */, + FE01173D208EA67C931846F08230E37F /* Configuration.swift in Sources */, + 473587DCDFAD50A5A2D7FEB93F3D28E1 /* Dog.swift in Sources */, + D7214BDCBD49ABCB18F79A04C8225B07 /* EnumArrays.swift in Sources */, + 4C172288F3ACD041084677D2C05DEF02 /* EnumClass.swift in Sources */, + 60A9299604ADCB164294555D66DD507F /* EnumTest.swift in Sources */, + 69F05AAB871A087A719B6B4383CBEA0F /* Extensions.swift in Sources */, + BB44263B22784220295C8DE96281AC0D /* Fake_classname_tags123API.swift in Sources */, + CCE24F24BF3EB1A2C514AB41B9BBF722 /* FakeAPI.swift in Sources */, + 45B9E69F6558F40D6C4AA9C1BCFA9FEA /* FakeclassnametagsAPI.swift in Sources */, + FC41F2E7439517DE7A562E935DA992F7 /* FormatTest.swift in Sources */, + 863FA751BBFDA85195E1B17CA2392236 /* HasOnlyReadOnly.swift in Sources */, + 953F99387D4F96C3CDA56DBF619716FD /* List.swift in Sources */, + 5887440665FFCF423171C4E5C3EFB9D1 /* MapTest.swift in Sources */, + 00433565417D8EB2877B80870AA37FC5 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 6872374F425855C8CADA536A71CD5DBE /* Model200Response.swift in Sources */, + FEA39C941A98DB246BE23697A4C556F1 /* Models.swift in Sources */, + 09CF911587060356512E13F57A1746E9 /* Name.swift in Sources */, + 71F5C69A53E4AAB624587E0966CDFD0B /* NumberOnly.swift in Sources */, + 5B01F54B86EA75E6E4A4C2A2EB2E8B07 /* Order.swift in Sources */, + D329D405FF7D2A9DEE1F03F00587E132 /* OuterBoolean.swift in Sources */, + 609113D6244720A747DD150234AB431C /* OuterComposite.swift in Sources */, + 9CD67121D1D4F1093AF9F7ADBFAF9BD6 /* OuterEnum.swift in Sources */, + 41A4833A4104452384C8200FECA468F7 /* OuterNumber.swift in Sources */, + 245C4B7A64DD93E776A57C420002ED8B /* OuterString.swift in Sources */, + 1C48756766427E6BB17C6F5C7672F0EF /* Pet.swift in Sources */, + EAFE09F156DA9CE33520DE9A83A0063A /* PetAPI.swift in Sources */, + 65C5109AD09965C1BD747668037F7895 /* PetstoreClient-dummy.m in Sources */, + A9E7F7A86DB2E1A97F472E8184EB8D62 /* ReadOnlyFirst.swift in Sources */, + 327DFA0268018413C4C6D9EAEE45FFF4 /* Return.swift in Sources */, + 4164BE89CE07197B165DE11BE00C81B6 /* SpecialModelName.swift in Sources */, + 7FF14684D2EDBA8FF4B8785919108F4A /* StoreAPI.swift in Sources */, + EA63D6A5D6D3063FEDC68902C60F7C44 /* Tag.swift in Sources */, + 2E4FA060FD9624B60A1B8A4AF3FB70EF /* User.swift in Sources */, + 43ECF64E02DB84925FBE5EC2F6569B22 /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { + 9A1B5AE4D97D5E0097B7054904D06663 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, + D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CD3DAB19C57804848F7D66F5279E6843 /* Sources */ = { + BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D9BF79730EE762AC51A1E80AF07630FF /* AdditionalPropertiesClass.swift in Sources */, - C64DBEC4A4254294548D699017753990 /* AlamofireImplementations.swift in Sources */, - 2177EDDA664C0BA1EB3ADC61C2655372 /* Animal.swift in Sources */, - 7B0462D90AD9B8227E19A0E02C95D3B0 /* AnimalFarm.swift in Sources */, - 805BA9618E7C950EE263D0D16B69F06F /* APIHelper.swift in Sources */, - 7F5A356FDD6E0F0F5ED900C457775533 /* ApiResponse.swift in Sources */, - B9ECE5F907BFE83230757B6B8CD23ADC /* APIs.swift in Sources */, - 90297F453E151E8545F92BDBC73D45D5 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 45E47E4344253C5B77E3E9ED1C05E47F /* ArrayOfNumberOnly.swift in Sources */, - FFE9B8A97889D749F05027DFAFFB15D7 /* ArrayTest.swift in Sources */, - BD0559EE6DB46E08B85340DA18AAAB19 /* Capitalization.swift in Sources */, - 6442625C7F3126D0BA36BB66830EE724 /* Cat.swift in Sources */, - CBCEE0519DD8043634653442B6BAE099 /* Category.swift in Sources */, - C0E01396AB8A57813746A94842C7FB94 /* ClassModel.swift in Sources */, - C04301A4207549D74AEDDA2501F6FB63 /* Client.swift in Sources */, - B51D2940B88C55A4122A1B0C5053A7D4 /* Configuration.swift in Sources */, - BD10A9B97B6A589B7EEA28008CF9DA25 /* Dog.swift in Sources */, - 19034A372FA3E67283FD2169CBD43FCF /* EnumArrays.swift in Sources */, - C1F7E595163DC7E970EB4FACCF9EC30F /* EnumClass.swift in Sources */, - 20240BAF3D28AFA92FDD48BF9DEC3A43 /* EnumTest.swift in Sources */, - 4D54B448BA8F0F2B02C444D7563CAC0A /* Extensions.swift in Sources */, - CDD2B7AF43D0DA455FBFD6E018802BDF /* Fake_classname_tags123API.swift in Sources */, - 00872D6B6ACEE96C198B5510C0997538 /* FakeAPI.swift in Sources */, - 88015C0F7BF74C07BBCECCD07639AE13 /* FakeclassnametagsAPI.swift in Sources */, - F9FCA34627D89660E8AD6F7CF58FF919 /* FormatTest.swift in Sources */, - 915898DFD89053345BBBD0139432F962 /* HasOnlyReadOnly.swift in Sources */, - F761113D92752856107A5C94B8C59AD2 /* List.swift in Sources */, - 36DE19C6C668C624F87DC0FFCBAEEE14 /* MapTest.swift in Sources */, - 92DCC761211B09FE7DBD9A59923F2506 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - F54A908073C5E36A97E0D518775847CE /* Model200Response.swift in Sources */, - 80939CE9D0E3A352AA29C9C288EB6615 /* Models.swift in Sources */, - 59F7A33B2152645DE6D53A43F2BB0A8C /* Name.swift in Sources */, - 901AB84DD73213A5C6F0263B25D600B7 /* NumberOnly.swift in Sources */, - 44F3B8E74A9272812C4F544304823A16 /* Order.swift in Sources */, - 99F517121515275CE8DDDC093B8175E3 /* OuterBoolean.swift in Sources */, - 7A6D9CD78F32A7E76D6F01A0419EFCC6 /* OuterComposite.swift in Sources */, - 21A619259418281F1FB820852336FE4C /* OuterEnum.swift in Sources */, - 3B4EE43319D9BB7B458AD7DE01D46330 /* OuterNumber.swift in Sources */, - A3515AD9F536A0FD2CAD67B3C0C6C271 /* OuterString.swift in Sources */, - 1F321A176227AA1FA599E45A0565C781 /* Pet.swift in Sources */, - 93D17EEA1A373AD5CFBFAB1C87363E28 /* PetAPI.swift in Sources */, - B87EE5307B9A0705B565A43F38CA548C /* PetstoreClient-dummy.m in Sources */, - 340CA80395279A0C39FA07FBBE3645FB /* ReadOnlyFirst.swift in Sources */, - BDDB3097BDBA28591D744D8B83E0A348 /* Return.swift in Sources */, - 165C454DEEB69E70196BFE087994A0BD /* SpecialModelName.swift in Sources */, - B120FBCC8FD9FF11983E822E3BFC1034 /* StoreAPI.swift in Sources */, - 69CF0E67E1F9B8DDB0A6B1F74ADC2B54 /* Tag.swift in Sources */, - 1BB6AAECC938CDE37E479B85AD357A19 /* User.swift in Sources */, - F802493057754569CDC9C3F559585098 /* UserAPI.swift in Sources */, + 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -772,10 +745,11 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */ = { + 077C4BB7DBEAA715DED46C057DC8051C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -797,6 +771,8 @@ PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -804,10 +780,104 @@ }; name = Release; }; - 449E8CC3ED63B338F8FCB9F9BC3786DF /* Release */ = { + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6B59346B3AB8E509089589F4EDBEE69C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -829,6 +899,8 @@ PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -836,10 +908,11 @@ }; name = Release; }; - 68DA504E816194CDC86A0ACEFDE4CCE4 /* Debug */ = { + 86E66B7CE6321797D5D4EB3E7593B23B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -851,16 +924,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PetstoreClient; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -869,15 +947,16 @@ }; name = Debug; }; - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */ = { + 8ABD810FE320ED013B51DFEA7CBA6A0D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; + baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -890,7 +969,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -898,54 +977,54 @@ PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */ = { + 9C5DAD5759A0A21C275605C95B748A4D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; + baseConfigurationReference = E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */ = { + C66477B6E5656B1F4785FD5D9546905A /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -978,94 +1057,11 @@ }; name = Release; }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1077,20 +1073,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1098,10 +1092,11 @@ }; name = Debug; }; - F383079BFBF927813EA3613CFB679FDE /* Debug */ = { + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1113,17 +1108,20 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Alamofire; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1137,8 +1135,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */, + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1146,8 +1144,8 @@ 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - F383079BFBF927813EA3613CFB679FDE /* Debug */, - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */, + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */, + 077C4BB7DBEAA715DED46C057DC8051C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1155,8 +1153,8 @@ 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */, - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */, + 86E66B7CE6321797D5D4EB3E7593B23B /* Debug */, + 8ABD810FE320ED013B51DFEA7CBA6A0D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1164,8 +1162,8 @@ B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */, - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */, + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */, + C66477B6E5656B1F4785FD5D9546905A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1173,8 +1171,8 @@ F3A56D5CC2C98220366FF2A73BD8D5DD /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 68DA504E816194CDC86A0ACEFDE4CCE4 /* Debug */, - 449E8CC3ED63B338F8FCB9F9BC3786DF /* Release */, + 9C5DAD5759A0A21C275605C95B748A4D /* Debug */, + 6B59346B3AB8E509089589F4EDBEE69C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h index 02327b85e88..00014e3cd82 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig index 772ef0b2bca..619e5f4acef 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist index df276491a16..c1c4a98b9a1 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.0 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h index 435b682a106..2a366623a36 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig index 323b0fc6f1d..904973a3bdc 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -6,5 +6,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh index d3d3acc3025..4d253d90186 100755 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -84,10 +102,13 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h index 2bdb03cd939..b7da51aaf25 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig index a5ecec32a87..ad32982f5bf 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig index a5ecec32a87..ad32982f5bf 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh index 893c16a6313..88dd5379907 100755 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -82,3 +100,6 @@ strip_invalid_archs() { fi } +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h index 950bb19ca7a..b2e4925a9e4 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig index d578539810a..a3871374db0 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig index d578539810a..a3871374db0 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 2728b93f24d..1406071ba7e 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -313,9 +313,14 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -373,13 +378,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */ = { @@ -388,13 +396,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */ = { diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec index 1fa9b6fa7da..586be868c71 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec @@ -9,6 +9,6 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'PromiseKit', '~> 4.2.2' - s.dependency 'Alamofire', '~> 4.0' + s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock index 4741cc730ae..3add4cf9b4a 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock @@ -1,32 +1,22 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) - - PromiseKit (~> 4.2.2) - - PromiseKit (4.2.2): - - PromiseKit/Foundation (= 4.2.2) - - PromiseKit/QuartzCore (= 4.2.2) - - PromiseKit/UIKit (= 4.2.2) - - PromiseKit/CorePromise (4.2.2) - - PromiseKit/Foundation (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/QuartzCore (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/UIKit (4.2.2): - - PromiseKit/CorePromise + - Alamofire (~> 4.5.0) + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.0) DEPENDENCIES: - PetstoreClient (from `../`) EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 87f5c85fc96f3c001c6a9f9030e3cf1a070aff4f - PromiseKit: 00e8886881f151c7e573d06b437915b0bb2970ec + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: 529644d7d853d985a2748d43c7d4848db0fd62bb + PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md index 12ea4c74775..e1966fdca00 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md @@ -57,8 +57,8 @@ In order to keep Alamofire focused specifically on core networking implementatio ## Requirements - iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1+ -- Swift 3.0+ +- Xcode 8.1, 8.2, 8.3, and 9.0 +- Swift 3.0, 3.1, 3.2, and 4.0 ## Migration Guides @@ -137,21 +137,21 @@ dependencies: [ ### Manually -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. #### Embedded Framework - Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: ```bash -$ git init -``` + $ git init + ``` - Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: ```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` - Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. @@ -191,13 +191,16 @@ Handling the `Response` of a `Request` made in Alamofire involves chaining a res ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.request) // original URL request - print(response.response) // HTTP URL response - print(response.data) // server data - print(response.result) // result of response serialization + print("Request: \(String(describing: response.request))") // original url request + print("Response: \(String(describing: response.response))") // http url response + print("Result: \(response.result)") // response serialization result - if let JSON = response.result.value { - print("JSON: \(JSON)") + if let json = response.result.value { + print("JSON: \(json)") // serialized json response + } + + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") // original server data as UTF8 string } } ``` @@ -243,7 +246,7 @@ func responsePropertyList( None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. -> For example, response status codes in the `400..<499` and `500..<599` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. +> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. #### Response Handler @@ -345,18 +348,18 @@ Alamofire.request("https://httpbin.org/get") .validate(statusCode: 200..<300) .validate(contentType: ["application/json"]) .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } } ``` #### Automatic Validation -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. +Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. ```swift Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in @@ -491,7 +494,7 @@ struct JSONStringArrayEncoding: ParameterEncoding { } func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = urlRequest.urlRequest + var urlRequest = try urlRequest.asURLRequest() let data = try JSONSerialization.data(withJSONObject: array, options: []) @@ -612,9 +615,9 @@ Requests made in Alamofire that fetch data from a server can download the data i ```swift Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -629,8 +632,8 @@ You can also provide a `DownloadFileDestination` closure to move the file from t ```swift let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) } @@ -638,16 +641,16 @@ let destination: DownloadRequest.DownloadFileDestination = { _, _ in Alamofire.download(urlString, to: destination).response { response in print(response) - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } + if response.error == nil, let imagePath = response.destinationURL?.path { + let image = UIImage(contentsOfFile: imagePath) + } } ``` You can also use the suggested download destination API. ```swift -let destination = DownloadRequest.suggestedDownloadDestination(directory: .documentDirectory) +let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download("https://httpbin.org/image/png", to: destination) ``` @@ -661,9 +664,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -677,9 +680,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -691,34 +694,34 @@ If a `DownloadRequest` is cancelled or interrupted, the underlying URL session m ```swift class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? + private var resumeData: Data? + private var image: UIImage? func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } + guard image == nil else { completion(image) ; return } - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) + } - let request: DownloadRequest + let request: DownloadRequest if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") + request = Alamofire.download(resumingWith: resumeData) + } else { + request = Alamofire.download("https://httpbin.org/image/png") } request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } + switch response.result { + case .success(let data): + self.image = UIImage(data: data) + case .failure: + self.resumeData = response.resumeData + } } } } @@ -816,7 +819,7 @@ In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetr ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) + print(response.metrics) } ``` @@ -824,8 +827,8 @@ It's important to note that these APIs are only available on iOS and tvOS 10 and ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0. *) { - print(response.metrics) + if #available(iOS 10.0, *) { + print(response.metrics) } } ``` @@ -854,10 +857,10 @@ Outputs: ```bash $ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" + -H "User-Agent: Alamofire/4.0.0" \ + -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "https://httpbin.org/get?foo=bar" ``` --- @@ -1183,20 +1186,20 @@ The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` t ```swift class AccessTokenAdapter: RequestAdapter { - private let accessToken: String + private let accessToken: String - init(accessToken: String) { - self.accessToken = accessToken - } + init(accessToken: String) { + self.accessToken = accessToken + } - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } - return urlRequest + return urlRequest } } ``` @@ -1414,7 +1417,7 @@ func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alam } loadUser { response in - if let user = userResponse.value { + if let user = response.value { print("User: { username: \(user.username), name: \(user.name) }") } } @@ -1749,24 +1752,24 @@ If you run into this problem (high probability with self-signed certificates), y ```xml - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - + NSAppTransportSecurity + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.2 + + + ``` @@ -1851,4 +1854,4 @@ The community adoption of the ASF libraries has been amazing. We are greatly hum ## License -Alamofire is released under the MIT license. See LICENSE for details. +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift index 86d54d85932..edcf717ca9e 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -53,7 +53,7 @@ extension URL: URLConvertible { } extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherise throws an `Error`. + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. /// /// - throws: An `AFError.invalidURL` if `url` is `nil`. /// diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift index 6d0d5560666..c5093f9f857 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -92,7 +92,7 @@ open class MultipartFormData { // MARK: - Properties /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open var contentType: String { return "multipart/form-data; boundary=\(boundary)" } + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift index 888818df77c..30443b99b29 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -182,21 +182,24 @@ public class NetworkReachabilityManager { // MARK: - Internal - Network Reachability Status func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.reachable) else { return .notReachable } + guard isNetworkReachable(with: flags) else { return .notReachable } - var networkStatus: NetworkReachabilityStatus = .notReachable + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - if !flags.contains(.connectionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif - if flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) { - if !flags.contains(.interventionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } - } + return networkStatus + } - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - return networkStatus + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift index 242f6a83dc1..959af6f9365 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -241,8 +241,11 @@ public struct URLEncoding: ParameterEncoding { let value = parameters[key]! components += queryComponents(fromKey: key, value: value) } - + #if swift(>=4.0) + return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") + #else return components.map { "\($0)=\($1)" }.joined(separator: "&") + #endif } private func encodesParametersInURL(with method: HTTPMethod) -> Bool { diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift index 78864952dca..4f6350c5bfe 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -46,7 +46,7 @@ public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: Tim public protocol RequestRetrier { /// Determines whether the `Request` should be retried by calling the `completion` closure. /// - /// This operation is fully asychronous. Any amount of time can be taken to determine whether the request needs + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly /// cleaned up after. /// @@ -269,7 +269,7 @@ extension Request: CustomDebugStringConvertible { } func cURLRepresentation() -> String { - var components = ["$ curl -i"] + var components = ["$ curl -v"] guard let request = self.request, let url = request.url, diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift index 47780fd611b..1a59da550a7 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -88,11 +88,12 @@ public struct DownloadResponseSerializer: DownloadResponseSerializerProto extension Request { var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime return Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), + requestStartTime: requestStartTime, initialResponseTime: initialResponseTime, requestCompletedTime: requestCompletedTime, serializationCompletedTime: CFAbsoluteTimeGetCurrent() diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift index c13b1fcf77b..bf7e70255b7 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -162,7 +162,7 @@ extension Result { /// try print(noInt.unwrap()) /// // Throws error /// - /// - parameter transform: A closure that takes the success value of the result instance. + /// - parameter transform: A closure that takes the success value of the `Result` instance. /// /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the /// same failure. @@ -200,4 +200,101 @@ extension Result { return .failure(error) } } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) -> Void) -> Result { + if case let .success(value) = self { closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) -> Void) -> Result { + if case let .failure(error) = self { closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () -> Void) -> Result { + if isSuccess { closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () -> Void) -> Result { + if isFailure { closure() } + + return self + } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift index 27ad88124c2..8edb492b699 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -36,7 +36,7 @@ open class SessionDelegate: NSObject { open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? @@ -48,21 +48,21 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, (URLRequest?) -> Void) -> Void)? + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, (InputStream?) -> Void) -> Void)? + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? @@ -77,7 +77,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, (URLSession.ResponseDisposition) -> Void) -> Void)? + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? @@ -90,7 +90,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, (CachedURLResponse?) -> Void) -> Void)? + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? // MARK: URLSessionDownloadDelegate Overrides @@ -462,8 +462,8 @@ extension SessionDelegate: URLSessionTaskDelegate { // Determine whether an error has occurred var error: Error? = error - if let taskDelegate = self[task]?.delegate, taskDelegate.error != nil { - error = taskDelegate.error + if request.delegate.error != nil { + error = request.delegate.error } /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift index 450f750de41..493ce29cb4e 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -58,10 +58,18 @@ open class SessionManager { let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + #if swift(>=4.0) + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in + let (index, languageCode) = enumeratedLanguage + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + #else let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in let quality = 1.0 - (Double(index) * 0.1) return "\(languageCode);q=\(quality)" }.joined(separator: ", ") + #endif // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index bb3757ea0e4..bfdc58db09e 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -13,13 +13,13 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", + "source_files": "PetstoreClient/Classes/**/*.swift", "dependencies": { - "PromiseKit": [ - "~> 4.2.2" + "PromiseKit/CorePromise": [ + "~> 4.4.0" ], "Alamofire": [ - "~> 4.0" + "~> 4.5.0" ] } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock index 4741cc730ae..3add4cf9b4a 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock @@ -1,32 +1,22 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) - - PromiseKit (~> 4.2.2) - - PromiseKit (4.2.2): - - PromiseKit/Foundation (= 4.2.2) - - PromiseKit/QuartzCore (= 4.2.2) - - PromiseKit/UIKit (= 4.2.2) - - PromiseKit/CorePromise (4.2.2) - - PromiseKit/Foundation (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/QuartzCore (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/UIKit (4.2.2): - - PromiseKit/CorePromise + - Alamofire (~> 4.5.0) + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.0) DEPENDENCIES: - PetstoreClient (from `../`) EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 87f5c85fc96f3c001c6a9f9030e3cf1a070aff4f - PromiseKit: 00e8886881f151c7e573d06b437915b0bb2970ec + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: 529644d7d853d985a2748d43c7d4848db0fd62bb + PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index a86b3f7be29..d56472dd444 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,137 +7,111 @@ objects = { /* Begin PBXBuildFile section */ - 00AE735CE141EE30127B4BA8F9E76F52 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */; }; - 021FC8944F822A8CD0C09E4909362F57 /* NSTask+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 03EBF4756A7F00AAAF7539763B1369DF /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */; }; - 05B6EBCF31361396F3F6F6BA9CA8981C /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */; }; - 05DB8C9CF146F8BBBE34FE27016663AE /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4655B4C1707E9902435774C9B1981618 /* Error.swift */; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */; }; - 1180D7B29C021ABC9DA76A1259C21495 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */; }; - 1205F9FB275A26FF7CBA58AD9E6245F8 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */; }; - 1384EAAAC7ABCAEEEBD94AF716C3633D /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */; }; - 14A3D61A011506D7769CB673529C435F /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 053E27E4E66AB2D2151D9776585F1FA7 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */; }; + 05A6FFA5B3630FD63A5CFA863DEFFE4F /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */; }; + 06338FA7F6A0C237789ED8BDCB637AD3 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */; }; + 0667FE82295343616E4C3E975E61E2DE /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */; }; + 09882E9EDEBB7356D33B97A5934E3227 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */; }; + 0A04A65465FDD547158AA925C95F6B69 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */; }; + 0B2977ECFB1DCD215E8A05E477DDBA6A /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */; }; + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */; }; + 1205979ACE7FBA4EB49E5653FA2D1C21 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */; }; + 146087D66852238BD415594F4096CDB7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 580886F727A89668FA28D3BA11678585 /* Order.swift */; }; + 179674B41CDC3DCEE7DB902C0F553285 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */; }; + 17AA9C279DC342C47E2E3002B30CA60D /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */; }; + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1D9F8E6252D07755D7145BD5B01A2001 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */; }; + 1DE9D90349D9177D527C15E5A57D7031 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */; }; 20E2CC1FD887EC3DA74724A32DDA1132 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2119AA1235F02D674932AA4553241B13 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */; }; - 2AC12E6B5F4733E03D0F74F14CA1B7E3 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */; }; - 2B86E7C61F0D8144F603B3219D1EE5F0 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */; }; - 2D32BD197307B255AF154F8AA5F80A17 /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */; }; - 2DB1EF11BA493EC94CDB662690F29D82 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */; }; - 31933E0DBDB8B5DA4A1EF081182E3135 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */; }; + 264F59B087C997C8DAF2A010366FD9B0 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */; }; + 277E86F43EC003B6FF423B020D732A9D /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */; }; + 2B00D1C16A6142361F09AE15EFC5827E /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */; }; + 2B86E7C61F0D8144F603B3219D1EE5F0 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */; }; + 2D040E855A9DBDC57A921ED5232836BB /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */; }; + 2E3E42AF5ACF1DA12162BEE3755C79C0 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */; }; 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3213654062575EFFE78A26076769C254 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */; }; - 32E48B06C9B289AC824EFC5FC46ACD85 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */; }; - 39BCF1CBAAB69EF35F5FF9FE84A81A6C /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3B99645FCBC7378836F859E03DE8C491 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */; }; - 3BEC5705183323854239200B999CAC07 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */; }; - 42EEDCC2613F4DD5E8FD7BB429A170EA /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */; }; - 4309497092D988593DE5D2137CD808AD /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */; }; - 44FFC1F228054E87F551ECBA3DD7BE2D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 45547F8809A318B8AE7AEFE8B14A869C /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */; }; - 45C511A7202B6FC08FDB0BD7E8B44019 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */; }; - 46041A699942E1600867DEEB13992BE2 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */; }; - 4A1E1686A12C01F36DC059192EB3042C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - 4AF64E6397E24FD9E27BBB094C89001C /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */; }; - 510C600486A97DF541E663B65B6FCCF6 /* PMKFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */; }; - 55B892FD60ED2679FDAC0DFDC1488BB1 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */; }; - 585672293C7E73B936156A1E9D856AF9 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */; }; - 58E1D15A9B2FF257FB7A816E58120E32 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */; }; - 5C0E7490B3DEB82B0EF7EE1FE0573AE5 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34799A80ED15D28ACA081A72E275921F /* List.swift */; }; - 5D0F2FB1B7AB221402136B397F2B2000 /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */; }; - 61643E772F1E1ACFB7F7428AE8F61562 /* PMKUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */; }; - 68EDADC20A85BF0FA2134C6B4B427F32 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6A4EFF9B8CF466057B0F57430999B554 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */; }; - 6A93921D8EE5ABAFB8D1F8B4DF0A5F63 /* PMKQuartzCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6F2439D907B62A506DA1D9021A589B7B /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - 7100ED065F8CA5B45AEC5E1E6BA0B248 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05F43847135C8DA403312FBEDB1F49F /* after.swift */; }; - 712AF6626F00820E315BE76E58EC8BCE /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */; }; - 7653C1054C8D3401DD847D53C85EC93B /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */; }; - 76DD148C7F62FDAC04174816CBF8DDE2 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 78E723118197F97FCBB87B31F2F7F6D3 /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 79711BECA8E82F8F13C383165E10E9B0 /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */; }; - 797B115762C062A4E751040E6B6F89F3 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7B044D88B902C5D737BFF5329A3FF539 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 294315D43C85053FB22B37668F5D511C /* Dog.swift */; }; - 7B5BF51A70C8EDE049A4EF840DB0F486 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */; }; - 7F536CD485DDE02D076F44489FD7877A /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */; }; - 8097FDFC90106EB1EE632DBA2D3E8F85 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8239BA5EBA3A8CB1D49D3536B5E4802F /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */; }; - 852BB8DDE60D9CC98133B05A88743C6A /* NSURLSession+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 85B1AEDEC0BA9AC4818F0E4130B2B2A6 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */; }; - 8618AB24631FD4684AB906F54601DCAB /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */; }; - 8662FB72EB2BC969C4CD400317B55A7B /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */; }; - 86C2AFC5EEC3A4E1EE4F55EBEDA9478B /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */; }; + 33D656C917337CEA212DB903ECD0E6C0 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */; }; + 344E99585E0E1F196B6E8E9D5E2EC2A5 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */; }; + 35910E5DCB2E234D2D743D899E50A83D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */; }; + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */; }; + 38067FEC32DCDB6E4F6215EAD63437C3 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */; }; + 3E9543717A86AC66C62BEBF05326977F /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */; }; + 3F4E19A844EFA6C087276743DF604FDF /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */; }; + 403E2169606F2DEEA7EAAAC045B46BEF /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4049562FD0514CC1979A8AD7EF001AD1 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */; }; + 40F309F2DDD2EC48E7A24D35CA9EA368 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */; }; + 4CF3C7AAB7A5940C292EE3CCC3A3C4D0 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = E775A7621846699F1A762DB966B3DC48 /* State.swift */; }; + 4E63F97E3E36D9A8576F710D193EB330 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */; }; + 5135F85CE891C74CF289365F3D665B62 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */; }; + 5140E3AF1B2AC4EF35D24062003B822D /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */; }; + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */; }; + 545704EF756212DC400A4C252806077D /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */; }; + 587447A22F4AB55382FAE09950120C8B /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */; }; + 58BC833C2E0ACD339E79A966F9C937B7 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */; }; + 5CBFA7F10B16CE082F3DEB42782BB20B /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */; }; + 5E9A0AA061E16D2F41B0DA9A56C0A5A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 5EB6840C80C4AF36E53852FA25B9FE2E /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 47F1D5162720B2001CA614017A1ACE90 /* join.m */; }; + 5F255DAA5EC5598D66A2A22A052C4642 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */; }; + 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */; }; + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */; }; + 655906A84ACFBE897B9B0854CA5ED146 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */; }; + 667E578EA712E1DF2380BF164C5E29AA /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 67EEBC5D0C5449E64F7070B12742BE5C /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */; }; + 6DAC90FE278E810EA89A32891F6F726D /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */; }; + 6F6D5E95B91D0B89D19D8B07CC34B058 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 76020E5CECD3FCC592D2C59CB2EC27FA /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */; }; + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */; }; + 8097FDFC90106EB1EE632DBA2D3E8F85 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82310F627E8C49D9F906723C6C3DA3BA /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */; }; + 86E587687F8286990E1BD25FD5AB0A37 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */; }; + 870322F063522D314752502D12D30BF3 /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */; }; 8740BC8B595A54E9C973D7110740D43F /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - 88095F6CA2DC6E9B36975A3E21E28AFF /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 152E92E58DF288044CE0369CD8522B52 /* when.m */; }; + 87C6D2D31470ECE88A057BB415CA093A /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */; }; + 887BBB5306DA732DD350E38BAAABB118 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 9281A656581F8E04235B285C6F5EB438 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */; }; - 9E90AD26774E22A9E328883AE3C9925D /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */; }; - 9FD10E6ED1B5B5EA96F4AFA67BD5B68B /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - A058CE758710D8443F7783A8D74364FF /* Process+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */; }; - A14BE5430F11267F9F62FAB0A0917F35 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */; }; - A7BF87774CB4D2E76F44232B4988D78C /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */; }; - A94275D3AD0D80CE3BE29D18715C71A0 /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */; }; - A9CB3C2EA2748F00E024FA61BCE9FFFE /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */; }; - AA971FBDAEAF91B8C041BA8B95E43590 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */; }; - ACE11EF053DF39BCE87DD0E521A0C327 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */; }; - ADD894849BDFA16152809733E7BCA60C /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */; }; - B1DA57908C7A1BEC139513C0AAFA54B6 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */; }; - B23A73A52421CC5A31BF3FD51DFE1BA7 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BE96A09834700FF4412EC718B536E9 /* Client.swift */; }; - B23B0D9079C5F3BE95110ED1ADA0718F /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */; }; - B6716993AC2C3655A096BBCBC9693DBF /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */; }; - B8D6C9F11B175495E86D314262B408D7 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A3989139854636389CEF47FEAE202A /* Tag.swift */; }; - BA64F2E60866E12834650E0683C1373A /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943618599D753D3CF9CEA416875D6417 /* Validation.swift */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */; }; - BF17703B30F78FEF14FECAE279D320E8 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */; }; - C0C4450B687C7F4706A5E8ADD7826A85 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - C2B3B5C0B17EA390721049716E25B770 /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */; }; - C3A0F4845CE745C91883384B53449091 /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C4D198833073E7EFEAFC9C4263CC4806 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */; }; - C57AD14B33D2E06ACF3D73B01DE8BFF8 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5021828D3563560F50658622F55322A /* Response.swift */; }; - CC01511F30DA21BFC02CC7E0010C3EB5 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CC2FB9FC1FDF19D7F8A5C41E423B6345 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */; }; - CD321447387D3EBFBA1FC4A9359A6302 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */; }; - CE2E9F8E06D334952C90FEA6A021F491 /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */; }; - CEAB847312816BB908B4A17D3046D123 /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */; }; - CEFA45B71C73A8EA04D03487E489A34C /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */; }; - CF61EA0C644C917AFEF6CCD9CD2AB1D5 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */; }; - CF84D807380AFCF3CC8B265913096DA4 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */; }; - D07EB1A05D309FDD823342C50097D061 /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */; }; - D2EEBD9040A94AAF7311342F572A8899 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - D686273FC039EB5FB1FBA8437296FE66 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */; }; - D68AE22561437C58D0FE01A529A288F8 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */; }; - DA4D8309E45A9B47E134BF34CF29E7CD /* NSURLSession+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */; }; - DB1605584C05A8F7319769537250FAB2 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */; }; - DB72510346E3BAB8A64D9F3FFEEDD109 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */; }; - E0C193EB0EF996BACE6BDEF6FAC35376 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */; }; - E0C2AD1CFD854FBE4D92B39C306C1074 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - E4448526305BE877838BD7D1061F2CFC /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */; }; - E55687FB1733657A7C1D650E8DCCC16D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */; }; - E615EE70BF8A3A8D99ADE8D4FB43B18F /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */; }; - EBFF8628E17002C54372B1AF29B4A76A /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */; }; - F19D36486E510F0039DF570B58D67916 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */; }; - F83211327A6C910D75E6F1C03283B7A4 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */; }; - FA265D04091BF3838B0C7ABE484CA080 /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FC42DC8E07B65FE4A25C6A6CAF0BE887 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */; }; - FE5952EE9CEA3BC1B7991C60C985E98A /* NSTask+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */; }; + 97AB35CEB1F8147F512C403765C24366 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22932972F4F492160D4694C01CAF311D /* Promise.swift */; }; + 9B605CCF6FBB08279AAAF5A1E08E8019 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */; }; + 9B80CE10037E884E4F14B60E5BCEF038 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */; }; + 9D4D03BC83CA4C1FDA0C88CC8B386B30 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */; }; + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */; }; + A03C561A3CE745179C9F246A5B8D7E21 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + A1083DDC06C37F84D105231BC7AC2078 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */; }; + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */; }; + A6A60DD672777F2A2AC647658506B2C9 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885795F7A7783B007F026944B55862FF /* Models.swift */; }; + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */; }; + AC0DC62D4728E6A27014ED1D5DB39869 /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */; }; + AD96DA86AD0D6C1D132B5EEEC33758FD /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6251246DA0044C165AC891CDE64344 /* hang.m */; }; + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */; }; + AF95CFE493C440AE05EFDAACE7E4E7DE /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */; }; + B24ED08E9E7E64C67C7F886A1B26C9C4 /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */; }; + B2B48F66496BB746373C6B7A0D209F36 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */; }; + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */; }; + BB27103F0D590065B8B96158A158C07E /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */; }; + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */; }; + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */; }; + C17B1A5739A83DE224286D84B67D4F2A /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */; }; + C23C578EB36914B7B7993ACB7451DAEE /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */; }; + C25AC96F7A1662899D9B7369AD5C3718 /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C57027F4FF1F8BA21E021D7378186BAF /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */; }; + C84C5C33E6C3CD718D8D3D6839F5BB77 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */; }; + C8F87B4EC3E7D6B2EA869BB0A2B24A5E /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7824BE1937712800889974B222CAB1AD /* GlobalState.m */; }; + CB553CE49FF0AF2C666B96C680173F65 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */; }; + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */; }; + D61F5BF2B4BBB073BF87700BAE29B79D /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */; }; + D9495580483FAECB1F454A88F5E98425 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */; }; + E25942E2E76810D3C819B2C624AFA087 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */; }; + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + E7646AE8D28791DE9F6738F8429C6AB8 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E79B2343A16824E335FF99F92D100B56 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */; }; + ECB7ADCAB05E41A34AE5D162F76B48CA /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */; }; + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */; }; + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */; }; + F702666B7BC058BDEFF8798F3022141C /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */; }; + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */; }; + FC42DC8E07B65FE4A25C6A6CAF0BE887 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -179,167 +153,141 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = ""; }; 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; - 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Process+Promise.swift"; path = "Extensions/Foundation/Sources/Process+Promise.swift"; sourceTree = ""; }; - 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; - 08BC2EAEE303ADCEB346C66DA76C7B56 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 0A0A7AF3E4D82A790BC8A16BB4972FA7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; + 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; + 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/Swaggers/APIHelper.swift; sourceTree = ""; }; 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; - 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; - 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; - 152E92E58DF288044CE0369CD8522B52 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; - 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; - 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; - 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; - 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; + 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 17FF216D0378037475BAB48A20D5CB0F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + 1F11D15E4489C7F4DC1171EB9F5448D0 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + 22932972F4F492160D4694C01CAF311D /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; + 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; + 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; + 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 294315D43C85053FB22B37668F5D511C /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PMKAlertController.swift; path = Extensions/UIKit/Sources/PMKAlertController.swift; sourceTree = ""; }; - 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; - 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; - 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - 34799A80ED15D28ACA081A72E275921F /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; - 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - 39BE96A09834700FF4412EC718B536E9 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m"; sourceTree = ""; }; - 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; - 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; - 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.h"; sourceTree = ""; }; + 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/Swaggers/Configuration.swift; sourceTree = ""; }; + 34E180DB9A06BFDDA525853716B57541 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; + 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; + 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 4655B4C1707E9902435774C9B1981618 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; - 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKUIKit.h; path = Extensions/UIKit/Sources/PMKUIKit.h; sourceTree = ""; }; - 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 4C1356040CC9A1CCCED79A1A510AF74E /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Extensions/UIKit/Sources/UIViewController+AnyPromise.m"; sourceTree = ""; }; - 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Extensions/Foundation/Sources/afterlife.swift; sourceTree = ""; }; - 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; - 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; - 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 47F1D5162720B2001CA614017A1ACE90 /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; + 48CCB9793CCE13A24831B3E01B29171A /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; + 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/Swaggers/APIs.swift; sourceTree = ""; }; + 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKQuartzCore.h; path = Extensions/QuartzCore/Sources/PMKQuartzCore.h; sourceTree = ""; }; - 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Extensions/UIKit/Sources/UIView+AnyPromise.m"; sourceTree = ""; }; - 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 63A3989139854636389CEF47FEAE202A /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; - 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; + 580886F727A89668FA28D3BA11678585 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 5E79C2313007533BFFA709832BE18FDC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; + 607281BBD24DC152F24F58E6046F4652 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; + 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; + 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Extensions/UIKit/Sources/UIView+AnyPromise.h"; sourceTree = ""; }; - 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSTask+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSTask+AnyPromise.h"; sourceTree = ""; }; - 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; - 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLDataPromise.swift; path = Extensions/Foundation/Sources/URLDataPromise.swift; sourceTree = ""; }; - 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 776D1D6E37D1EF4B16870DB0A90BD5B6 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; - 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; + 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 694EDDB57CDB8FB6CB5088BF3F66CE8A /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 6D7294312CFFF12B79A7AD2E8D219344 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; + 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 7824BE1937712800889974B222CAB1AD /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; + 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; - 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h"; sourceTree = ""; }; - 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; - 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Extensions/UIKit/Sources/UIView+Promise.swift"; sourceTree = ""; }; + 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; + 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 855FBD05ABAD1AE4A03E58EEBA975DAA /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; + 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift"; sourceTree = ""; }; - 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 885795F7A7783B007F026944B55862FF /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/Swaggers/Models.swift; sourceTree = ""; }; + 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Promise.swift"; path = "Extensions/UIKit/Sources/UIViewController+Promise.swift"; sourceTree = ""; }; + 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 943618599D753D3CF9CEA416875D6417 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; + 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSURLSession+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSURLSession+AnyPromise.h"; sourceTree = ""; }; - 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; - A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSTask+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSTask+AnyPromise.m"; sourceTree = ""; }; - A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; - AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = ""; }; + 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; + A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; - B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Extensions/Foundation/Sources/NSURLSession+Promise.swift"; sourceTree = ""; }; - BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.m"; sourceTree = ""; }; + AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; + BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Extensions/UIKit/Sources/UIViewController+AnyPromise.h"; sourceTree = ""; }; - C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKFoundation.h; path = Extensions/Foundation/Sources/PMKFoundation.h; sourceTree = ""; }; - C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; - CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; + CA6251246DA0044C165AC891CDE64344 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; + CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - D5021828D3563560F50658622F55322A /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; - D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; + D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; + D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; - E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSURLSession+AnyPromise.m"; sourceTree = ""; }; + E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Extensions/Foundation/Sources/NSObject+Promise.swift"; sourceTree = ""; }; - E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + E775A7621846699F1A762DB966B3DC48 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; + E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; - E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; - F05F43847135C8DA403312FBEDB1F49F /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; - F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -347,7 +295,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0C4450B687C7F4706A5E8ADD7826A85 /* Foundation.framework in Frameworks */, + 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -355,7 +303,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -363,7 +311,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -372,162 +320,191 @@ buildActionMask = 2147483647; files = ( 2B86E7C61F0D8144F603B3219D1EE5F0 /* Alamofire.framework in Frameworks */, - E0C2AD1CFD854FBE4D92B39C306C1074 /* Foundation.framework in Frameworks */, + A03C561A3CE745179C9F246A5B8D7E21 /* Foundation.framework in Frameworks */, FC42DC8E07B65FE4A25C6A6CAF0BE887 /* PromiseKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D311E824FD60E99F5FA6759A4D47BFB0 /* Frameworks */ = { + A4294342AAE4322C007571DAA6D36C0B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4A1E1686A12C01F36DC059192EB3042C /* Foundation.framework in Frameworks */, - 2119AA1235F02D674932AA4553241B13 /* QuartzCore.framework in Frameworks */, - D686273FC039EB5FB1FBA8437296FE66 /* UIKit.framework in Frameworks */, + 5E9A0AA061E16D2F41B0DA9A56C0A5A4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 07B4ADF8C410B092809517B0BAB36E30 /* Foundation */ = { + 0BDA8E0BE198EED1AD88B926509C3382 /* PetstoreClient */ = { isa = PBXGroup; children = ( - 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */, - 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */, - 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */, - 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */, - E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */, - 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */, - A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */, - 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */, - E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */, - BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */, - C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */, - 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */, - 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */, + 00925AB5384C3976E53F0437FE1311C5 /* AlamofireImplementations.swift */, + 0B3E802F6708C08B257C5E6F550D3FDB /* APIHelper.swift */, + 4FF2F015C5D4E807D437D0EE9528B3CE /* APIs.swift */, + 311A10F75B7649E2E301E8EC58A6A5EA /* Configuration.swift */, + 9DAD68F75B538EE67EB80CC354DCE787 /* Extensions.swift */, + 885795F7A7783B007F026944B55862FF /* Models.swift */, + 45EE0834297896279B488DCD3D66C373 /* APIs */, + 28BE76357A2CB1D1115C90F572A15193 /* Models */, + E44C17565AC7C2BF978747A8E3FBDEAA /* Support Files */, ); - name = Foundation; + name = PetstoreClient; + path = ../..; sourceTree = ""; }; - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { + 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */ = { isa = PBXGroup; children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, + 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */, + A5A38542CF9E498066C1C41B2E15BBFF /* Support Files */, ); - name = "Development Pods"; + name = PromiseKit; + path = PromiseKit; sourceTree = ""; }; - 27454559852AC8B9DDF3F084C1E09F22 /* PromiseKit */ = { + 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */ = { isa = PBXGroup; children = ( - 6B8BED723E1865D5B9F1AC8B17FF7035 /* CorePromise */, - 07B4ADF8C410B092809517B0BAB36E30 /* Foundation */, - ADEB788C7842BDA6F8D266DFB6B6D00D /* QuartzCore */, - 8349D367FE0957C4AFA12D8CA5EA5B44 /* Support Files */, - 4C35F42FA9EA91ABFFA7ECEDDFB2E61A /* UIKit */, + 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */, + B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */, + 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */, + CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */, + C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */, + ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */, + 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */, + 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */, + 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */, + 7824BE1937712800889974B222CAB1AD /* GlobalState.m */, + CA6251246DA0044C165AC891CDE64344 /* hang.m */, + 47F1D5162720B2001CA614017A1ACE90 /* join.m */, + 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */, + 22932972F4F492160D4694C01CAF311D /* Promise.swift */, + 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */, + 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */, + 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */, + 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */, + E775A7621846699F1A762DB966B3DC48 /* State.swift */, + 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */, + 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */, + 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */, + DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */, ); - name = PromiseKit; - path = PromiseKit; + name = CorePromise; sourceTree = ""; }; - 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */ = { + 28BE76357A2CB1D1115C90F572A15193 /* Models */ = { isa = PBXGroup; children = ( - C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */, - 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */, - F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */, - 4C1356040CC9A1CCCED79A1A510AF74E /* Alamofire-prefix.pch */, - 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */, - 0A0A7AF3E4D82A790BC8A16BB4972FA7 /* Info.plist */, + 91DFFBF289A62730BCCBAC4851A1AC8B /* AdditionalPropertiesClass.swift */, + DA2B00793CB30A6A5C0C3497B890D7A1 /* Animal.swift */, + 7017BC38FCA103F2518FE2C4942EB8A3 /* AnimalFarm.swift */, + 9A557F23780CA069BA61AE2BE3C0C935 /* ApiResponse.swift */, + 5351A4A344C05ACDF996E3630E69366C /* ArrayOfArrayOfNumberOnly.swift */, + 1B693DDC1E69F657EACB36EFF2276AB9 /* ArrayOfNumberOnly.swift */, + 4BB010C5D4A7300AD69E8389F8E09BDF /* ArrayTest.swift */, + 7CEEEB561582A92AB799221584DDDAD6 /* Capitalization.swift */, + 8480516CD063566F07F5D08643F3BA9F /* Cat.swift */, + 8FDCB2CCAC42FDF414F93594CF7F2D6D /* Category.swift */, + 6DB7377A43FADE63746BBC7D1CCAD93D /* ClassModel.swift */, + 5DB0115D0EE604B8618320E1C6B52390 /* Client.swift */, + D7092AD06F0EF38CC9D8C3FE8B772E65 /* Dog.swift */, + 95821A5031076AE0FDCDE22E0954A02D /* EnumArrays.swift */, + CA9769FD713F522BC6BA9A6C8B6C3BA7 /* EnumClass.swift */, + 052400F31168326FF2A3E229D65D1B39 /* EnumTest.swift */, + 78B6FF05C8B29C32FB1710F116C21BB4 /* FormatTest.swift */, + F381FC45001ED67FBA800D5DEACBE414 /* HasOnlyReadOnly.swift */, + A0CC1C18E268F223DDA59BAA121FE88E /* List.swift */, + 541CB75E23648A3EE2925E81E345B0FB /* MapTest.swift */, + 85F20E4DF6D1F32E36AE3823008F92BE /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 16C4834C40334FCBD463B4BC38A966C9 /* Model200Response.swift */, + 59945A57D8EEE7EBE8146D516EA7257D /* Name.swift */, + B30C52CDC21F3188E5A50C469937008F /* NumberOnly.swift */, + 580886F727A89668FA28D3BA11678585 /* Order.swift */, + 863C495665994A46B8848CBC998B332A /* OuterBoolean.swift */, + FA45912AE978F0840F94A8D308944E6B /* OuterComposite.swift */, + 09CECC4989EF7F2028490D9A4CC6C9B7 /* OuterEnum.swift */, + D3AE9FA5F3483AB2497E1D3B488F0562 /* OuterNumber.swift */, + 547A70BA5BF7A5A411F65BEFD9BF0B07 /* OuterString.swift */, + 1BA02A166AA3B7EC3B8DF4103088DE8A /* Pet.swift */, + DE862CC5FFB80999FD1500D5801F2A21 /* ReadOnlyFirst.swift */, + 3C7F83F8F72A49EA9D543B4B32260F64 /* Return.swift */, + 270C457C18A9B3C93FE2C196EC065A1A /* SpecialModelName.swift */, + 7896C2D88FC42331AEA0607792B4510A /* Tag.swift */, + 7645FEA4F23C54852D28771CC2FF3B80 /* User.swift */, ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; + name = Models; + path = PetstoreClient/Classes/Swaggers/Models; sourceTree = ""; }; - 4C35F42FA9EA91ABFFA7ECEDDFB2E61A /* UIKit */ = { + 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */ = { isa = PBXGroup; children = ( - 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */, - 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */, - 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */, - 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */, - 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */, - BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */, - 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */, - 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */, + EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */, + 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */, + F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */, + D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */, + 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */, + BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */, + 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */, + C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */, + 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */, + 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */, + DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */, + 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */, + 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */, + 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */, + 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */, + AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */, + 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */, + 8949F214ACEA39133A2AAB6508F73CC0 /* Support Files */, ); - name = UIKit; + name = Alamofire; + path = Alamofire; sourceTree = ""; }; - 6B8BED723E1865D5B9F1AC8B17FF7035 /* CorePromise */ = { + 45EE0834297896279B488DCD3D66C373 /* APIs */ = { isa = PBXGroup; children = ( - 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */, - F05F43847135C8DA403312FBEDB1F49F /* after.swift */, - 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */, - 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */, - 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */, - F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */, - 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */, - 4655B4C1707E9902435774C9B1981618 /* Error.swift */, - 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */, - 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */, - 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */, - 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */, - E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */, - AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */, - CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */, - 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */, - A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */, - 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */, - 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */, - 152E92E58DF288044CE0369CD8522B52 /* when.m */, - 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */, - 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */, - 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */, + 80F9261093894D0B652D42D5A3D1D1F9 /* Fake_classname_tags123API.swift */, + 888EE37DF287C4063756B72B2D0DBB04 /* FakeAPI.swift */, + F25F7F29B763AB9B70C3140B53E8F5A1 /* FakeclassnametagsAPI.swift */, + 428C78B74D8A4ECEA1E6470057D3562B /* PetAPI.swift */, + 1BAC2B27DBB94AEC209B05FC0541894E /* StoreAPI.swift */, + 68E391F21156718CBAB2638D6A02FAA3 /* UserAPI.swift */, ); - name = CorePromise; + name = APIs; + path = PetstoreClient/Classes/Swaggers/APIs; sourceTree = ""; }; - 73F0D31DF4F27DE88D6E071DB2438D69 /* APIs */ = { + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */ = { isa = PBXGroup; children = ( - 3CFC05E9AEDA99F51A1889AECCFC82B5 /* Fake_classname_tags123API.swift */, - 59160E1D943EB066193874D8E59D1B06 /* FakeAPI.swift */, - 34F8B9620483170037ED680C602A805D /* FakeclassnametagsAPI.swift */, - 66D70B49487AA96B84FE016C3F9433C6 /* PetAPI.swift */, - AC16C18B043A229F748E88B35E688F63 /* StoreAPI.swift */, - 89E122D6FAE8573E5DCE96B46EC2B45F /* UserAPI.swift */, + 0BDA8E0BE198EED1AD88B926509C3382 /* PetstoreClient */, ); - name = APIs; - path = APIs; + name = "Development Pods"; sourceTree = ""; }; - 7DB346D0F39D3F0E887471402A8071AB = { + 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */ = { isa = PBXGroup; children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, - E1A132DCFF79A96DE3636D6C3ED161C5 /* Frameworks */, - E3012ACC12C4AE1521338E1834D7BDF0 /* Pods */, - D2A28169658A67F83CC3B568D7E0E6A1 /* Products */, - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, + A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */, + 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */, + DD9EED10DC8740383600E1BFF8D2162B /* iOS */, ); + name = Frameworks; sourceTree = ""; }; - 8349D367FE0957C4AFA12D8CA5EA5B44 /* Support Files */ = { + 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( - 08BC2EAEE303ADCEB346C66DA76C7B56 /* Info.plist */, - 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */, - D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */, - 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */, - 776D1D6E37D1EF4B16870DB0A90BD5B6 /* PromiseKit-prefix.pch */, - B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */, + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */, + 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */, + A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */, + D2A28169658A67F83CC3B568D7E0E6A1 /* Products */, + C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, ); - name = "Support Files"; - path = "../Target Support Files/PromiseKit"; sourceTree = ""; }; 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { @@ -548,82 +525,41 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8D4D0246A623990315CCCFC95C6D7152 /* iOS */ = { - isa = PBXGroup; - children = ( - C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */, - 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */, - 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { + 8949F214ACEA39133A2AAB6508F73CC0 /* Support Files */ = { isa = PBXGroup; children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, + 1F11D15E4489C7F4DC1171EB9F5448D0 /* Alamofire.modulemap */, + 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */, + 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */, + 607281BBD24DC152F24F58E6046F4652 /* Alamofire-prefix.pch */, + 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */, + 17FF216D0378037475BAB48A20D5CB0F /* Info.plist */, ); name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; + path = "../Target Support Files/Alamofire"; sourceTree = ""; }; - ADEB788C7842BDA6F8D266DFB6B6D00D /* QuartzCore */ = { + A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */ = { isa = PBXGroup; children = ( - 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */, - BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */, - 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */, + 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */, + 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */, ); - name = QuartzCore; + name = Pods; sourceTree = ""; }; - B19BE75563CE9621CA3D4D00B3E97DAC /* Models */ = { + A5A38542CF9E498066C1C41B2E15BBFF /* Support Files */ = { isa = PBXGroup; children = ( - 1E975F0D2B32E39A971160C6E3AB3EB9 /* AdditionalPropertiesClass.swift */, - E8091C6CA6935BA0C79AFF98CE28D6CB /* Animal.swift */, - 56FB9C8CDA7CE094E291A46BF0B57B0D /* AnimalFarm.swift */, - 82121BDE2CC70B39B8EED8633A682925 /* ApiResponse.swift */, - 29C458192B2CAD10FCD528693D8B5E5E /* ArrayOfArrayOfNumberOnly.swift */, - 64B4724CAD18854A1591E695E9FC8745 /* ArrayOfNumberOnly.swift */, - 355EDFC8A3A001844A121B854FED068C /* ArrayTest.swift */, - 04B79771D9729AE561E40F6D689A5F12 /* Capitalization.swift */, - 3B70C290D6306C24E3EACB7408F0332A /* Cat.swift */, - 2304B489A6C2C398C064DBD27F2AD322 /* Category.swift */, - 3A8E6F3083FA1EFDC0C33EABAD82D53D /* ClassModel.swift */, - 39BE96A09834700FF4412EC718B536E9 /* Client.swift */, - 294315D43C85053FB22B37668F5D511C /* Dog.swift */, - 0A06FA9F766BA16C0909F783067630DD /* EnumArrays.swift */, - B0D944E89D9B3BB75F1E822AA30F82E2 /* EnumClass.swift */, - 4F46FD1709F81456A2C3B83BA306FAEC /* EnumTest.swift */, - E0D9FD43F9333D0F71018297D6135941 /* FormatTest.swift */, - 887B9F7195482221D30A6A531805E448 /* HasOnlyReadOnly.swift */, - 34799A80ED15D28ACA081A72E275921F /* List.swift */, - C51BD200143D1A335C3875BEEA368A4C /* MapTest.swift */, - A7648CA6B9089BCE838A7ED6E80E3BCE /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - CB02B595D003DFF791CEBB2AD96D7E34 /* Model200Response.swift */, - D48BD7E9EDDAA1E98DD460F80C75BB42 /* Name.swift */, - 296F9B0C41B46EF14A7934614156DB38 /* NumberOnly.swift */, - B30D999F85FEBA37A82D3F6BFDE658FB /* Order.swift */, - D698C7A9FAED4C7B5B67356920595C86 /* OuterBoolean.swift */, - 1C38284E7C715548340EC108E9B75F60 /* OuterComposite.swift */, - 342D3CA6C864E3502B8F936B8B1D8B82 /* OuterEnum.swift */, - EAE15E45F1229346854BD200232A649F /* OuterNumber.swift */, - FD3BE5D88C11D4BD5F6CDE91D6A079A6 /* OuterString.swift */, - 9A47C9E542AADEEE91CA0D9F8BB6C30B /* Pet.swift */, - E305CCF51AD9F2F7E29AFE305D979E21 /* ReadOnlyFirst.swift */, - 9A38D3CE7A8E26BD12F3BF1E7C28BA47 /* Return.swift */, - DED66B0C005114BD0E67E68A62066952 /* SpecialModelName.swift */, - 63A3989139854636389CEF47FEAE202A /* Tag.swift */, - E5B7035C4B0C6CDBF56684A321552F6A /* User.swift */, + 34E180DB9A06BFDDA525853716B57541 /* Info.plist */, + 6D7294312CFFF12B79A7AD2E8D219344 /* PromiseKit.modulemap */, + 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */, + E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */, + 48CCB9793CCE13A24831B3E01B29171A /* PromiseKit-prefix.pch */, + 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */, ); - name = Models; - path = Models; + name = "Support Files"; + path = "../Target Support Files/PromiseKit"; sourceTree = ""; }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { @@ -647,32 +583,6 @@ name = Products; sourceTree = ""; }; - D630949B04477DB25A8CE685790D41CD /* Alamofire */ = { - isa = PBXGroup; - children = ( - F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */, - C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */, - F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */, - CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */, - 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */, - 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */, - 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */, - 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */, - D5021828D3563560F50658622F55322A /* Response.swift */, - 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */, - 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */, - 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */, - A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */, - 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */, - 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */, - F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */, - 943618599D753D3CF9CEA416875D6417 /* Validation.swift */, - 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */ = { isa = PBXGroup; children = ( @@ -691,72 +601,42 @@ path = "Target Support Files/Pods-SwaggerClientTests"; sourceTree = ""; }; - E1A132DCFF79A96DE3636D6C3ED161C5 /* Frameworks */ = { + DD9EED10DC8740383600E1BFF8D2162B /* iOS */ = { isa = PBXGroup; children = ( - F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */, - 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */, - 8D4D0246A623990315CCCFC95C6D7152 /* iOS */, + 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */, ); - name = Frameworks; - sourceTree = ""; - }; - E3012ACC12C4AE1521338E1834D7BDF0 /* Pods */ = { - isa = PBXGroup; - children = ( - D630949B04477DB25A8CE685790D41CD /* Alamofire */, - 27454559852AC8B9DDF3F084C1E09F22 /* PromiseKit */, - ); - name = Pods; - sourceTree = ""; - }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */, - ); - name = PetstoreClient; - path = PetstoreClient; - sourceTree = ""; - }; - E9A1A08411D27DA5CE28FA5CE7147C23 /* Swaggers */ = { - isa = PBXGroup; - children = ( - 4667903A69251AE2221FA281142E668A /* AlamofireImplementations.swift */, - E95304AB8BBF2F61545C19F7E11FA0DD /* APIHelper.swift */, - 94AEAEBBDF2436790157489BD9CB0B83 /* APIs.swift */, - 61EE2E01C0D1EF9F77C95198ADD3FBE0 /* Configuration.swift */, - D0F803CC577AEB14AE4CAF4A4F2A0852 /* Extensions.swift */, - 726B2099A399A753E31DCDE5A90168F2 /* Models.swift */, - 73F0D31DF4F27DE88D6E071DB2438D69 /* APIs */, - B19BE75563CE9621CA3D4D00B3E97DAC /* Models */, - ); - name = Swaggers; - path = Swaggers; - sourceTree = ""; - }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, - ); - name = PetstoreClient; - path = ../..; + name = iOS; sourceTree = ""; }; - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */ = { + E44C17565AC7C2BF978747A8E3FBDEAA /* Support Files */ = { isa = PBXGroup; children = ( - E9A1A08411D27DA5CE28FA5CE7147C23 /* Swaggers */, + 5E79C2313007533BFFA709832BE18FDC /* Info.plist */, + 855FBD05ABAD1AE4A03E58EEBA975DAA /* PetstoreClient.modulemap */, + E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */, + 06F576B1286B5129A7A77654A92AAFCF /* PetstoreClient-dummy.m */, + 694EDDB57CDB8FB6CB5088BF3F66CE8A /* PetstoreClient-prefix.pch */, + E2C57703EA0D61575D878820DE56A5E4 /* PetstoreClient-umbrella.h */, ); - name = Classes; - path = Classes; + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 0F365CF5DACC65D972AAB14DA12BC86D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + E7646AE8D28791DE9F6738F8429C6AB8 /* AnyPromise.h in Headers */, + 76020E5CECD3FCC592D2C59CB2EC27FA /* fwd.h in Headers */, + C25AC96F7A1662899D9B7369AD5C3718 /* PromiseKit-umbrella.h in Headers */, + 403E2169606F2DEEA7EAAAC045B46BEF /* PromiseKit.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1353AC7A6419F876B294A55E5550D1E4 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -789,26 +669,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - C8A6DAE29BE89E0C5DF5152C86F4F963 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 68EDADC20A85BF0FA2134C6B4B427F32 /* AnyPromise.h in Headers */, - 39BCF1CBAAB69EF35F5FF9FE84A81A6C /* CALayer+AnyPromise.h in Headers */, - FA265D04091BF3838B0C7ABE484CA080 /* fwd.h in Headers */, - CC01511F30DA21BFC02CC7E0010C3EB5 /* NSNotificationCenter+AnyPromise.h in Headers */, - 021FC8944F822A8CD0C09E4909362F57 /* NSTask+AnyPromise.h in Headers */, - 852BB8DDE60D9CC98133B05A88743C6A /* NSURLSession+AnyPromise.h in Headers */, - 510C600486A97DF541E663B65B6FCCF6 /* PMKFoundation.h in Headers */, - 6A93921D8EE5ABAFB8D1F8B4DF0A5F63 /* PMKQuartzCore.h in Headers */, - 61643E772F1E1ACFB7F7428AE8F61562 /* PMKUIKit.h in Headers */, - 78E723118197F97FCBB87B31F2F7F6D3 /* PromiseKit-umbrella.h in Headers */, - 797B115762C062A4E751040E6B6F89F3 /* PromiseKit.h in Headers */, - 76DD148C7F62FDAC04174816CBF8DDE2 /* UIView+AnyPromise.h in Headers */, - C3A0F4845CE745C91883384B53449091 /* UIViewController+AnyPromise.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -816,9 +676,9 @@ isa = PBXNativeTarget; buildConfigurationList = 9704F3468D80EEF41AAE27F6787CE8B5 /* Build configuration list for PBXNativeTarget "PromiseKit" */; buildPhases = ( - E7777F3F754DDBFD1740F2D2424F2026 /* Sources */, - D311E824FD60E99F5FA6759A4D47BFB0 /* Frameworks */, - C8A6DAE29BE89E0C5DF5152C86F4F963 /* Headers */, + F774C8F0AD383E9905417E42A8B6B9AC /* Sources */, + A4294342AAE4322C007571DAA6D36C0B /* Frameworks */, + 0F365CF5DACC65D972AAB14DA12BC86D /* Headers */, ); buildRules = ( ); @@ -833,7 +693,7 @@ isa = PBXNativeTarget; buildConfigurationList = 6FB824209F1EB710D7C2E96778EF898B /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - 6A5D25C40D34E7AEC3029DB0877F01E1 /* Sources */, + 3A6A0CC35555AD4684FE2808D0C6817D /* Sources */, 9FAFC1E488B61EB220454BF6C14BDB62 /* Frameworks */, 91E93AC6E669B2001D04F2FC6A30B4D8 /* Headers */, ); @@ -908,7 +768,7 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; @@ -958,59 +818,59 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6A5D25C40D34E7AEC3029DB0877F01E1 /* Sources */ = { + 3A6A0CC35555AD4684FE2808D0C6817D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6A4EFF9B8CF466057B0F57430999B554 /* AdditionalPropertiesClass.swift in Sources */, - ACE11EF053DF39BCE87DD0E521A0C327 /* AlamofireImplementations.swift in Sources */, - C57AD14B33D2E06ACF3D73B01DE8BFF8 /* Animal.swift in Sources */, - A14BE5430F11267F9F62FAB0A0917F35 /* AnimalFarm.swift in Sources */, - DB72510346E3BAB8A64D9F3FFEEDD109 /* APIHelper.swift in Sources */, - F83211327A6C910D75E6F1C03283B7A4 /* ApiResponse.swift in Sources */, - D2EEBD9040A94AAF7311342F572A8899 /* APIs.swift in Sources */, - 86C2AFC5EEC3A4E1EE4F55EBEDA9478B /* ArrayOfArrayOfNumberOnly.swift in Sources */, - CF61EA0C644C917AFEF6CCD9CD2AB1D5 /* ArrayOfNumberOnly.swift in Sources */, - 45547F8809A318B8AE7AEFE8B14A869C /* ArrayTest.swift in Sources */, - 3213654062575EFFE78A26076769C254 /* Capitalization.swift in Sources */, - 45C511A7202B6FC08FDB0BD7E8B44019 /* Cat.swift in Sources */, - CD321447387D3EBFBA1FC4A9359A6302 /* Category.swift in Sources */, - 55B892FD60ED2679FDAC0DFDC1488BB1 /* ClassModel.swift in Sources */, - B23A73A52421CC5A31BF3FD51DFE1BA7 /* Client.swift in Sources */, - 9281A656581F8E04235B285C6F5EB438 /* Configuration.swift in Sources */, - 7B044D88B902C5D737BFF5329A3FF539 /* Dog.swift in Sources */, - CEFA45B71C73A8EA04D03487E489A34C /* EnumArrays.swift in Sources */, - 7653C1054C8D3401DD847D53C85EC93B /* EnumClass.swift in Sources */, - 58E1D15A9B2FF257FB7A816E58120E32 /* EnumTest.swift in Sources */, - E55687FB1733657A7C1D650E8DCCC16D /* Extensions.swift in Sources */, - 2D32BD197307B255AF154F8AA5F80A17 /* Fake_classname_tags123API.swift in Sources */, - 05B6EBCF31361396F3F6F6BA9CA8981C /* FakeAPI.swift in Sources */, - 8618AB24631FD4684AB906F54601DCAB /* FakeclassnametagsAPI.swift in Sources */, - E0C193EB0EF996BACE6BDEF6FAC35376 /* FormatTest.swift in Sources */, - B1DA57908C7A1BEC139513C0AAFA54B6 /* HasOnlyReadOnly.swift in Sources */, - 5C0E7490B3DEB82B0EF7EE1FE0573AE5 /* List.swift in Sources */, - 1205F9FB275A26FF7CBA58AD9E6245F8 /* MapTest.swift in Sources */, - 44FFC1F228054E87F551ECBA3DD7BE2D /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9FD10E6ED1B5B5EA96F4AFA67BD5B68B /* Model200Response.swift in Sources */, - D68AE22561437C58D0FE01A529A288F8 /* Models.swift in Sources */, - 7B5BF51A70C8EDE049A4EF840DB0F486 /* Name.swift in Sources */, - 42EEDCC2613F4DD5E8FD7BB429A170EA /* NumberOnly.swift in Sources */, - 46041A699942E1600867DEEB13992BE2 /* Order.swift in Sources */, - 4309497092D988593DE5D2137CD808AD /* OuterBoolean.swift in Sources */, - 31933E0DBDB8B5DA4A1EF081182E3135 /* OuterComposite.swift in Sources */, - BF17703B30F78FEF14FECAE279D320E8 /* OuterEnum.swift in Sources */, - 8662FB72EB2BC969C4CD400317B55A7B /* OuterNumber.swift in Sources */, - 7F536CD485DDE02D076F44489FD7877A /* OuterString.swift in Sources */, - B6716993AC2C3655A096BBCBC9693DBF /* Pet.swift in Sources */, - 00AE735CE141EE30127B4BA8F9E76F52 /* PetAPI.swift in Sources */, - 6F2439D907B62A506DA1D9021A589B7B /* PetstoreClient-dummy.m in Sources */, - 4AF64E6397E24FD9E27BBB094C89001C /* ReadOnlyFirst.swift in Sources */, - 1384EAAAC7ABCAEEEBD94AF716C3633D /* Return.swift in Sources */, - 3BEC5705183323854239200B999CAC07 /* SpecialModelName.swift in Sources */, - 585672293C7E73B936156A1E9D856AF9 /* StoreAPI.swift in Sources */, - B8D6C9F11B175495E86D314262B408D7 /* Tag.swift in Sources */, - 8239BA5EBA3A8CB1D49D3536B5E4802F /* User.swift in Sources */, - C4D198833073E7EFEAFC9C4263CC4806 /* UserAPI.swift in Sources */, + AF95CFE493C440AE05EFDAACE7E4E7DE /* AdditionalPropertiesClass.swift in Sources */, + 86E587687F8286990E1BD25FD5AB0A37 /* AlamofireImplementations.swift in Sources */, + 4E63F97E3E36D9A8576F710D193EB330 /* Animal.swift in Sources */, + 06338FA7F6A0C237789ED8BDCB637AD3 /* AnimalFarm.swift in Sources */, + 1205979ACE7FBA4EB49E5653FA2D1C21 /* APIHelper.swift in Sources */, + 9B80CE10037E884E4F14B60E5BCEF038 /* ApiResponse.swift in Sources */, + E25942E2E76810D3C819B2C624AFA087 /* APIs.swift in Sources */, + 17AA9C279DC342C47E2E3002B30CA60D /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 38067FEC32DCDB6E4F6215EAD63437C3 /* ArrayOfNumberOnly.swift in Sources */, + ECB7ADCAB05E41A34AE5D162F76B48CA /* ArrayTest.swift in Sources */, + 09882E9EDEBB7356D33B97A5934E3227 /* Capitalization.swift in Sources */, + 0A04A65465FDD547158AA925C95F6B69 /* Cat.swift in Sources */, + A1083DDC06C37F84D105231BC7AC2078 /* Category.swift in Sources */, + 58BC833C2E0ACD339E79A966F9C937B7 /* ClassModel.swift in Sources */, + 887BBB5306DA732DD350E38BAAABB118 /* Client.swift in Sources */, + 1D9F8E6252D07755D7145BD5B01A2001 /* Configuration.swift in Sources */, + 3F4E19A844EFA6C087276743DF604FDF /* Dog.swift in Sources */, + 87C6D2D31470ECE88A057BB415CA093A /* EnumArrays.swift in Sources */, + 0B2977ECFB1DCD215E8A05E477DDBA6A /* EnumClass.swift in Sources */, + 05A6FFA5B3630FD63A5CFA863DEFFE4F /* EnumTest.swift in Sources */, + 35910E5DCB2E234D2D743D899E50A83D /* Extensions.swift in Sources */, + B24ED08E9E7E64C67C7F886A1B26C9C4 /* Fake_classname_tags123API.swift in Sources */, + 40F309F2DDD2EC48E7A24D35CA9EA368 /* FakeAPI.swift in Sources */, + E79B2343A16824E335FF99F92D100B56 /* FakeclassnametagsAPI.swift in Sources */, + BB27103F0D590065B8B96158A158C07E /* FormatTest.swift in Sources */, + 587447A22F4AB55382FAE09950120C8B /* HasOnlyReadOnly.swift in Sources */, + 67EEBC5D0C5449E64F7070B12742BE5C /* List.swift in Sources */, + 4049562FD0514CC1979A8AD7EF001AD1 /* MapTest.swift in Sources */, + 667E578EA712E1DF2380BF164C5E29AA /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + CB553CE49FF0AF2C666B96C680173F65 /* Model200Response.swift in Sources */, + A6A60DD672777F2A2AC647658506B2C9 /* Models.swift in Sources */, + C23C578EB36914B7B7993ACB7451DAEE /* Name.swift in Sources */, + C84C5C33E6C3CD718D8D3D6839F5BB77 /* NumberOnly.swift in Sources */, + 146087D66852238BD415594F4096CDB7 /* Order.swift in Sources */, + 3E9543717A86AC66C62BEBF05326977F /* OuterBoolean.swift in Sources */, + 179674B41CDC3DCEE7DB902C0F553285 /* OuterComposite.swift in Sources */, + 0667FE82295343616E4C3E975E61E2DE /* OuterEnum.swift in Sources */, + 344E99585E0E1F196B6E8E9D5E2EC2A5 /* OuterNumber.swift in Sources */, + AC0DC62D4728E6A27014ED1D5DB39869 /* OuterString.swift in Sources */, + 9D4D03BC83CA4C1FDA0C88CC8B386B30 /* Pet.swift in Sources */, + 6F6D5E95B91D0B89D19D8B07CC34B058 /* PetAPI.swift in Sources */, + 2E3E42AF5ACF1DA12162BEE3755C79C0 /* PetstoreClient-dummy.m in Sources */, + C17B1A5739A83DE224286D84B67D4F2A /* ReadOnlyFirst.swift in Sources */, + 545704EF756212DC400A4C252806077D /* Return.swift in Sources */, + 9B605CCF6FBB08279AAAF5A1E08E8019 /* SpecialModelName.swift in Sources */, + 2B00D1C16A6142361F09AE15EFC5827E /* StoreAPI.swift in Sources */, + 1DE9D90349D9177D527C15E5A57D7031 /* Tag.swift in Sources */, + 5135F85CE891C74CF289365F3D665B62 /* User.swift in Sources */, + D61F5BF2B4BBB073BF87700BAE29B79D /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1022,46 +882,31 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - E7777F3F754DDBFD1740F2D2424F2026 /* Sources */ = { + F774C8F0AD383E9905417E42A8B6B9AC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9E90AD26774E22A9E328883AE3C9925D /* after.m in Sources */, - 7100ED065F8CA5B45AEC5E1E6BA0B248 /* after.swift in Sources */, - 85B1AEDEC0BA9AC4818F0E4130B2B2A6 /* afterlife.swift in Sources */, - 712AF6626F00820E315BE76E58EC8BCE /* AnyPromise.m in Sources */, - 32E48B06C9B289AC824EFC5FC46ACD85 /* AnyPromise.swift in Sources */, - A7BF87774CB4D2E76F44232B4988D78C /* CALayer+AnyPromise.m in Sources */, - 2DB1EF11BA493EC94CDB662690F29D82 /* dispatch_promise.m in Sources */, - ADD894849BDFA16152809733E7BCA60C /* DispatchQueue+Promise.swift in Sources */, - 05DB8C9CF146F8BBBE34FE27016663AE /* Error.swift in Sources */, - E615EE70BF8A3A8D99ADE8D4FB43B18F /* GlobalState.m in Sources */, - B23B0D9079C5F3BE95110ED1ADA0718F /* hang.m in Sources */, - CE2E9F8E06D334952C90FEA6A021F491 /* join.m in Sources */, - E4448526305BE877838BD7D1061F2CFC /* join.swift in Sources */, - 3B99645FCBC7378836F859E03DE8C491 /* NSNotificationCenter+AnyPromise.m in Sources */, - EBFF8628E17002C54372B1AF29B4A76A /* NSNotificationCenter+Promise.swift in Sources */, - D07EB1A05D309FDD823342C50097D061 /* NSObject+Promise.swift in Sources */, - FE5952EE9CEA3BC1B7991C60C985E98A /* NSTask+AnyPromise.m in Sources */, - DA4D8309E45A9B47E134BF34CF29E7CD /* NSURLSession+AnyPromise.m in Sources */, - CC2FB9FC1FDF19D7F8A5C41E423B6345 /* NSURLSession+Promise.swift in Sources */, - C2B3B5C0B17EA390721049716E25B770 /* PMKAlertController.swift in Sources */, - A058CE758710D8443F7783A8D74364FF /* Process+Promise.swift in Sources */, - 79711BECA8E82F8F13C383165E10E9B0 /* Promise+AnyPromise.swift in Sources */, - DB1605584C05A8F7319769537250FAB2 /* Promise+Properties.swift in Sources */, - BA64F2E60866E12834650E0683C1373A /* Promise.swift in Sources */, - 2AC12E6B5F4733E03D0F74F14CA1B7E3 /* PromiseKit-dummy.m in Sources */, - F19D36486E510F0039DF570B58D67916 /* race.swift in Sources */, - 03EBF4756A7F00AAAF7539763B1369DF /* State.swift in Sources */, - CF84D807380AFCF3CC8B265913096DA4 /* UIView+AnyPromise.m in Sources */, - CEAB847312816BB908B4A17D3046D123 /* UIView+Promise.swift in Sources */, - AA971FBDAEAF91B8C041BA8B95E43590 /* UIViewController+AnyPromise.m in Sources */, - A9CB3C2EA2748F00E024FA61BCE9FFFE /* UIViewController+Promise.swift in Sources */, - 5D0F2FB1B7AB221402136B397F2B2000 /* URLDataPromise.swift in Sources */, - 88095F6CA2DC6E9B36975A3E21E28AFF /* when.m in Sources */, - 1180D7B29C021ABC9DA76A1259C21495 /* when.swift in Sources */, - A94275D3AD0D80CE3BE29D18715C71A0 /* wrap.swift in Sources */, - 14A3D61A011506D7769CB673529C435F /* Zalgo.swift in Sources */, + C57027F4FF1F8BA21E021D7378186BAF /* after.m in Sources */, + 053E27E4E66AB2D2151D9776585F1FA7 /* after.swift in Sources */, + 5F255DAA5EC5598D66A2A22A052C4642 /* AnyPromise.m in Sources */, + 33D656C917337CEA212DB903ECD0E6C0 /* AnyPromise.swift in Sources */, + 6DAC90FE278E810EA89A32891F6F726D /* dispatch_promise.m in Sources */, + 82310F627E8C49D9F906723C6C3DA3BA /* DispatchQueue+Promise.swift in Sources */, + 5CBFA7F10B16CE082F3DEB42782BB20B /* Error.swift in Sources */, + C8F87B4EC3E7D6B2EA869BB0A2B24A5E /* GlobalState.m in Sources */, + AD96DA86AD0D6C1D132B5EEEC33758FD /* hang.m in Sources */, + 5EB6840C80C4AF36E53852FA25B9FE2E /* join.m in Sources */, + D9495580483FAECB1F454A88F5E98425 /* join.swift in Sources */, + 870322F063522D314752502D12D30BF3 /* Promise+AnyPromise.swift in Sources */, + 655906A84ACFBE897B9B0854CA5ED146 /* Promise+Properties.swift in Sources */, + 97AB35CEB1F8147F512C403765C24366 /* Promise.swift in Sources */, + 264F59B087C997C8DAF2A010366FD9B0 /* PromiseKit-dummy.m in Sources */, + 277E86F43EC003B6FF423B020D732A9D /* race.swift in Sources */, + 4CF3C7AAB7A5940C292EE3CCC3A3C4D0 /* State.swift in Sources */, + 2D040E855A9DBDC57A921ED5232836BB /* when.m in Sources */, + B2B48F66496BB746373C6B7A0D209F36 /* when.swift in Sources */, + F702666B7BC058BDEFF8798F3022141C /* wrap.swift in Sources */, + 5140E3AF1B2AC4EF35D24062003B822D /* Zalgo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1109,10 +954,11 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */ = { + 007503D8498115ADB100193B3AD6BACC /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */; + baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1124,16 +970,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Alamofire; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1141,10 +992,11 @@ }; name = Release; }; - 2145545533A396BDE7196FD622369B3A /* Release */ = { + 077C4BB7DBEAA715DED46C057DC8051C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1156,16 +1008,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1173,10 +1027,11 @@ }; name = Release; }; - 2A3BD23CAAB95015705F7639236E0888 /* Debug */ = { + 0833374B84DE03636F41B3BFC66F760E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1188,16 +1043,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PetstoreClient; + PRODUCT_NAME = PromiseKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1206,10 +1062,104 @@ }; name = Debug; }; - 75012E5F6846DD91D04C9B3E945D92DA /* Debug */ = { + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8892A82330D242C8CE8BF39F1275BA41 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1221,16 +1171,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PromiseKit; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1239,115 +1194,118 @@ }; name = Debug; }; - 91B7FF0075884FD652BE3D081577D6B0 /* Debug */ = { + C66477B6E5656B1F4785FD5D9546905A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; + baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - A370BD6947C1B96AE1A6E7DAEEB55253 /* Release */ = { + CD3E6F275BA32FAD325E40B365C2BAB6 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */; + baseConfigurationReference = E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PromiseKit; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */ = { + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; + baseConfigurationReference = 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - AA6E8122A0F8D71757B2807B2041E880 /* Release */ = { + F800598617CDD20AD8CB5F992D1176B0 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; + baseConfigurationReference = 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1359,20 +1317,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; + PRODUCT_NAME = PromiseKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1380,94 +1336,11 @@ }; name = Release; }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */ = { + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1500,38 +1373,40 @@ }; name = Debug; }; - F383079BFBF927813EA3613CFB679FDE /* Debug */ = { + FE0EC0291E771C19AD2CD2E0E86AE07A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */; + baseConfigurationReference = E4B3DD8A15BBF3791DE2AE67DF7DD23C /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Alamofire; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; /* End XCBuildConfiguration section */ @@ -1539,8 +1414,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */, + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1548,8 +1423,8 @@ 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - F383079BFBF927813EA3613CFB679FDE /* Debug */, - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */, + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */, + 077C4BB7DBEAA715DED46C057DC8051C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1557,8 +1432,8 @@ 607382BCFF2B60BA932C95EC3C22A69F /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 91B7FF0075884FD652BE3D081577D6B0 /* Debug */, - AA6E8122A0F8D71757B2807B2041E880 /* Release */, + 8892A82330D242C8CE8BF39F1275BA41 /* Debug */, + 007503D8498115ADB100193B3AD6BACC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1566,8 +1441,8 @@ 6FB824209F1EB710D7C2E96778EF898B /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2A3BD23CAAB95015705F7639236E0888 /* Debug */, - 2145545533A396BDE7196FD622369B3A /* Release */, + CD3E6F275BA32FAD325E40B365C2BAB6 /* Debug */, + FE0EC0291E771C19AD2CD2E0E86AE07A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1575,8 +1450,8 @@ 9704F3468D80EEF41AAE27F6787CE8B5 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 75012E5F6846DD91D04C9B3E945D92DA /* Debug */, - A370BD6947C1B96AE1A6E7DAEEB55253 /* Release */, + 0833374B84DE03636F41B3BFC66F760E /* Debug */, + F800598617CDD20AD8CB5F992D1176B0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1584,8 +1459,8 @@ B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */, - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */, + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */, + C66477B6E5656B1F4785FD5D9546905A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h deleted file mode 100644 index 351a93b97ed..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h +++ /dev/null @@ -1,44 +0,0 @@ -#import -#import - - -/** - To import the `NSNotificationCenter` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSNotificationCenter (PromiseKit) -/** - Observe the named notification once. - - [NSNotificationCenter once:UIKeyboardWillShowNotification].then(^(id note, id userInfo){ - UIViewAnimationCurve curve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; - CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; - - return [UIView promiseWithDuration:duration delay:0.0 options:(curve << 16) animations:^{ - - }]; - }); - - @warning *Important* Promises only resolve once. If you need your block to execute more than once then use `-addObserverForName:object:queue:usingBlock:`. - - @param notificationName The name of the notification for which to register the observer. - - @return A promise that fulfills with two parameters: - - 1. The NSNotification object. - 2. The NSNotification’s userInfo property. -*/ -+ (AnyPromise *)once:(NSString *)notificationName NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m deleted file mode 100644 index a3b8baf507d..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m +++ /dev/null @@ -1,16 +0,0 @@ -#import -#import -#import "PMKFoundation.h" - -@implementation NSNotificationCenter (PromiseKit) - -+ (AnyPromise *)once:(NSString *)name { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - __block id identifier = [[NSNotificationCenter defaultCenter] addObserverForName:name object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { - [[NSNotificationCenter defaultCenter] removeObserver:identifier name:name object:nil]; - resolve(PMKManifold(note, note.userInfo)); - }]; - }]; -} - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift deleted file mode 100644 index 6fa08cde3b8..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Foundation.NSNotification -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSNotificationCenter` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension NotificationCenter { - /// Observe the named notification once - public func observe(once name: Notification.Name, object: Any? = nil) -> NotificationPromise { - let (promise, fulfill) = NotificationPromise.go() - let id = addObserver(forName: name, object: object, queue: nil, using: fulfill) - _ = promise.always { self.removeObserver(id) } - return promise - } -} - -/// The promise returned by `NotificationCenter.observe(once:)` -public class NotificationPromise: Promise<[AnyHashable: Any]> { - private let pending = Promise.pending() - - public func asNotification() -> Promise { - return pending.promise - } - - fileprivate class func go() -> (NotificationPromise, (Notification) -> Void) { - let (p, fulfill, _) = NotificationPromise.pending() - let promise = p as! NotificationPromise - _ = promise.pending.promise.then { fulfill($0.userInfo ?? [:]) } - return (promise, promise.pending.fulfill) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift deleted file mode 100644 index 48d81333750..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift +++ /dev/null @@ -1,64 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSObject` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSObject` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension NSObject { - /** - - Returns: A promise that resolves when the provided keyPath changes. - - Warning: *Important* The promise must not outlive the object under observation. - - SeeAlso: Apple’s KVO documentation. - */ - public func observe(keyPath: String) -> Promise { - let (promise, fulfill, reject) = Promise.pending() - let proxy = KVOProxy(observee: self, keyPath: keyPath) { obj in - if let obj = obj as? T { - fulfill(obj) - } else { - reject(PMKError.castError(T.self)) - } - } - proxy.retainCycle = proxy - return promise - } -} - -private class KVOProxy: NSObject { - var retainCycle: KVOProxy? - let fulfill: (Any?) -> Void - - init(observee: NSObject, keyPath: String, resolve: @escaping (Any?) -> Void) { - fulfill = resolve - super.init() - observee.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.new, context: pointer) - } - - fileprivate override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { - if let change = change, context == pointer { - defer { retainCycle = nil } - fulfill(change[NSKeyValueChangeKey.newKey]) - if let object = object as? NSObject, let keyPath = keyPath { - object.removeObserver(self, forKeyPath: keyPath) - } - } - } - - private lazy var pointer: UnsafeMutableRawPointer = { - return Unmanaged.passUnretained(self).toOpaque() - }() -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h deleted file mode 100644 index 29c2c0389e1..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h +++ /dev/null @@ -1,53 +0,0 @@ -#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR - -#import -#import - -#define PMKTaskErrorLaunchPathKey @"PMKTaskErrorLaunchPathKey" -#define PMKTaskErrorArgumentsKey @"PMKTaskErrorArgumentsKey" -#define PMKTaskErrorStandardOutputKey @"PMKTaskErrorStandardOutputKey" -#define PMKTaskErrorStandardErrorKey @"PMKTaskErrorStandardErrorKey" -#define PMKTaskErrorExitStatusKey @"PMKTaskErrorExitStatusKey" - -/** - To import the `NSTask` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSTask` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSTask (PromiseKit) - -/** - Launches the receiver and resolves when it exits. - - If the task fails the promise is rejected with code `PMKTaskError`, and - `userInfo` keys: `PMKTaskErrorStandardOutputKey`, - `PMKTaskErrorStandardErrorKey` and `PMKTaskErrorExitStatusKey`. - - NSTask *task = [NSTask new]; - task.launchPath = @"/usr/bin/basename"; - task.arguments = @[@"/usr/bin/sleep"]; - [task promise].then(^(NSString *stdout){ - //… - }); - - @return A promise that fulfills with three parameters: - - 1) The stdout interpreted as a UTF8 string. - 2) The stderr interpreted as a UTF8 string. - 3) The stdout as `NSData`. -*/ -- (AnyPromise *)promise NS_REFINED_FOR_SWIFT; - -@end - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m deleted file mode 100644 index bfabd6157eb..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m +++ /dev/null @@ -1,46 +0,0 @@ -#import -#import -#import -#import -#import - -#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR - -#import "NSTask+AnyPromise.h" - -@implementation NSTask (PromiseKit) - -- (AnyPromise *)promise { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - self.standardOutput = [NSPipe pipe]; - self.standardError = [NSPipe pipe]; - self.terminationHandler = ^(NSTask *task){ - id stdoutData = [[task.standardOutput fileHandleForReading] readDataToEndOfFile]; - id stdoutString = [[NSString alloc] initWithData:stdoutData encoding:NSUTF8StringEncoding]; - id stderrData = [[task.standardError fileHandleForReading] readDataToEndOfFile]; - id stderrString = [[NSString alloc] initWithData:stderrData encoding:NSUTF8StringEncoding]; - - if (task.terminationReason == NSTaskTerminationReasonExit && self.terminationStatus == 0) { - resolve(PMKManifold(stdoutString, stderrString, stdoutData)); - } else { - id cmd = [NSMutableArray arrayWithObject:task.launchPath]; - [cmd addObjectsFromArray:task.arguments]; - cmd = [cmd componentsJoinedByString:@" "]; - - id info = @{ - NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed executing: %@.", cmd], - PMKTaskErrorStandardOutputKey: stdoutString, - PMKTaskErrorStandardErrorKey: stderrString, - PMKTaskErrorExitStatusKey: @(task.terminationStatus), - }; - - resolve([NSError errorWithDomain:PMKErrorDomain code:PMKTaskError userInfo:info]); - } - }; - [self launch]; - }]; -} - -@end - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h deleted file mode 100644 index b71cf7e2797..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h +++ /dev/null @@ -1,66 +0,0 @@ -#import -#import -#import -#import - -#define PMKURLErrorFailingURLResponseKey @"PMKURLErrorFailingURLResponseKey" -#define PMKURLErrorFailingDataKey @"PMKURLErrorFailingDataKey" -#define PMKURLErrorFailingStringKey @"PMKURLErrorFailingStringKey" -#define PMKJSONErrorJSONObjectKey @"PMKJSONErrorJSONObjectKey" - -/** - To import the `NSURLSession` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSURLConnection` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSURLSession (PromiseKit) - -/** - Creates a task that retrieves the contents of a URL based on the - specified URL request object. - - PromiseKit automatically deserializes the raw HTTP data response into the - appropriate rich data type based on the mime type the server provides. - Thus if the response is JSON you will get the deserialized JSON response. - PromiseKit supports decoding into strings, JSON and UIImages. - - However if your server does not provide a rich content-type, you will - just get `NSData`. This is rare, but a good example we came across was - downloading files from Dropbox. - - PromiseKit goes to quite some lengths to provide good `NSError` objects - for error conditions at all stages of the HTTP to rich-data type - pipeline. We provide the following additional `userInfo` keys as - appropriate: - - - `PMKURLErrorFailingDataKey` - - `PMKURLErrorFailingStringKey` - - `PMKURLErrorFailingURLResponseKey` - - [[NSURLConnection sharedSession] promiseDataTaskWithRequest:rq].then(^(id response){ - // response is probably an NSDictionary deserialized from JSON - }); - - @param request The URL request. - - @return A promise that fulfills with three parameters: - - 1) The deserialized data response. - 2) The `NSHTTPURLResponse`. - 3) The raw `NSData` response. - - @see https://github.com/mxcl/OMGHTTPURLRQ -*/ -- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)request NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m deleted file mode 100644 index 91d4a067e25..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m +++ /dev/null @@ -1,113 +0,0 @@ -#import -#import -#import -#import "NSURLSession+AnyPromise.h" -#import -#import -#import -#import -#import -#import -#import -#import - -@implementation NSURLSession (PromiseKit) - -- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)rq { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - [[self dataTaskWithRequest:rq completionHandler:^(NSData *data, id rsp, NSError *urlError){ - assert(![NSThread isMainThread]); - - PMKResolver fulfiller = ^(id responseObject){ - resolve(PMKManifold(responseObject, rsp, data)); - }; - PMKResolver rejecter = ^(NSError *error){ - id userInfo = error.userInfo.mutableCopy ?: [NSMutableDictionary new]; - if (data) userInfo[PMKURLErrorFailingDataKey] = data; - if (rsp) userInfo[PMKURLErrorFailingURLResponseKey] = rsp; - error = [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; - resolve(error); - }; - - NSStringEncoding (^stringEncoding)() = ^NSStringEncoding{ - id encodingName = [rsp textEncodingName]; - if (encodingName) { - CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName); - if (encoding != kCFStringEncodingInvalidId) - return CFStringConvertEncodingToNSStringEncoding(encoding); - } - return NSUTF8StringEncoding; - }; - - if (urlError) { - rejecter(urlError); - } else if (![rsp isKindOfClass:[NSHTTPURLResponse class]]) { - fulfiller(data); - } else if ([rsp statusCode] < 200 || [rsp statusCode] >= 300) { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned a bad HTTP response code", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:info]; - rejecter(err); - } else if (PMKHTTPURLResponseIsJSON(rsp)) { - // work around ever-so-common Rails workaround: https://github.com/rails/rails/issues/1742 - if ([rsp expectedContentLength] == 1 && [data isEqualToData:[NSData dataWithBytes:" " length:1]]) - return fulfiller(nil); - - NSError *err = nil; - id json = [NSJSONSerialization JSONObjectWithData:data options:PMKJSONDeserializationOptions error:&err]; - if (!err) { - fulfiller(json); - } else { - id userInfo = err.userInfo.mutableCopy; - if (data) { - NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding()]; - if (string) - userInfo[PMKURLErrorFailingStringKey] = string; - } - long long length = [rsp expectedContentLength]; - id bytes = length <= 0 ? @"" : [NSString stringWithFormat:@"%lld bytes", length]; - id fmt = @"The server claimed a %@ JSON response, but decoding failed with: %@"; - userInfo[NSLocalizedDescriptionKey] = [NSString stringWithFormat:fmt, bytes, userInfo[NSLocalizedDescriptionKey]]; - err = [NSError errorWithDomain:err.domain code:err.code userInfo:userInfo]; - rejecter(err); - } - #ifdef UIKIT_EXTERN - } else if (PMKHTTPURLResponseIsImage(rsp)) { - UIImage *image = [[UIImage alloc] initWithData:data]; - image = [[UIImage alloc] initWithCGImage:[image CGImage] scale:image.scale orientation:image.imageOrientation]; - if (image) - fulfiller(image); - else { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned invalid image data", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; - rejecter(err); - } - #endif - } else if (PMKHTTPURLResponseIsText(rsp)) { - id str = [[NSString alloc] initWithData:data encoding:stringEncoding()]; - if (str) - fulfiller(str); - else { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned invalid string data", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; - rejecter(err); - } - } else { - fulfiller(data); - } - }] resume]; - }]; -} - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift deleted file mode 100644 index 4789b84e249..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift +++ /dev/null @@ -1,50 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSURLSession` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSURLSession` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension URLSession { - /** - Makes an HTTP request using the parameters specified by the provided URL - request. - - We recommend the use of [OMGHTTPURLRQ] which allows you to construct correct REST requests. - - let rq = OMGHTTPURLRQ.POST(url, json: parameters) - NSURLSession.shared.dataTask(with: rq).asDictionary().then { json in - //… - } - - [We provide OMG extensions](https://github.com/PromiseKit/OMGHTTPURLRQ) - that allow eg: - - URLSession.shared.POST(url, json: ["a": "b"]) - - - Parameter request: The URL request. - - Returns: A promise that represents the URL request. - - SeeAlso: `URLDataPromise` - - SeeAlso: [OMGHTTPURLRQ] - - [OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ - */ - public func dataTask(with request: URLRequest) -> URLDataPromise { - return URLDataPromise.go(request) { completionHandler in - dataTask(with: request, completionHandler: completionHandler).resume() - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h deleted file mode 100644 index 8796c0d11bb..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h +++ /dev/null @@ -1,3 +0,0 @@ -#import "NSNotificationCenter+AnyPromise.h" -#import "NSURLSession+AnyPromise.h" -#import "NSTask+AnyPromise.h" diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift deleted file mode 100644 index 396b87ff58a..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift +++ /dev/null @@ -1,146 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -#if os(macOS) - -/** - To import the `Process` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `Process` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit - */ -extension Process { - /** - Launches the receiver and resolves when it exits. - - let proc = Process() - proc.launchPath = "/bin/ls" - proc.arguments = ["/bin"] - proc.promise().asStandardOutput(encoding: .utf8).then { str in - print(str) - } - */ - public func promise() -> ProcessPromise { - standardOutput = Pipe() - standardError = Pipe() - - launch() - - let (p, fulfill, reject) = ProcessPromise.pending() - let promise = p as! ProcessPromise - - promise.task = self - - waldo.async { - self.waitUntilExit() - - if self.terminationReason == .exit && self.terminationStatus == 0 { - fulfill() - } else { - reject(Error(.execution, promise, self)) - } - - promise.task = nil - } - - return promise - } - - /** - The error generated by PromiseKit’s `Process` extension - */ - public struct Error: Swift.Error, CustomStringConvertible { - public let exitStatus: Int - public let stdout: Data - public let stderr: Data - public let args: [String] - public let code: Code - public let cmd: String - - init(_ code: Code, _ promise: ProcessPromise, _ task: Process) { - stdout = promise.stdout - stderr = promise.stderr - exitStatus = Int(task.terminationStatus) - cmd = task.launchPath ?? "" - args = task.arguments ?? [] - self.code = code - } - - /// The type of `Process` error - public enum Code { - /// The data could not be converted to a UTF8 String - case encoding - /// The task execution failed - case execution - } - - /// A textual representation of the error - public var description: String { - switch code { - case .encoding: - return "Could not decode command output into string." - case .execution: - let str = ([cmd] + args).joined(separator: " ") - return "Failed executing: `\(str)`." - } - } - } -} - -final public class ProcessPromise: Promise { - fileprivate var task: Process! - - fileprivate var stdout: Data { - return (task.standardOutput! as! Pipe).fileHandleForReading.readDataToEndOfFile() - } - - fileprivate var stderr: Data { - return (task.standardError! as! Pipe).fileHandleForReading.readDataToEndOfFile() - } - - public func asStandardOutput() -> Promise { - return then(on: zalgo) { _ in self.stdout } - } - - public func asStandardError() -> Promise { - return then(on: zalgo) { _ in self.stderr } - } - - public func asStandardPair() -> Promise<(Data, Data)> { - return then(on: zalgo) { _ in (self.stderr, self.stdout) } - } - - private func decode(_ encoding: String.Encoding, _ data: Data) throws -> String { - guard let str = String(bytes: data, encoding: encoding) else { - throw Process.Error(.encoding, self, self.task) - } - return str - } - - public func asStandardPair(encoding: String.Encoding) -> Promise<(String, String)> { - return then(on: zalgo) { _ in - (try self.decode(encoding, self.stdout), try self.decode(encoding, self.stderr)) - } - } - - public func asStandardOutput(encoding: String.Encoding) -> Promise { - return then(on: zalgo) { _ in try self.decode(encoding, self.stdout) } - } - - public func asStandardError(encoding: String.Encoding) -> Promise { - return then(on: zalgo) { _ in try self.decode(encoding, self.stderr) } - } -} - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift deleted file mode 100644 index 2c380a5a92d..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift +++ /dev/null @@ -1,121 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -public enum Encoding { - /// Decode as JSON - case json(JSONSerialization.ReadingOptions) -} - -/** - A promise capable of decoding common Internet data types. - - Used by: - - - PromiseKit/Foundation - - PromiseKit/Social - - PromiseKit/OMGHTTPURLRQ - - But probably of general use to any promises that receive HTTP `Data`. - */ -public class URLDataPromise: Promise { - /// Convert the promise to a tuple of `(Data, URLResponse)` - public func asDataAndResponse() -> Promise<(Data, Foundation.URLResponse)> { - return then(on: zalgo) { ($0, self.URLResponse) } - } - - /// Decode the HTTP response to a String, the string encoding is read from the response. - public func asString() -> Promise { - return then(on: waldo) { data -> String in - guard let str = String(bytes: data, encoding: self.URLResponse.stringEncoding ?? .utf8) else { - throw PMKURLError.stringEncoding(self.URLRequest, data, self.URLResponse) - } - return str - } - } - - /// Decode the HTTP response as a JSON array - public func asArray(_ encoding: Encoding = .json(.allowFragments)) -> Promise { - return then(on: waldo) { data -> NSArray in - switch encoding { - case .json(let options): - guard !data.b0rkedEmptyRailsResponse else { return NSArray() } - let json = try JSONSerialization.jsonObject(with: data, options: options) - guard let array = json as? NSArray else { throw JSONError.unexpectedRootNode(json) } - return array - } - } - } - - /// Decode the HTTP response as a JSON dictionary - public func asDictionary(_ encoding: Encoding = .json(.allowFragments)) -> Promise { - return then(on: waldo) { data -> NSDictionary in - switch encoding { - case .json(let options): - guard !data.b0rkedEmptyRailsResponse else { return NSDictionary() } - let json = try JSONSerialization.jsonObject(with: data, options: options) - guard let dict = json as? NSDictionary else { throw JSONError.unexpectedRootNode(json) } - return dict - } - } - } - - fileprivate var URLRequest: Foundation.URLRequest! - fileprivate var URLResponse: Foundation.URLResponse! - - /// Internal - public class func go(_ request: URLRequest, body: (@escaping (Data?, URLResponse?, Error?) -> Void) -> Void) -> URLDataPromise { - let (p, fulfill, reject) = URLDataPromise.pending() - let promise = p as! URLDataPromise - - body { data, rsp, error in - promise.URLRequest = request - promise.URLResponse = rsp - - if let error = error { - reject(error) - } else if let data = data, let rsp = rsp as? HTTPURLResponse, (200..<300) ~= rsp.statusCode { - fulfill(data) - } else if let data = data, !(rsp is HTTPURLResponse) { - fulfill(data) - } else { - reject(PMKURLError.badResponse(request, data, rsp)) - } - } - - return promise - } -} - -#if os(iOS) - import UIKit.UIImage - - extension URLDataPromise { - /// Decode the HTTP response as a UIImage - public func asImage() -> Promise { - return then(on: waldo) { data -> UIImage in - guard let img = UIImage(data: data), let cgimg = img.cgImage else { - throw PMKURLError.invalidImageData(self.URLRequest, data) - } - // this way of decoding the image limits main thread impact when displaying the image - return UIImage(cgImage: cgimg, scale: img.scale, orientation: img.imageOrientation) - } - } - } -#endif - -extension URLResponse { - fileprivate var stringEncoding: String.Encoding? { - guard let encodingName = textEncodingName else { return nil } - let encoding = CFStringConvertIANACharSetNameToEncoding(encodingName as CFString) - guard encoding != kCFStringEncodingInvalidId else { return nil } - return String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(encoding)) - } -} - -extension Data { - fileprivate var b0rkedEmptyRailsResponse: Bool { - return count == 1 && withUnsafeBytes{ $0[0] == " " } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift deleted file mode 100644 index ecc9edd852f..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift +++ /dev/null @@ -1,26 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - - Returns: A promise that resolves when the provided object deallocates - - Important: The promise is not guarenteed to resolve immediately when the provided object is deallocated. So you cannot write code that depends on exact timing. - */ -public func after(life object: NSObject) -> Promise { - var reaper = objc_getAssociatedObject(object, &handle) as? GrimReaper - if reaper == nil { - reaper = GrimReaper() - objc_setAssociatedObject(object, &handle, reaper, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - return reaper!.promise -} - -private var handle: UInt8 = 0 - -private class GrimReaper: NSObject { - deinit { - fulfill() - } - let (promise, fulfill, _) = Promise.pending() -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h deleted file mode 100644 index 0026d378cf5..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// CALayer+AnyPromise.h -// -// Created by María Patricia Montalvo Dzib on 24/11/14. -// Copyright (c) 2014 Aluxoft SCP. All rights reserved. -// - -#import -#import - -/** - To import the `CALayer` category: - - use_frameworks! - pod "PromiseKit/QuartzCore" - - Or `CALayer` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface CALayer (PromiseKit) - -/** - Add the specified animation object to the layer’s render tree. - - @return A promise that thens two parameters: - - 1. `@YES` if the animation progressed entirely to completion. - 2. The `CAAnimation` object. - - @see addAnimation:forKey -*/ -- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key; - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m deleted file mode 100644 index 6ad7e2f13e2..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// CALayer+PromiseKit.m -// -// Created by María Patricia Montalvo Dzib on 24/11/14. -// Copyright (c) 2014 Aluxoft SCP. All rights reserved. -// - -#import -#import "CALayer+AnyPromise.h" - -@interface PMKCAAnimationDelegate : NSObject { -@public - PMKResolver resolve; - CAAnimation *animation; -} -@end - -@implementation PMKCAAnimationDelegate - -- (void)animationDidStop:(CAAnimation *)ignoreOrRetainCycleHappens finished:(BOOL)flag { - resolve(PMKManifold(@(flag), animation)); - animation.delegate = nil; -} - -@end - -@implementation CALayer (PromiseKit) - -- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key { - PMKCAAnimationDelegate *d = animation.delegate = [PMKCAAnimationDelegate new]; - d->animation = animation; - [self addAnimation:animation forKey:key]; - return [[AnyPromise alloc] initWithResolver:&d->resolve]; -} - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h deleted file mode 100644 index 585f7fddb66..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h +++ /dev/null @@ -1 +0,0 @@ -#import "CALayer+AnyPromise.h" diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift deleted file mode 100644 index 3ebc5813a31..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift +++ /dev/null @@ -1,96 +0,0 @@ -import UIKit -#if !COCOAPODS -import PromiseKit -#endif - -//TODO tests -//TODO NSCoding - -/** - A “promisable” UIAlertController. - - UIAlertController is not a suitable API for an extension; it has closure - handlers on its main API for each button and an extension would have to - either replace all these when the controller is presented or force you to - use an extended addAction method, which would be easy to forget part of - the time. Hence we provide a facade pattern that can be promised. - - let alert = PMKAlertController("OHAI") - let sup = alert.addActionWithTitle("SUP") - let bye = alert.addActionWithTitle("BYE") - promiseViewController(alert).then { action in - switch action { - case is sup: - //… - case is bye: - //… - } - } -*/ -public class PMKAlertController { - /// The title of the alert. - public var title: String? { return UIAlertController.title } - /// Descriptive text that provides more details about the reason for the alert. - public var message: String? { return UIAlertController.message } - /// The style of the alert controller. - public var preferredStyle: UIAlertControllerStyle { return UIAlertController.preferredStyle } - /// The actions that the user can take in response to the alert or action sheet. - public var actions: [UIAlertAction] { return UIAlertController.actions } - /// The array of text fields displayed by the alert. - public var textFields: [UITextField]? { return UIAlertController.textFields } - -#if !os(tvOS) - /// The nearest popover presentation controller that is managing the current view controller. - public var popoverPresentationController: UIPopoverPresentationController? { return UIAlertController.popoverPresentationController } -#endif - - /// Creates and returns a view controller for displaying an alert to the user. - public required init(title: String?, message: String? = nil, preferredStyle: UIAlertControllerStyle = .alert) { - UIAlertController = UIKit.UIAlertController(title: title, message: message, preferredStyle: preferredStyle) - } - - /// Attaches an action title to the alert or action sheet. - public func addActionWithTitle(title: String, style: UIAlertActionStyle = .default) -> UIAlertAction { - let action = UIAlertAction(title: title, style: style) { action in - if style != .cancel { - self.fulfill(action) - } else { - self.reject(Error.cancelled) - } - } - UIAlertController.addAction(action) - return action - } - - /// Adds a text field to an alert. - public func addTextFieldWithConfigurationHandler(configurationHandler: ((UITextField) -> Void)?) { - UIAlertController.addTextField(configurationHandler: configurationHandler) - } - - fileprivate let UIAlertController: UIKit.UIAlertController - fileprivate let (promise, fulfill, reject) = Promise.pending() - fileprivate var retainCycle: PMKAlertController? - - /// Errors that represent PMKAlertController failures - public enum Error: CancellableError { - /// The user cancelled the PMKAlertController. - case cancelled - - /// - Returns: true - public var isCancelled: Bool { - return self == .cancelled - } - } -} - -extension UIViewController { - /// Presents the PMKAlertController, resolving with the user action. - public func promise(_ vc: PMKAlertController, animated: Bool = true, completion: (() -> Void)? = nil) -> Promise { - vc.retainCycle = vc - present(vc.UIAlertController, animated: animated, completion: completion) - _ = vc.promise.always { _ -> Void in - vc.retainCycle = nil - } - return vc.promise - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h deleted file mode 100644 index 5133264586d..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h +++ /dev/null @@ -1,2 +0,0 @@ -#import "UIView+AnyPromise.h" -#import "UIViewController+AnyPromise.h" diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h deleted file mode 100644 index 0a19cd6fe12..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h +++ /dev/null @@ -1,80 +0,0 @@ -#import -#import - -// Created by Masafumi Yoshida on 2014/07/11. -// Copyright (c) 2014年 DeNA. All rights reserved. - -/** - To import the `UIView` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface UIView (PromiseKit) - -/** - Animate changes to one or more views using the specified duration. - - @param duration The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - @param animations A block object containing the changes to commit to the - views. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Animate changes to one or more views using the specified duration, delay, - options, and completion handler. - - @param duration The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - @param delay The amount of time (measured in seconds) to wait before - beginning the animations. Specify a value of 0 to begin the animations - immediately. - - @param options A mask of options indicating how you want to perform the - animations. For a list of valid constants, see UIViewAnimationOptions. - - @param animations A block object containing the changes to commit to the - views. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Performs a view animation using a timing curve corresponding to the - motion of a physical spring. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Creates an animation block object that can be used to set up - keyframe-based animations for the current view. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m deleted file mode 100644 index 04ee940358c..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m +++ /dev/null @@ -1,64 +0,0 @@ -// -// UIView+PromiseKit_UIAnimation.m -// YahooDenaStudy -// -// Created by Masafumi Yoshida on 2014/07/11. -// Copyright (c) 2014年 DeNA. All rights reserved. -// - -#import -#import "UIView+AnyPromise.h" - - -#define CopyPasta \ - NSAssert([NSThread isMainThread], @"UIKit animation must be performed on the main thread"); \ - \ - if (![NSThread isMainThread]) { \ - id error = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"Animation was attempted on a background thread"}]; \ - return [AnyPromise promiseWithValue:error]; \ - } \ - \ - PMKResolver resolve = nil; \ - AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; - - -@implementation UIView (PromiseKit) - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations { - return [self promiseWithDuration:duration delay:0 options:0 animations:animations]; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateWithDuration:duration delay:delay usingSpringWithDamping:dampingRatio initialSpringVelocity:velocity options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateKeyframesWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift deleted file mode 100644 index 5575e49077f..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift +++ /dev/null @@ -1,46 +0,0 @@ -import UIKit.UIView -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `UIView` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension UIView { - /** - Animate changes to one or more views using the specified duration, delay, - options, and completion handler. - - - Parameter duration: The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - - Parameter delay: The amount of time (measured in seconds) to wait before - beginning the animations. Specify a value of 0 to begin the animations - immediately. - - - Parameter options: A mask of options indicating how you want to perform the - animations. For a list of valid constants, see UIViewAnimationOptions. - - - Parameter animations: A block object containing the changes to commit to the - views. - - - Returns: A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. - */ - public class func promise(animateWithDuration duration: TimeInterval, delay: TimeInterval = 0, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Promise { - return PromiseKit.wrap { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h deleted file mode 100644 index 0e60ca9e7f9..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h +++ /dev/null @@ -1,71 +0,0 @@ -#import -#import - -/** - To import the `UIViewController` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface UIViewController (PromiseKit) - -/** - Presents a view controller modally. - - If the view controller is one of the following: - - - MFMailComposeViewController - - MFMessageComposeViewController - - UIImagePickerController - - SLComposeViewController - - Then PromiseKit presents the view controller returning a promise that is - resolved as per the documentation for those classes. Eg. if you present a - `UIImagePickerController` the view controller will be presented for you - and the returned promise will resolve with the media the user selected. - - [self promiseViewController:[MFMailComposeViewController new] animated:YES completion:nil].then(^{ - //… - }); - - Otherwise PromiseKit expects your view controller to implement a - `promise` property. This promise will be returned from this method and - presentation and dismissal of the presented view controller will be - managed for you. - - \@interface MyViewController: UIViewController - @property (readonly) AnyPromise *promise; - @end - - @implementation MyViewController { - PMKResolver resolve; - } - - - (void)viewDidLoad { - _promise = [[AnyPromise alloc] initWithResolver:&resolve]; - } - - - (void)later { - resolve(@"some fulfilled value"); - } - - @end - - [self promiseViewController:[MyViewController new] aniamted:YES completion:nil].then(^(id value){ - // value == @"some fulfilled value" - }); - - @return A promise that can be resolved by the presented view controller. -*/ -- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m deleted file mode 100644 index 93e7e00db6e..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m +++ /dev/null @@ -1,140 +0,0 @@ -#import -#import "UIViewController+AnyPromise.h" -#import - -#if PMKImagePickerController -#import -#endif - -@interface PMKGenericDelegate : NSObject { -@public - PMKResolver resolve; -} -+ (instancetype)delegateWithPromise:(AnyPromise **)promise; -@end - -@interface UIViewController () -- (AnyPromise*) promise; -@end - -@implementation UIViewController (PromiseKit) - -- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block { - __kindof UIViewController *vc2present = vc; - AnyPromise *promise = nil; - - if ([vc isKindOfClass:NSClassFromString(@"MFMailComposeViewController")]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"mailComposeDelegate"]; - } - else if ([vc isKindOfClass:NSClassFromString(@"MFMessageComposeViewController")]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"messageComposeDelegate"]; - } -#ifdef PMKImagePickerController - else if ([vc isKindOfClass:[UIImagePickerController class]]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"delegate"]; - } -#endif - else if ([vc isKindOfClass:NSClassFromString(@"SLComposeViewController")]) { - PMKResolver resolve; - promise = [[AnyPromise alloc] initWithResolver:&resolve]; - [vc setValue:^(NSInteger result){ - if (result == 0) { - resolve([NSError cancelledError]); - } else { - resolve(@(result)); - } - } forKey:@"completionHandler"]; - } - else if ([vc isKindOfClass:[UINavigationController class]]) - vc = [(id)vc viewControllers].firstObject; - - if (!vc) { - id userInfo = @{NSLocalizedDescriptionKey: @"nil or effective nil passed to promiseViewController"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - - if (!promise) { - if (![vc respondsToSelector:@selector(promise)]) { - id userInfo = @{NSLocalizedDescriptionKey: @"ViewController is not promisable"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - - promise = [vc valueForKey:@"promise"]; - - if (![promise isKindOfClass:[AnyPromise class]]) { - id userInfo = @{NSLocalizedDescriptionKey: @"The promise property is nil or not of type AnyPromise"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - } - - if (!promise.pending) - return promise; - - [self presentViewController:vc2present animated:animated completion:block]; - - promise.always(^{ - [vc2present.presentingViewController dismissViewControllerAnimated:animated completion:nil]; - }); - - return promise; -} - -@end - - - -@implementation PMKGenericDelegate { - id retainCycle; -} - -+ (instancetype)delegateWithPromise:(AnyPromise **)promise; { - PMKGenericDelegate *d = [PMKGenericDelegate new]; - d->retainCycle = d; - *promise = [[AnyPromise alloc] initWithResolver:&d->resolve]; - return d; -} - -- (void)mailComposeController:(id)controller didFinishWithResult:(int)result error:(NSError *)error { - if (error != nil) { - resolve(error); - } else if (result == 0) { - resolve([NSError cancelledError]); - } else { - resolve(@(result)); - } - retainCycle = nil; -} - -- (void)messageComposeViewController:(id)controller didFinishWithResult:(int)result { - if (result == 2) { - id userInfo = @{NSLocalizedDescriptionKey: @"The attempt to save or send the message was unsuccessful."}; - id error = [NSError errorWithDomain:PMKErrorDomain code:PMKOperationFailed userInfo:userInfo]; - resolve(error); - } else { - resolve(@(result)); - } - retainCycle = nil; -} - -#ifdef PMKImagePickerController - -- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - id img = info[UIImagePickerControllerEditedImage] ?: info[UIImagePickerControllerOriginalImage]; - resolve(PMKManifold(img, info)); - retainCycle = nil; -} - -- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - resolve([NSError cancelledError]); - retainCycle = nil; -} - -#endif - -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift deleted file mode 100644 index f02b9e64bb0..00000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift +++ /dev/null @@ -1,111 +0,0 @@ -import Foundation.NSError -import UIKit -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import this `UIViewController` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension UIViewController { - - public enum PMKError: Error { - case navigationControllerEmpty - case noImageFound - case notPromisable - case notGenericallyPromisable - case nilPromisable - } - - /// Configures when a UIViewController promise resolves - public enum FulfillmentType { - /// The promise resolves just after the view controller has disappeared. - case onceDisappeared - /// The promise resolves before the view controller has disappeared. - case beforeDismissal - } - - /// Presents the UIViewController, resolving with the user action. - public func promise(_ vc: UIViewController, animate animationOptions: PMKAnimationOptions = [.appear, .disappear], fulfills fulfillmentType: FulfillmentType = .onceDisappeared, completion: (() -> Void)? = nil) -> Promise { - let pvc: UIViewController - - switch vc { - case let nc as UINavigationController: - guard let vc = nc.viewControllers.first else { return Promise(error: PMKError.navigationControllerEmpty) } - pvc = vc - default: - pvc = vc - } - - let promise: Promise - - if !(pvc is Promisable) { - promise = Promise(error: PMKError.notPromisable) - } else if let p = pvc.value(forKeyPath: "promise") as? Promise { - promise = p - } else if let _ = pvc.value(forKeyPath: "promise") { - promise = Promise(error: PMKError.notGenericallyPromisable) - } else { - promise = Promise(error: PMKError.nilPromisable) - } - - if !promise.isPending { - return promise - } - - present(vc, animated: animationOptions.contains(.appear), completion: completion) - - let (wrappingPromise, fulfill, reject) = Promise.pending() - - switch fulfillmentType { - case .onceDisappeared: - promise.then { result in - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: { fulfill(result) }) - } - .catch(policy: .allErrors) { error in - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: { reject(error) }) - } - case .beforeDismissal: - promise.then { result -> Void in - fulfill(result) - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: nil) - } - .catch(policy: .allErrors) { error in - reject(error) - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: nil) - } - } - - return wrappingPromise - } - - @available(*, deprecated: 3.4, renamed: "promise(_:animate:fulfills:completion:)") - public func promiseViewController(_ vc: UIViewController, animated: Bool = true, completion: (() -> Void)? = nil) -> Promise { - return promise(vc, animate: animated ? [.appear, .disappear] : [], completion: completion) - } -} - -/// A protocol for UIViewControllers that can be promised. -@objc(Promisable) public protocol Promisable { - /** - Provide a promise for promiseViewController here. - - The resulting property must be annotated with @objc. - - Obviously return a Promise. There is an issue with generics and Swift and - protocols currently so we couldn't specify that. - */ - var promise: AnyObject! { get } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md index 0e2b93b1393..16f7520a241 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md @@ -2,12 +2,13 @@ ![badge-pod] ![badge-languages] ![badge-pms] ![badge-platforms] ![badge-mit] -[繁體中文](README.zh_Hant.md) [简体中文](README.zh_CN.md) +[繁體中文](README.zh_Hant.md), [简体中文](README.zh_CN.md) --- -Modern development is highly asynchronous: isn’t it about time we had tools that -made programming asynchronously powerful, easy and delightful? +Promises simplify asynchronous programming, freeing you up to focus on the more +important things. They are easy to learn, easy to master and result in clearer, +more readable code. Your co-workers will thank you. ```swift UIApplication.shared.isNetworkActivityIndicatorVisible = true @@ -20,228 +21,112 @@ firstly { }.always { UIApplication.shared.isNetworkActivityIndicatorVisible = false }.catch { error in - UIAlertView(/*…*/).show() + self.show(UIAlertController(for: error), sender: self) } ``` PromiseKit is a thoughtful and complete implementation of promises for any -platform with a `swiftc` (indeed, this includes *Linux*), it has *excellent* Objective-C bridging and +platform with a `swiftc`, it has *excellent* Objective-C bridging and *delightful* specializations for iOS, macOS, tvOS and watchOS. # Quick Start -We recommend [CocoaPods] or [Carthage], however you can just drop `PromiseKit.xcodeproj` into your project and add `PromiseKit.framework` to your app’s embedded frameworks. - -## Xcode 8 / Swift 3 +In your [Podfile]: ```ruby -# CocoaPods >= 1.1.0-rc.2 -swift_version = "3.0" -pod "PromiseKit", "~> 4.0" - -# Carthage -github "mxcl/PromiseKit" ~> 4.0 - -# SwiftPM -let package = Package( - dependencies: [ - .Package(url: "https://github.com/mxcl/PromiseKit", majorVersion: 4) - ] -) +use_frameworks! +swift_version = "3.1" +pod "PromiseKit", "~> 4.3" ``` -## Xcode 8 / Swift 2.3 or Xcode 7 - -```ruby -# CocoaPods -swift_version = "2.3" -pod "PromiseKit", "~> 3.5" +PromiseKit 4 supports Xcode 8 and 9, Swift 3.0, 3.1, 3.2 and Swift 4.0. -# Carthage -github "mxcl/PromiseKit" ~> 3.5 -``` +For Carthage, SwiftPM, etc., or for instructions when using older Swifts or +Xcodes see our [Installation Guide](Documentation/Installation.md). # Documentation -We have thorough and complete documentation at [promisekit.org]. - -## Overview - -Promises are defined by the function `then`: - -```swift -login().then { json in - //… -} -``` - -They are chainable: - -```swift -login().then { json -> Promise in - return fetchAvatar(json["username"]) -}.then { avatarImage in - self.imageView.image = avatarImage -} -``` - -Errors cascade through chains: - -```swift -login().then { - return fetchAvatar() -}.then { avatarImage in - //… -}.catch { error in - UIAlertView(/*…*/).show() -} -``` - -They are composable: +* Handbook + * [Getting Started](Documentation/GettingStarted.md) + * [Promises: Common Patterns](Documentation/CommonPatterns.md) + * [Frequently Asked Questions](Documentation/FAQ.md) +* Manual + * [Installation Guide](Documentation/Installation.md) + * [Objective-C Guide](Documentation/ObjectiveC.md) + * [Troubleshooting](Documentation/Troubleshooting.md) (eg. solutions to common compile errors) + * [Appendix](Documentation/Appendix.md) -```swift -let username = login().then{ $0["username"] } - -when(username, CLLocationManager.promise()).then { user, location in - return fetchAvatar(user, location: location) -}.then { image in - //… -} -``` - -They are trivial to refactor: - -```swift -func avatar() -> Promise { - let username = login().then{ $0["username"] } - - return when(username, CLLocationManager.promise()).then { user, location in - return fetchAvatar(user, location: location) - } -} -``` - -You can easily create a new, pending promise. -```swift -func fetchAvatar(user: String) -> Promise { - return Promise { fulfill, reject in - MyWebHelper.GET("\(user)/avatar") { data, err in - guard let data = data else { return reject(err) } - guard let img = UIImage(data: data) else { return reject(MyError.InvalidImage) } - guard let img.size.width > 0 else { return reject(MyError.ImageTooSmall) } - fulfill(img) - } - } -} -``` - -## Continue Learning… - -Complete and progressive learning guide at [promisekit.org]. - -## PromiseKit vs. Xcode - -PromiseKit contains Swift, so we engage in an unending battle with Xcode: - -| Swift | Xcode | PromiseKit | CI Status | Release Notes | -| ----- | ----- | ---------- | ------------ | ----------------- | -| 3 | 8 | 4 | ![ci-master] | [2016/09][news-4] | -| 2 | 7/8 | 3 | ![ci-swift2] | [2015/10][news-3] | -| 1 | 7 | 3 | – | [2015/10][news-3] | -| *N/A* | * | 1† | ![ci-legacy] | – | - -† PromiseKit 1 is pure Objective-C and thus can be used with any Xcode, it is -also your only choice if you need to support iOS 7 or below. - ---- - -We also maintain some branches to aid migrating between Swift versions: - -| Xcode | Swift | PromiseKit | Branch | CI Status | -| ----- | ----- | -----------| --------------------------- | --------- | -| 8.0 | 2.3 | 2 | [swift-2.3-minimal-changes] | ![ci-23] | -| 7.3 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | -| 7.2 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | -| 7.1 | 2.1 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | -| 7.0 | 2.0 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | - -We do **not** usually backport fixes to these branches, but pull-requests are welcome. +If you are looking for a function’s documentation, then please note +[our sources](Sources/) are thoroughly documented. # Extensions -Promises are only as useful as the asynchronous tasks they represent, thus we -have converted (almost) all of Apple’s APIs to Promises. The default CocoaPod -comes with promises UIKit and Foundation, the rest are accessed by specifying -additional subspecs in your `Podfile`, eg: +Promises are only as useful as the asynchronous tasks they represent, thus we +have converted (almost) all of Apple’s APIs to promises. The default CocoaPod +comes with promises for UIKit and Foundation, the rest can be installed by +specifying additional subspecs in your `Podfile`, eg: ```ruby -pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } -pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } +pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } +pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } ``` -All our extensions are separate repositories at the [PromiseKit org ](https://github.com/PromiseKit). - -For Carthage specify the additional repositories in your `Cartfile`: - -```ruby -github "PromiseKit/MapKit" ~> 1.0 -``` +All our extensions are separate repositories at the [PromiseKit organization]. ## Choose Your Networking Library -`NSURLSession` is typically inadequate; choose from [Alamofire] or [OMGHTTPURLRQ]: +Promise chains are commonly started with networking, thus we offer multiple +options: [Alamofire], [OMGHTTPURLRQ] and of course (vanilla) `NSURLSession`: ```swift -// pod 'PromiseKit/Alamofire' -Alamofire.request("http://example.com", withMethod: .GET).responseJSON().then { json in +// pod 'PromiseKit/Alamofire' +// https://github.com/PromiseKit/Alamofire +Alamofire.request("http://example.com", method: .post).responseJSON().then { json in //… }.catch { error in //… } // pod 'PromiseKit/OMGHTTPURLRQ' -URLSession.GET("http://example.com").asDictionary().then { json in - +// https://github.com/PromiseKit/OMGHTTPURLRQ +URLSession.POST("http://example.com").asDictionary().then { json in + //… +}.catch { error in + //… +} + +// pod 'PromiseKit/Foundation' +// https://github.com/PromiseKit/Foundation +URLSession.shared.dataTask(url).asDictionary().then { json in + // … }.catch { error in //… } ``` -For [AFNetworking] we recommend [csotiriou/AFNetworking]. +Nobody ever got fired for using Alamofire, but at the end of the day, it’s +just a small wrapper around `NSURLSession`. OMGHTTPURLRQ supplements +`NSURLRequest` to make generating REST style requests easier, and the PromiseKit +extensions extend `NSURLSession` to make OMG usage more convenient. But since a +while now most servers accept JSON, so writing a simple API class that uses +vanilla `NSURLSession` and our promises is not hard, and gives you the most +control with the fewest black-boxes. +The choice is yours. -# Need to convert your codebase to Promises? +# Support -From experience it really improves the robustness of your app, feel free to ask us how to go about it. +Ask your question at our [Gitter chat channel] or on [our bug tracker]. -# Support -Ask your question at our [Gitter chat channel](https://gitter.im/mxcl/PromiseKit) or on -[our bug tracker](https://github.com/mxcl/PromiseKit/issues/new). - - -[travis]: https://travis-ci.org/mxcl/PromiseKit -[ci-master]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=master -[ci-legacy]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=legacy-1.x -[ci-swift2]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.x -[ci-23]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.3-minimal-changes -[ci-22]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.2-minimal-changes -[ci-20]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.0-minimal-changes -[news-2]: http://promisekit.org/news/2015/05/PromiseKit-2.0-Released/ -[news-3]: https://github.com/mxcl/PromiseKit/blob/master/CHANGELOG.markdown#300-oct-1st-2015 -[news-4]: http://promisekit.org/news/2016/09/PromiseKit-4.0-Released/ -[swift-2.3-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.3-minimal-changes -[swift-2.2-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.2-minimal-changes -[swift-2.0-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes -[promisekit.org]: http://promisekit.org/docs/ [badge-pod]: https://img.shields.io/cocoapods/v/PromiseKit.svg?label=version -[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg +[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg [badge-languages]: https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg +[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg [badge-mit]: https://img.shields.io/badge/license-MIT-blue.svg -[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg [OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ [Alamofire]: http://alamofire.org -[AFNetworking]: https://github.com/AFNetworking/AFNetworking -[csotiriou/AFNetworking]: https://github.com/csotiriou/AFNetworking-PromiseKit -[CocoaPods]: http://cocoapods.org -[Carthage]: 2016-09-05-PromiseKit-4.0-Released +[PromiseKit organization]: https://github.com/PromiseKit +[Gitter chat channel]: https://gitter.im/mxcl/PromiseKit +[our bug tracker]: https://github.com/mxcl/PromiseKit/issues/new +[Podfile]: https://guides.cocoapods.org/syntax/podfile.html diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h index efc2bcaba27..756ba7b7b4d 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h @@ -27,7 +27,7 @@ @interface AnyPromise (Swift) - (AnyPromise * __nonnull)__thenOn:(__nonnull dispatch_queue_t)q execute:(id __nullable (^ __nonnull)(id __nullable))body; -- (AnyPromise * __nonnull)__catchWithPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__catchOn:(__nonnull dispatch_queue_t)q withPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; - (AnyPromise * __nonnull)__alwaysOn:(__nonnull dispatch_queue_t)q execute:(void (^ __nonnull)(void))body; - (void)__pipe:(void(^ __nonnull)(__nullable id))body; - (AnyPromise * __nonnull)initWithResolverBlock:(void (^ __nonnull)(PMKResolver __nonnull))resolver; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h index 28806f2755c..6aafad7802d 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h @@ -100,6 +100,35 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { - (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catch NS_REFINED_FOR_SWIFT; #endif +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the global background queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catchInBackground NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on queue provided. + + @warning *Note* Cancellation errors are not caught. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))catchOn NS_REFINED_FOR_SWIFT; + /** The provided block is executed when the receiver is rejected with the specified policy. @@ -109,6 +138,17 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { */ - (AnyPromise * __nonnull(^ __nonnull)(PMKCatchPolicy, id __nonnull))catchWithPolicy NS_REFINED_FOR_SWIFT; +/** + The provided block is executed when the receiver is rejected with the specified policy. + + Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. + + The provided block always runs on queue provided. + + @see catch + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, PMKCatchPolicy, id __nonnull))catchOnWithPolicy NS_REFINED_FOR_SWIFT; + /** The provided block is executed when the receiver is resolved. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m index 184ac015622..c0f81f4c30b 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m @@ -1,7 +1,7 @@ #import "PMKCallVariadicBlock.m" #import "AnyPromise+Private.h" -extern dispatch_queue_t PMKDefaultDispatchQueue(); +extern dispatch_queue_t PMKDefaultDispatchQueue(void); NSString *const PMKErrorDomain = @"PMKErrorDomain"; @@ -38,9 +38,33 @@ - (instancetype)initWithResolver:(PMKResolver __strong *)resolver { }; } +- (AnyPromise *(^)(dispatch_queue_t, id))catchOn { + return ^(dispatch_queue_t q, id block) { + return [self __catchOn:q withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + - (AnyPromise *(^)(id))catch { return ^(id block) { - return [self __catchWithPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catchInBackground { + return ^(id block) { + return [self __catchOn:dispatch_get_global_queue(0, 0) withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, PMKCatchPolicy, id))catchOnWithPolicy { + return ^(dispatch_queue_t q, PMKCatchPolicy policy, id block) { + return [self __catchOn:q withPolicy:policy execute:^(id obj) { return PMKCallVariadicBlock(block, obj); }]; }; @@ -48,7 +72,7 @@ - (instancetype)initWithResolver:(PMKResolver __strong *)resolver { - (AnyPromise *(^)(PMKCatchPolicy, id))catchWithPolicy { return ^(PMKCatchPolicy policy, id block) { - return [self __catchWithPolicy:policy execute:^(id obj) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:policy execute:^(id obj) { return PMKCallVariadicBlock(block, obj); }]; }; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift index 7fc7d0217e6..843f2c1facf 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift @@ -206,9 +206,9 @@ import Foundation }) } - @objc func __catchWithPolicy(_ policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { + @objc func __catchOn(_ q: DispatchQueue, withPolicy policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { return AnyPromise(sealant: { resolve in - state.catch(on: .default, policy: policy, else: resolve) { err in + state.catch(on: q, policy: policy, else: resolve) { err in makeHandler(body, resolve)(err as NSError) } }) diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift index a447f293285..40535ad4f51 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift @@ -128,6 +128,7 @@ extension NSError { private var cancelledErrorIdentifiers = Set([ ErrorPair(PMKErrorDomain, PMKOperationCancelled), + ErrorPair(NSCocoaErrorDomain, NSUserCancelledError), ErrorPair(NSURLErrorDomain, NSURLErrorCancelled), ]) diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift index ddbd6064aac..12c85ce4f0d 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift @@ -626,3 +626,12 @@ extension Promise where T: Collection { } } } + + +#if swift(>=3.1) +public extension Promise where T == Void { + convenience init() { + self.init(value: ()) + } +} +#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift index 049ea74fb50..902dc4264a3 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift @@ -4,9 +4,34 @@ import Dispatch /** - Returns: A new promise that fulfills after the specified duration. */ +@available(*, deprecated: 4.3, message: "Use after(seconds:)") public func after(interval: TimeInterval) -> Promise { + return after(seconds: interval) +} + +/** + after(.seconds(2)).then { + } + +- Returns: A new promise that fulfills after the specified duration. +*/ +public func after(seconds: TimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + seconds + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + } +} + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +public func after(interval: DispatchTimeInterval) -> Promise { return Promise { fulfill, _ in let when = DispatchTime.now() + interval + #if swift(>=4.0) + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + #else DispatchQueue.global().asyncAfter(deadline: when, execute: fulfill) + #endif } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h index 78b93f7a4e6..825f47831bb 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h @@ -219,7 +219,7 @@ extern AnyPromise * __nonnull dispatch_promise_on(dispatch_queue_t __nonnull que By default this returns dispatch_get_main_queue() */ -extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue() NS_REFINED_FOR_SWIFT; +extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue(void) NS_REFINED_FOR_SWIFT; /** You may alter the default dispatch queue, but you may only alter it once, and you must alter it before any `then`, etc. calls are made in your app. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift index 638dfa8e068..41943b88b78 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift @@ -5,7 +5,11 @@ private func _when(_ promises: [Promise]) -> Promise { let root = Promise.pending() var countdown = promises.count guard countdown > 0 else { + #if swift(>=4.0) + root.fulfill(()) + #else root.fulfill() + #endif return root.promise } @@ -34,7 +38,11 @@ private func _when(_ promises: [Promise]) -> Promise { progress.completedUnitCount += 1 countdown -= 1 if countdown == 0 { + #if swift(>=4.0) + root.fulfill(()) + #else root.fulfill() + #endif } } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift index 3b715f1e06f..7249df91d3e 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift @@ -61,7 +61,11 @@ public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise if let error = error { reject(error) } else { + #if swift(>=4.0) + fulfill(()) + #else fulfill() + #endif } } } diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h index 02327b85e88..00014e3cd82 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig index 772ef0b2bca..619e5f4acef 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist index df276491a16..c1c4a98b9a1 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.0 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h index 435b682a106..2a366623a36 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig index 59a957e4d4d..7a567144865 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -6,5 +6,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh index bbccf288336..0fbbf6892e0 100755 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -84,12 +102,15 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/PromiseKit/PromiseKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/PromiseKit/PromiseKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h index 2bdb03cd939..b7da51aaf25 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig index 609a649dd14..e6e847883ae 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig index 609a649dd14..e6e847883ae 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh index 893c16a6313..88dd5379907 100755 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -82,3 +100,6 @@ strip_invalid_archs() { fi } +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h index 950bb19ca7a..b2e4925a9e4 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig index a8557117751..ccac9379a86 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig index a8557117751..ccac9379a86 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist index b04e694ee51..df276491a16 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.2.2 + 4.4.0 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h index 3a06b7bd323..d90df9dacd4 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h @@ -1,19 +1,18 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif #import "AnyPromise.h" #import "fwd.h" #import "PromiseKit.h" -#import "NSNotificationCenter+AnyPromise.h" -#import "NSTask+AnyPromise.h" -#import "NSURLSession+AnyPromise.h" -#import "PMKFoundation.h" -#import "CALayer+AnyPromise.h" -#import "PMKQuartzCore.h" -#import "PMKUIKit.h" -#import "UIView+AnyPromise.h" -#import "UIViewController+AnyPromise.h" FOUNDATION_EXPORT double PromiseKitVersionNumber; FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig index dcb583d56a9..657ad7b3dfb 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig @@ -1,10 +1,11 @@ CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/PromiseKit GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" +OTHER_LDFLAGS = -framework "Foundation" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromiseKit PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 67337de03e5..a0cf7c49cf3 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -262,13 +262,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { @@ -277,9 +280,16 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -307,13 +317,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */ = { diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec index df8e34d5166..64c4a5e4fea 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'RxSwift', '~> 3.4.1' - s.dependency 'Alamofire', '~> 4.0' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock index c72efda65d9..56a6c42e699 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock @@ -1,7 +1,7 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) + - Alamofire (~> 4.5.0) - RxSwift (~> 3.4.1) - RxSwift (3.4.1) @@ -10,13 +10,13 @@ DEPENDENCIES: EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 4382c9734f35e6473f8383a6b805f28fc19d09e1 + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: 89ba1ed13b6653200cc34a2248644e7e6a142b60 RxSwift: 656f8fbeca5bc372121a72d9ebdd3cd3bc0ffade PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md index 12ea4c74775..e1966fdca00 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md @@ -57,8 +57,8 @@ In order to keep Alamofire focused specifically on core networking implementatio ## Requirements - iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1+ -- Swift 3.0+ +- Xcode 8.1, 8.2, 8.3, and 9.0 +- Swift 3.0, 3.1, 3.2, and 4.0 ## Migration Guides @@ -137,21 +137,21 @@ dependencies: [ ### Manually -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. #### Embedded Framework - Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: ```bash -$ git init -``` + $ git init + ``` - Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: ```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` - Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. @@ -191,13 +191,16 @@ Handling the `Response` of a `Request` made in Alamofire involves chaining a res ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.request) // original URL request - print(response.response) // HTTP URL response - print(response.data) // server data - print(response.result) // result of response serialization + print("Request: \(String(describing: response.request))") // original url request + print("Response: \(String(describing: response.response))") // http url response + print("Result: \(response.result)") // response serialization result - if let JSON = response.result.value { - print("JSON: \(JSON)") + if let json = response.result.value { + print("JSON: \(json)") // serialized json response + } + + if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { + print("Data: \(utf8Text)") // original server data as UTF8 string } } ``` @@ -243,7 +246,7 @@ func responsePropertyList( None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. -> For example, response status codes in the `400..<499` and `500..<599` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. +> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. #### Response Handler @@ -345,18 +348,18 @@ Alamofire.request("https://httpbin.org/get") .validate(statusCode: 200..<300) .validate(contentType: ["application/json"]) .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } + switch response.result { + case .success: + print("Validation Successful") + case .failure(let error): + print(error) + } } ``` #### Automatic Validation -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. +Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. ```swift Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in @@ -491,7 +494,7 @@ struct JSONStringArrayEncoding: ParameterEncoding { } func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = urlRequest.urlRequest + var urlRequest = try urlRequest.asURLRequest() let data = try JSONSerialization.data(withJSONObject: array, options: []) @@ -612,9 +615,9 @@ Requests made in Alamofire that fetch data from a server can download the data i ```swift Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -629,8 +632,8 @@ You can also provide a `DownloadFileDestination` closure to move the file from t ```swift let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) } @@ -638,16 +641,16 @@ let destination: DownloadRequest.DownloadFileDestination = { _, _ in Alamofire.download(urlString, to: destination).response { response in print(response) - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } + if response.error == nil, let imagePath = response.destinationURL?.path { + let image = UIImage(contentsOfFile: imagePath) + } } ``` You can also use the suggested download destination API. ```swift -let destination = DownloadRequest.suggestedDownloadDestination(directory: .documentDirectory) +let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) Alamofire.download("https://httpbin.org/image/png", to: destination) ``` @@ -661,9 +664,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -677,9 +680,9 @@ Alamofire.download("https://httpbin.org/image/png") print("Download Progress: \(progress.fractionCompleted)") } .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } + if let data = response.result.value { + let image = UIImage(data: data) + } } ``` @@ -691,34 +694,34 @@ If a `DownloadRequest` is cancelled or interrupted, the underlying URL session m ```swift class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? + private var resumeData: Data? + private var image: UIImage? func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } + guard image == nil else { completion(image) ; return } - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendPathComponent("pig.png") + let destination: DownloadRequest.DownloadFileDestination = { _, _ in + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] + let fileURL = documentsURL.appendingPathComponent("pig.png") - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) + } - let request: DownloadRequest + let request: DownloadRequest if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") + request = Alamofire.download(resumingWith: resumeData) + } else { + request = Alamofire.download("https://httpbin.org/image/png") } request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } + switch response.result { + case .success(let data): + self.image = UIImage(data: data) + case .failure: + self.resumeData = response.resumeData + } } } } @@ -816,7 +819,7 @@ In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetr ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) + print(response.metrics) } ``` @@ -824,8 +827,8 @@ It's important to note that these APIs are only available on iOS and tvOS 10 and ```swift Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0. *) { - print(response.metrics) + if #available(iOS 10.0, *) { + print(response.metrics) } } ``` @@ -854,10 +857,10 @@ Outputs: ```bash $ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" + -H "User-Agent: Alamofire/4.0.0" \ + -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ + -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ + "https://httpbin.org/get?foo=bar" ``` --- @@ -1183,20 +1186,20 @@ The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` t ```swift class AccessTokenAdapter: RequestAdapter { - private let accessToken: String + private let accessToken: String - init(accessToken: String) { - self.accessToken = accessToken - } + init(accessToken: String) { + self.accessToken = accessToken + } - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } - return urlRequest + return urlRequest } } ``` @@ -1414,7 +1417,7 @@ func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alam } loadUser { response in - if let user = userResponse.value { + if let user = response.value { print("User: { username: \(user.username), name: \(user.name) }") } } @@ -1749,24 +1752,24 @@ If you run into this problem (high probability with self-signed certificates), y ```xml - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - + NSAppTransportSecurity + + NSExceptionDomains + + example.com + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionRequiresForwardSecrecy + + NSIncludesSubdomains + + + NSTemporaryExceptionMinimumTLSVersion + TLSv1.2 + + + ``` @@ -1851,4 +1854,4 @@ The community adoption of the ASF libraries has been amazing. We are greatly hum ## License -Alamofire is released under the MIT license. See LICENSE for details. +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift index 86d54d85932..edcf717ca9e 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -53,7 +53,7 @@ extension URL: URLConvertible { } extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherise throws an `Error`. + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. /// /// - throws: An `AFError.invalidURL` if `url` is `nil`. /// diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift index 6d0d5560666..c5093f9f857 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -92,7 +92,7 @@ open class MultipartFormData { // MARK: - Properties /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open var contentType: String { return "multipart/form-data; boundary=\(boundary)" } + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift index 888818df77c..30443b99b29 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -182,21 +182,24 @@ public class NetworkReachabilityManager { // MARK: - Internal - Network Reachability Status func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.reachable) else { return .notReachable } + guard isNetworkReachable(with: flags) else { return .notReachable } - var networkStatus: NetworkReachabilityStatus = .notReachable + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - if !flags.contains(.connectionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif - if flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) { - if !flags.contains(.interventionRequired) { networkStatus = .reachable(.ethernetOrWiFi) } - } + return networkStatus + } - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - return networkStatus + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) } } diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift index 242f6a83dc1..959af6f9365 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -241,8 +241,11 @@ public struct URLEncoding: ParameterEncoding { let value = parameters[key]! components += queryComponents(fromKey: key, value: value) } - + #if swift(>=4.0) + return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") + #else return components.map { "\($0)=\($1)" }.joined(separator: "&") + #endif } private func encodesParametersInURL(with method: HTTPMethod) -> Bool { diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift index 78864952dca..4f6350c5bfe 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -46,7 +46,7 @@ public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: Tim public protocol RequestRetrier { /// Determines whether the `Request` should be retried by calling the `completion` closure. /// - /// This operation is fully asychronous. Any amount of time can be taken to determine whether the request needs + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly /// cleaned up after. /// @@ -269,7 +269,7 @@ extension Request: CustomDebugStringConvertible { } func cURLRepresentation() -> String { - var components = ["$ curl -i"] + var components = ["$ curl -v"] guard let request = self.request, let url = request.url, diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift index 47780fd611b..1a59da550a7 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -88,11 +88,12 @@ public struct DownloadResponseSerializer: DownloadResponseSerializerProto extension Request { var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime return Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), + requestStartTime: requestStartTime, initialResponseTime: initialResponseTime, requestCompletedTime: requestCompletedTime, serializationCompletedTime: CFAbsoluteTimeGetCurrent() diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift index c13b1fcf77b..bf7e70255b7 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -162,7 +162,7 @@ extension Result { /// try print(noInt.unwrap()) /// // Throws error /// - /// - parameter transform: A closure that takes the success value of the result instance. + /// - parameter transform: A closure that takes the success value of the `Result` instance. /// /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the /// same failure. @@ -200,4 +200,101 @@ extension Result { return .failure(error) } } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) -> Void) -> Result { + if case let .success(value) = self { closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) -> Void) -> Result { + if case let .failure(error) = self { closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () -> Void) -> Result { + if isSuccess { closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () -> Void) -> Result { + if isFailure { closure() } + + return self + } } diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift index 27ad88124c2..8edb492b699 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -36,7 +36,7 @@ open class SessionDelegate: NSObject { open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? @@ -48,21 +48,21 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, (URLRequest?) -> Void) -> Void)? + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, (InputStream?) -> Void) -> Void)? + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? @@ -77,7 +77,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, (URLSession.ResponseDisposition) -> Void) -> Void)? + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? @@ -90,7 +90,7 @@ open class SessionDelegate: NSObject { /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, (CachedURLResponse?) -> Void) -> Void)? + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? // MARK: URLSessionDownloadDelegate Overrides @@ -462,8 +462,8 @@ extension SessionDelegate: URLSessionTaskDelegate { // Determine whether an error has occurred var error: Error? = error - if let taskDelegate = self[task]?.delegate, taskDelegate.error != nil { - error = taskDelegate.error + if request.delegate.error != nil { + error = request.delegate.error } /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift index 450f750de41..493ce29cb4e 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -58,10 +58,18 @@ open class SessionManager { let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + #if swift(>=4.0) + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in + let (index, languageCode) = enumeratedLanguage + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + #else let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in let quality = 1.0 - (Double(index) * 0.1) return "\(languageCode);q=\(quality)" }.joined(separator: ", ") + #endif // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index 0edfb03e097..501a53c3721 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -13,13 +13,13 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", + "source_files": "PetstoreClient/Classes/**/*.swift", "dependencies": { "RxSwift": [ "~> 3.4.1" ], "Alamofire": [ - "~> 4.0" + "~> 4.5.0" ] } } diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock index c72efda65d9..56a6c42e699 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock @@ -1,7 +1,7 @@ PODS: - - Alamofire (4.4.0) + - Alamofire (4.5.0) - PetstoreClient (0.0.1): - - Alamofire (~> 4.0) + - Alamofire (~> 4.5.0) - RxSwift (~> 3.4.1) - RxSwift (3.4.1) @@ -10,13 +10,13 @@ DEPENDENCIES: EXTERNAL SOURCES: PetstoreClient: - :path: "../" + :path: ../ SPEC CHECKSUMS: - Alamofire: dc44b1600b800eb63da6a19039a0083d62a6a62d - PetstoreClient: 4382c9734f35e6473f8383a6b805f28fc19d09e1 + Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 + PetstoreClient: 89ba1ed13b6653200cc34a2248644e7e6a142b60 RxSwift: 656f8fbeca5bc372121a72d9ebdd3cd3bc0ffade PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index 14c0aa1a41a..a6ddee94f5e 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -8,43 +8,43 @@ /* Begin PBXBuildFile section */ 00C50CA5DCB5BA090375BB3B524C50E6 /* ScheduledItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AF9D1F5A21CB847E913BF41EC110B1F /* ScheduledItemType.swift */; }; + 058099234763329A48424C8A10C5824E /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E8814B64707AA238E44CC6739648D2B /* PetstoreClient-dummy.m */; }; + 0588C627138A5FC717BE474F7F6099F4 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = F511E345C77AFF186F61FCC34A664ED5 /* Return.swift */; }; 069D8D323EA2AC0D1C41A0835C810485 /* Using.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA907F82073836CB66D5D606FB1333D9 /* Using.swift */; }; - 07B6BCAC1CB401E72E73445EAF0CC011 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2CEFB4563AAF003750C502652064250 /* FormatTest.swift */; }; + 07538F6EF28CF0D537B45B6210077B6F /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3BBD18F117F47C44487A0FB4650EF0D /* Client.swift */; }; 088619C9CB8ECAB44A0079814877AC2B /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EACF73E072E466AF5911B9BB191E174 /* TakeLast.swift */; }; 0B548DFB67637B2D68A1F676F4A105B9 /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BED5103BCF9D40F85068CF32B24A63E /* Event.swift */; }; - 0B57F42F9F0D7EEC37BC9E0C11D9B17A /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3050B56DC142944463FA79F9B91AC70 /* Client.swift */; }; 0BB84EADE161C2D47B619ACB31218339 /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F1C7AD0D97D1F541A20DEDFD5AC30AF /* DispatchQueue+Extensions.swift */; }; + 0CAD756A07CDD3214A87984F53D2D553 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69AC2285C925A617C06C7FB2086BAA68 /* ReadOnlyFirst.swift */; }; 0D452D986DA48DEAB11DECEAC1BEF52D /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34B9F812BB8C50E3EA28F4FB51A1095 /* SynchronizedDisposeType.swift */; }; + 0D5164E0905ADFD6E8801868FF767491 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = B88AB92BE71D793E0172BDB03CBBAA1E /* Model200Response.swift */; }; 0DBFC6A3AFDB21E14DE42949EFAB52C3 /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C44C9A30733440A3D263B43861FBA1 /* DisposeBase.swift */; }; + 0E06A7A24FEC623CCD59A64464FA0F4B /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5ABAF432E141A4D578C1ECEA8D3D06 /* Models.swift */; }; 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5F0AE167B06634076A6A2605697CE49 /* Timeline.swift */; }; 113B52D926F2B09AFA1F46F428D8AC8C /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A236E8B385B46BC8C1268A38CCBDE5 /* Deprecated.swift */; }; 14ED92A114891418E3C30810DCE5CD53 /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FE769331C0AFEF35319E2F6260F9DF /* Sample.swift */; }; 14F8FBD0D3FBFC5BDE6C3A8DF72484CA /* Delay.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14A5F119805F0FCFCC8C1314040D871 /* Delay.swift */; }; - 15D4F44ABBB42806F52CDB40C3D3FAD9 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4611AE0764EA3CE44DAB9AE6853897A8 /* AlamofireImplementations.swift */; }; 1717E048D5754063AE1315867E52EE19 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80C18B1881A0F511B8D6DDA77F355B51 /* Range.swift */; }; 18033E5B30880169F7A60CD98AE9A06B /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA436001918C6F92DC029B7E695520E8 /* PublishSubject.swift */; }; 18CF543833BAA1E34BAAFAA2B57B9709 /* Debounce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09CF571E27DC65BF77EFFF62354B5EF0 /* Debounce.swift */; }; 18D7A50E1BB3A20E0D7E8CE121988DD9 /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 939E73AB843F47D6C9EA0D065BAF63FC /* Map.swift */; }; + 1A54AFBFE909D0F2608D4F47C52ED045 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A02E1847AE8F11E47BE4161FCABFA7 /* Name.swift */; }; 1B4189B0E3CD1C28CC7B8A33DD40CD1A /* InvocableScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30436E554B573E5078213F681DA0061F /* InvocableScheduledItem.swift */; }; 1B4349FCBC055EC01D28BE388D9C27C9 /* ImmediateScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F777764A45E0A77BE276ADA473AF453A /* ImmediateScheduler.swift */; }; 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F42569FD7843064F8467B7215CC7A9A9 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1E26E53EEAA558B4AAAB0413BCD87D4C /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = D756CC001719820E35D7EDC74440A99A /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; 1F1681836E1A46010E64F9F74A9688A5 /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CEC3599B3E7B7EB3DA8FBA9610E255 /* ToArray.swift */; }; - 1FC024F353F75F19F8DE0A7B836FD613 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; 20AD9923B7484C3062DC1782090D5CC0 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48242CA8E564C2C50CFF8E3E77668FB7 /* Platform.Linux.swift */; }; - 21D925E566EDCF2015C26F3B0534C18B /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80315B443694B2EC8CCF76D4FABE028D /* Category.swift */; }; + 22EE4A36063EC92A1E44595D3CA1285E /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D46171F3DE7355BBDB8A0594675BB4 /* HasOnlyReadOnly.swift */; }; 234470CC48A18683C120E00A087C42E7 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */; }; 25150A74A8D3312556CF7125A05CC7FF /* GroupedObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AC7E0F67AECA3C1CBDBF7BC409CDADC /* GroupedObservable.swift */; }; - 25447075CCEFE492C62DD9B5343609DE /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9008ECB8D4F9BA319D0DAFC68443A3 /* EnumArrays.swift */; }; + 2528BD9FDA9E26A202E8A8AB6DEFFB0F /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 590A7488E9B89273069B539F03421606 /* MapTest.swift */; }; 26BAE89C26DE9986FE8796564747C1FD /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA39A7A8DF958888156A2207EF666EB1 /* SynchronizedUnsubscribeType.swift */; }; - 26E0F4D71550CA1C212CB7E7A488ADE2 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4C48FFB103870F7F9978AA7BDE59E74 /* MapTest.swift */; }; 27203A3E758C690E81BFA192020F8CD4 /* ScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C32D4D3484C860B70069CD1C629F666 /* ScheduledItem.swift */; }; 27E1DA817DC3FF6513B59C55B726A920 /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6635256007E4FB66691FA58431C5B23 /* Amb.swift */; }; 281AFAEA94C9F83ACC6296BBD7A0D2E4 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2834247529DA25BC7EAD2A5F93BC3BA5 /* AsSingle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4644DAD437464D93509A585F99B235E /* AsSingle.swift */; }; 2883D5F3AAAB2B6F1244E2C5AD01B7C8 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F7B4D89DB784C462A959824F1E698C /* SubscriptionDisposable.swift */; }; 29D7DC0AA2A54C8F8F8CA0179FF7649A /* SynchronizedSubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B70F2B6C174F1E6C285A5F774C3C97E /* SynchronizedSubscribeType.swift */; }; - 2BAA1E2F9E057A259B5A4FD9554820CC /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CA3F9326583E57838201C8F5288BB2 /* ArrayOfNumberOnly.swift */; }; 2CBFA5FE714C0F310B12B085944C58A8 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A98B8DAD74FBDB55E3D879266AA14CA /* Queue.swift */; }; 2D6753FA5CBC09FF42D12F0DB2601286 /* SingleAssignmentDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D311EA38EC997A02CB05BACC0DD7D /* SingleAssignmentDisposable.swift */; }; 2E8F4D9F164ED6C8CA2089200FCDD626 /* Sink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18254952242D69F129DC1ACD4BDF8AF4 /* Sink.swift */; }; @@ -54,71 +54,77 @@ 34EFD0CA858F154A1A07FD30FC4E7D6D /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FA4778A42883943FE99141A948880BE /* Scan.swift */; }; 35E29ACA4FFE9CFE36119C2B5E6BE631 /* TakeUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65518CF96489DBA6322987069B264467 /* TakeUntil.swift */; }; 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E181A2141028C3EB376581163644E247 /* TaskDelegate.swift */; }; + 371D450E9B85ACBA18E949DEEC06DAE3 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F379571B66704590E35A4719E6769F9 /* Pet.swift */; }; 37A1223C80BA6EB819FFDB0DB9018565 /* SerialDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8317D3F53EA1D6DC62811B7F71E22E8E /* SerialDispatchQueueScheduler.swift */; }; + 386F9A49ADAB8E03CE41B6EC146B5FA2 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC7A4A0D213AA0C7831EA91E658003C /* EnumTest.swift */; }; 388A3818CA2462513CBD366E481EB479 /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48E60FBF9296448D4A2FEC7E14FBE6DB /* ScheduledDisposable.swift */; }; 395353DBA02265CE8A088384D9C21C96 /* CurrentThreadScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEFD5C825FC7E42B492A86160C4B4D9 /* CurrentThreadScheduler.swift */; }; 3EC30116BE2A106102E6D8E6F0420A32 /* Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1FCEDB728FD2060B1A8C36A71039328 /* Merge.swift */; }; 413C5140802B635E5EFD061A5973C8D0 /* AsyncSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80AD53E4312C3B362D3336BDC9D80A80 /* AsyncSubject.swift */; }; 41D4AF198FF453F16AA231156D254F5C /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D641B399A74F0F9D45B05F8D357C806 /* Bag+Rx.swift */; }; + 41D7E74614B7E7289F55DC3C2C5E1BC7 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = E94FD1527D47A90A58A6E226AF6C4A44 /* ApiResponse.swift */; }; 422071460CEC4FD457FAE4EB0E4B3826 /* Generate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9675783D8A4B72DF63BAA2050C4E5659 /* Generate.swift */; }; - 433130E6F5F6ADD76FF8137412DE1CC5 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0347C28BA18EC7F68A5BFB129BB6BD98 /* Configuration.swift */; }; - 442F4B0E1CB45747A394F28298C56C39 /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB96088C8107BB39EF01E984039D8A0 /* OuterString.swift */; }; + 4417ABCFF958D02DF8E985AF534F7BCC /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2545A0BD077774D3CA3B35CFD1FE40 /* OuterComposite.swift */; }; 4458039943079C18B66FC8E07192B004 /* OperationQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24917B863385D1BB04A2303451C9E272 /* OperationQueueScheduler.swift */; }; 44722D2979B06E2738E4247E124C0D71 /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7269CAD149BFD0BE4D3B1CA43FE6424F /* ReplaySubject.swift */; }; 47A4C299DC0AF262F3B147BECA1716C0 /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6472AECA91A4E834A9AF15721BC6D569 /* AnonymousObserver.swift */; }; - 48828B8EF5A8A114E02744EF755861B1 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 48828B8EF5A8A114E02744EF755861B1 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F4C7EC001A7DAE883053BE9583EECF1 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4913653A4B5B249F7C112FDEB8E0CB9F /* AnonymousDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB186FED84E02D4539A7335A7D657AEB /* AnonymousDisposable.swift */; }; 4BEC58109676367D63BB38513BDE4E61 /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 463ABD4055AB6537A2C5B0EDB617C139 /* Cancelable.swift */; }; - 4E22260F68870F3F5B2CBABE055B30C3 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78512005DDEE4226A4CAC430BA81246F /* Cat.swift */; }; 4FE00C14C1F53B67BC42F1DFD7AEB134 /* DelaySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B939DC5892884F0418DD9231B1C333B /* DelaySubscription.swift */; }; + 4FE4C667BB96C218E29D53392D21AEC9 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3726BB3EDFF36AE68CFA5EFB3F8ADCF /* Extensions.swift */; }; 50524C5E1DB23EA18A06AAECFBF0EF6F /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C7C61BEED15998D9D7B47AD6F3E069D /* RecursiveLock.swift */; }; 50C8F042293151DF7160103359D24C19 /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F94DF516E7B950F928922C1D41C6D4D /* Never.swift */; }; - 510749288AC04924FCA3AAAD2C9CF882 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1328AA3B0C915CDCE647BD5BE5EE0B9 /* List.swift */; }; - 5177A8F28385B02A28B251F628D5BF9E /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEFE0D42E486B898D1D43EE1C0F96501 /* ClassModel.swift */; }; - 526B7E412BE480FEFA82C6875BFC208A /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EC9E951298DE2A9A773FF2F9D580C77 /* Fake_classname_tags123API.swift */; }; + 537747BEC46420B59A6E6404B55519E0 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CAB06DC6B0D4E914DE8355ABD73685 /* ArrayOfNumberOnly.swift */; }; 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = F57EA9DD77194E4F1E5E5E6CB4CDAE4E /* Request.swift */; }; 541ECA77541A6B87BEA04693733BDC6B /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAED6E7C8067874A040C7B3863732D73 /* Repeat.swift */; }; - 54F27D86602946D5B05FAA7815DF3C9D /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = A629F4D978DF923EE08DA27405E8B921 /* Animal.swift */; }; 558E7976032468B4B3290802329281BB /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 880C5FA0EC7B351BE64E748163FA1C31 /* PriorityQueue.swift */; }; + 5640D4D6568ED402D0789D4CE76CA707 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBBC3E633FF7A6EF8F18280770400F6E /* Animal.swift */; }; 58268455FBFAB2C66217240430A7DF92 /* SubjectType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18328C3FA1839793D455774B0473668C /* SubjectType.swift */; }; 5AFF43F00A5EF8C6D3A18198BC6B3A61 /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D497E96ABC5BEF4E26087D1F8D61D35E /* CompositeDisposable.swift */; }; 5BDE8CA34FCA4A007C7186DA5FD5A801 /* InvocableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CC0097103243FBF2702AB35BF7C0A4 /* InvocableType.swift */; }; 5C1C84AC7009B654DE4EC1677435B429 /* ShareReplay1WhileConnected.swift in Sources */ = {isa = PBXBuildFile; fileRef = 365AE864123C488FD72C61ADC9EC624D /* ShareReplay1WhileConnected.swift */; }; + 5D4EE628D324BC4A7EF5878364796DED /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C74872D21B74B20DED53ABF8CAF1C0A8 /* PetAPI.swift */; }; 5DEC0EEBF7176C7F8FF1207B01E39F3B /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFDFA640848914890DC3B2555740FF84 /* ConnectableObservableType.swift */; }; 605ADF93B7CEBEFB1E9B6ED64F279069 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A98136CD6F078204F8B95D995205F04 /* Disposable.swift */; }; + 609D36645D868B8D4B2175FF76785490 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = C24CAB582243A8ABBCDA17324B26EB57 /* Capitalization.swift */; }; 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DA0155598FD96A2BBFF3496F7380D93 /* DispatchQueue+Alamofire.swift */; }; 620D3D599A225398EDB5128038997704 /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB0A2EA86FF43E01E3D3ACE3BD2752B /* Optional.swift */; }; 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64AB42C9C8AA1EFF0761D23E6FEF4776 /* ServerTrustPolicy.swift */; }; - 63C3CC4A0625B4BE1959D5B6A1EC1B94 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3255087A708A0A56D2DC5C2A719BCDF /* OuterEnum.swift */; }; 647E4A693C240F1DCC36E18702CA22F2 /* Deferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = F119426570E6238D04EAB498E1902F13 /* Deferred.swift */; }; - 65987B3FECA58D1ED06F7056EEF6236E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12B50D9BCCC227D4BCE7093EB51FA7DE /* Return.swift */; }; + 670915CFD068A67AA6C01E7596315E4D /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = A844E504E62CB6AEA00B8DA3BAF7359B /* OuterNumber.swift */; }; 6755ED61C48BEFFAAB92F736C0118D84 /* ObserveOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC5B3446AD01BE42D27E9F1B9673C334 /* ObserveOn.swift */; }; - 67DF08DD80B5D58484F736D9AF26C18F /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC87EB1FDE1FA15565F929FD45E8F8DF /* Dog.swift */; }; - 686AA603B7707166FBAA28EBB562AADA /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = E38495D719155033404DC23C9A2E1A4C /* OuterComposite.swift */; }; 6882F5FF908C82E3BC550D5EDD5DC128 /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAE679F6024F9BDC9690AFE107798377 /* Window.swift */; }; 6899402E8FEA5BBBD5B4167868069E97 /* SchedulerServices+Emulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60544C2EB93D2C784EF3673B4BA12FAD /* SchedulerServices+Emulation.swift */; }; 68F02607B836CA98B2E3F69A29ABE456 /* VirtualTimeScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E721CFEFA8C057FD4766D5603B283218 /* VirtualTimeScheduler.swift */; }; 69E31A4B72F18870572A3D860D1DF5A5 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FCDAA2549A70BCA3749CF5FCCF837E9 /* Error.swift */; }; + 6A366BBAFAD2E0C249DF77A193516D52 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = A353DBED5E7E7B0EC48E7A4A4B5C5806 /* Category.swift */; }; + 6B266E73D0D76B5DFF4900963F3561FC /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EACCA67328F0A3AC89EA2158DAFC9B3A /* FormatTest.swift */; }; 6BF97EA13738721A7AB6387154BE8672 /* Zip+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B23F66A643FB8A1DEAC31DC3B637ACEB /* Zip+Collection.swift */; }; + 6C7806F381D2AC4D92A3C93986F18F82 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2DDCF83AFCDDE5126ED96168870FCB4 /* EnumArrays.swift */; }; 6E6191F60C604ACE4AD5B02F8D2407B3 /* MainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF8DBA8D803E5226616EC41FA7405ED /* MainScheduler.swift */; }; 7017FDF93D52934C6F558DFB677FE522 /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88515C2D0E31A4BB398381850BBA2A54 /* ObserverType.swift */; }; + 71AA7E64651C50855F1E8D6672A92A97 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E13D55B14894773A8FAECA0A7D37DE /* ClassModel.swift */; }; 71B9FE7CEAE97B22F7326A474DDAFF51 /* AddRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = A962E5C6DA31E53BA6DEFCE4F2BC34B8 /* AddRef.swift */; }; 72F37125F2F0F01BF47E5E3FA196F362 /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7737478C5B309559EBEB826D48D81C26 /* NopDisposable.swift */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; 744D8076BF0589E55B920CB1EDBAB734 /* PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D9BF77ECD45A0F08FB7892B9597B135 /* PrimitiveSequence.swift */; }; - 759C49C4AF0A68116FED5D2B91EAE6F0 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F7A032DE7EF2A9B4E1C3349C3339B7 /* FakeAPI.swift */; }; - 7709DD414A524588A144DE443610C3FD /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB7C99381BFC166AE1C8C46B66E6935 /* ApiResponse.swift */; }; 77B7D95462F0444B51629B77F40E353A /* RecursiveScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAE1A43C13EDE68CF0C6AEA7EA3A2521 /* RecursiveScheduler.swift */; }; 78F05FA712773066C65C7652F102892C /* AnonymousInvocable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83CF28DA7318DA2566376ACECE87D6E3 /* AnonymousInvocable.swift */; }; 79F35F2B656D39743899E74A96F80CE4 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB1413438046E9B3E8A94F51358A8205 /* Platform.Darwin.swift */; }; 79F64699E911193029E1D5471ADCA488 /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4FF38E4CA2AFB54D788C9F1919BFA8 /* ObservableType.swift */; }; + 79FE0B73A3F9EE4A7E0CACBB97650798 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A9FC90934F7A68C930C0F99508A737 /* User.swift */; }; + 7A2028722035DA3B8440147EE06D9F10 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85C133791E08589EB1DCDD30204E0D1 /* OuterEnum.swift */; }; 7A52D7C82439E940A3519511BB20A0C1 /* Take.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16B7B7BE1A379F72CFC27449A45EE5AE /* Take.swift */; }; 7A5F2C5E7D876A8765A1063B8536758E /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F847CE4C82EA73A82952D85A608F86AB /* DispatchQueueConfiguration.swift */; }; + 7B3A68DD690D4DC76D988FFDABA3A53C /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 365E9435D48E21D0C47AFA0FC453B002 /* UserAPI.swift */; }; 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7098927F58CDA88AF2F555BD54050500 /* SessionDelegate.swift */; }; + 7BFA5CE6E3698A79CE6269680DC4DAB3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; 7D5356806AA02F1EFC5F3C311DB63E80 /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77762B0005C750E84813994CE0075E3B /* DisposeBag.swift */; }; 7D6CCE326AAA99B1A2DA9C84E72C2ED6 /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B5F05AEF12013DFCBEBE433EEBB3C8F /* Rx.swift */; }; 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECB713449813E363ABB94C83D77F3A9 /* Result.swift */; }; 7E2750102B3F7BA21006DA3786D4FEDE /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B1C5A8AB9C095DD01A23DB6B7179E5C /* ConcurrentDispatchQueueScheduler.swift */; }; - 802B25F7F9BE8A9A8BF14B5B8500419F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; + 7E3483337526BAB8F018A0D3F4AB3301 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9270FF743FC000569F250E309CB89E /* APIs.swift */; }; 8247F2627BAC72EAA0C957B8882F1E3A /* Reduce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9E77B670AC48E19FB2C9FE2BD11E32 /* Reduce.swift */; }; 826B19A12F104BCE96210377CECB1797 /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30419C2A3E0EC1B15E0D3AF3D91FB15 /* ObservableType+Extensions.swift */; }; 84AA76C9E940EF23C4579B9CE71BE070 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */; }; @@ -126,74 +132,67 @@ 851B77C98ACB863EB896E1E4F2BC1837 /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9F0644CBB2BCA2DB969F16E2B5D92CE /* Throttle.swift */; }; 8532C2AADED94C7F02886B1B9C7B290B /* TakeWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61148633F9614B9AD57C5470C729902C /* TakeWhile.swift */; }; 8562F754DA6779830E215663770A8324 /* ShareReplay1.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7513ADBA4C19938F615442415D28732 /* ShareReplay1.swift */; }; - 8596FF7C15793C2BE30ED72657A722C0 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72D37DE9C6B404082FCF0C8386564789 /* Extensions.swift */; }; + 860E77C38C6A9E6F9C6DD4457119C4CE /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = E70ED98C12C528D9F88F8CF7A7E3E518 /* FakeAPI.swift */; }; 8762C28B6D2F2FA712859CE216EA75AC /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = D984AFE3BDFDD95C397A0D0F80DFECA6 /* Reactive.swift */; }; - 88F107B2F442369A48B94CE079CADF11 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C40576477EB5B6F3CA61283A3D3DC2 /* SpecialModelName.swift */; }; 8927C21953F14CBA4280C0D842EF7F97 /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA58F20D8C1234D395CD1165DC3690F3 /* AnyObserver.swift */; }; 895E052093A91F080FC5F7D96FAF9212 /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4313BF26CA6B25832E158F8FC403D849 /* Catch.swift */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; 89C85DE461A14206F7755EB3A32B8197 /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39A2B57F2DAE55FA57D315FDD6953365 /* Variable.swift */; }; 8A58D0AAB7B9BB46909105648C10693B /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = A45D3DB105B4381656B330C1B2B6301E /* Zip.swift */; }; 8AF09C038B23AC50B0FEAA59F71A9FD0 /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6887D641E8100CE8A13FFA165FC59B73 /* Observable.swift */; }; - 8C3A6A42AC6BD3A0C147E12B3EE27199 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 599E954C7FCD17BF4ECECF02C1249ABA /* NumberOnly.swift */; }; 8DB2E2E6A3028665B918CE6156E6D14A /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = C860BEC2AFE3C3670391CECBA2707574 /* Empty.swift */; }; - 8DBBDB1DAB3F820778447F938968ADE3 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279F457A02A5F05C1C513048A59EC8FF /* APIHelper.swift */; }; 8E2EFD0C6CDAF463C86336664605F955 /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59EA941CFCC415131D36B17780FA7F33 /* RxMutableBox.swift */; }; - 90CD3BB0624706A481D3EEA50DE6A00D /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68AE8E0718FFE9291FC66C0EB5441FD1 /* Capitalization.swift */; }; + 8F82AE7F51351B9E13D405006482FEE6 /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88877D161F2CFC94AEB9EC3A87DCE137 /* Fake_classname_tags123API.swift */; }; 91BCA631F516CB40742B0D2B1A211246 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; 92BE2CB715953E9F5045AD0E2D958CC4 /* Do.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB3FCE54551234A4F3910C33EB48C016 /* Do.swift */; }; 9394E57451C8F3C330109A51E1483CCB /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = E841A5E38033B35ED3073E4BBB921518 /* Disposables.swift */; }; 93D8A47EB2C424AAD343C7E5C3A5C93F /* StartWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = B77F93192159DCCC6CEF8FC5A0924F9A /* StartWith.swift */; }; - 953DE9669794F503CAAA4F1B0B166CE2 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 078CD337BBF933DB7D55A152DFF11AEB /* StoreAPI.swift */; }; 98660A76B52376A3D70B3F521728176D /* HistoricalScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C071467FD72C9E762BDC54865F1A4193 /* HistoricalScheduler.swift */; }; + 9BB27EC494EC7A1DE605C2F9C651EAC8 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC04CE09EBAD4D6F48048F82504397F4 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 9C5C95CBEBBF8ADB142C102234C396EC /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45DDB27E2A52C09D734190B2C3E83BF5 /* StoreAPI.swift */; }; 9D10DFE3C68E6C8E744001CF49CAE642 /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75DAC3F84E978269F03F6516EE7E9FAE /* DistinctUntilChanged.swift */; }; 9E0C80D55FB3B40455E6D85FC5543063 /* ObserverBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE04EA000FD69A9AF7258C56417D785 /* ObserverBase.swift */; }; 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7728F2E75E01542A06BFA62D24420ADB /* AFError.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; - A110620E31B25C0FF43FD7DD5E9E5E15 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0C909F84199ABBB040797658A665B /* OuterNumber.swift */; }; A1240A21E7B537453B116F2BAD730FBB /* Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CBCC23A46623376CB1616C1C121603D /* Timeout.swift */; }; + A26C90236BB15DB7900521CC97C4F1D6 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80C1B1AFFC108C1C4EC607179620DD8 /* Cat.swift */; }; A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4668C7356C845C883E13EAB41F34154 /* NetworkReachabilityManager.swift */; }; - A2ABE4DA0B7DB062BA3114D1550A2E7D /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA681327FF596AFD3B758BD16ED8AD12 /* Model200Response.swift */; }; - A2FA29BDF6B44B64D23DDD4FD0CA487E /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - A3508B5B8F1C327C2AAEA79FBDBD2AD8 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63892157E6A5B54321974F619C1C74A4 /* EnumClass.swift */; }; A37E6CFD18F2FBD9E7F921BE64516410 /* CombineLatest+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B5A2A541FCAB86964565123DAF4719 /* CombineLatest+Collection.swift */; }; A43177FC0E6314931FEF78D804F7A5A0 /* BooleanDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6D35FB8DCCEAAD8DC223CD5BC95E99 /* BooleanDisposable.swift */; }; - A6B3140D43833D41246C9EC8A02544E3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B8157356A6AE7F892F5F0FB322B7510 /* Models.swift */; }; + A56413C6A12B1D2F50BF5461C2849DB9 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48144D6C24CA10B6A3584D425416F37A /* SpecialModelName.swift */; }; A738D49AC9C1C91E616EBB69E90C34FE /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C367D19B8DD4C0F9954A24DD5A2A6AFB /* SerialDisposable.swift */; }; + A7C5CF056E08D8CF885F5A923F8A7655 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; A81EEE957FDA65C14FE55CBF2BBDC937 /* LockOwnerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72730856B78AF39AB4D248DDA7771A5B /* LockOwnerType.swift */; }; - A84528A62CB64590B2827841B2464E7E /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03DA799556B50E85F1141C4E2941FCC5 /* User.swift */; }; + A82A9149306EF4D972CCDEBE265B37F2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; + A95E05FA3760CAA9BD09D1DA2E63C1C7 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 213681FAAEF7EA349FE2EB13483D4CE0 /* AnimalFarm.swift */; }; A9D66665CAD0759B39F1F7B8BDDB40AF /* BinaryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 510BB12F1D8076F5BA1888E67E121E79 /* BinaryDisposable.swift */; }; A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F9CD1F74BF087D277406BF9164B9D058 /* Alamofire-dummy.m */; }; - AAC9A6049EBB4C7E897F06F5AA653AC0 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2703D7A31059043BE2D013A096C8514 /* ArrayOfArrayOfNumberOnly.swift */; }; - ACEB8953D68D199AD6E0968D6ED11BCD /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 590873A848A323526E77969A48236628 /* Tag.swift */; }; + AC5EA05CC3AB722B8FAFA500AE9AE14D /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2988432DEBFCFD8A5F5F0E2A220A8E /* List.swift */; }; AE183CF99826B88B9409460FFF6D7DA9 /* Producer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CCE606004614C138E5498F58AA0D8DF /* Producer.swift */; }; AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 321FE523C25A0EAF6FF886D6FDE6D24D /* SessionManager.swift */; }; AE299B219B7029799F4E859488B2A65C /* Skip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7011CBC583696921D4186C6121A7F67F /* Skip.swift */; }; B0FF886BA53B7E0856F8BE9B30B58D71 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7677FD01A3CD0014041B75BD92F6D97 /* Switch.swift */; }; - B1E93AC38EE125ED28E0F65C24F3CF4E /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02116EF9AA682F86771D7A0EC2C8D31 /* ArrayTest.swift */; }; B225D1FD8A326EB19114D8F295AF2431 /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA4F47C5A2E55E47E45F95C0672F0820 /* AsyncLock.swift */; }; - B33DD030E58293B740E39FB0006CB56F /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CCD3D06407423C18753CDF829B3751B /* ReadOnlyFirst.swift */; }; B49A7BC55758A8FD4C1B6C0D1E6BD5E4 /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = F104D45199031F05FCEEFA8E947F210E /* String+Rx.swift */; }; B5294D873A7C90C77A5FC6BA24C80BC4 /* BehaviorSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FE676DC3C01D76D82723E22A695A308 /* BehaviorSubject.swift */; }; + B55EB691D0BA0B3A7B30B397735B8C45 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3FD0F9796D0E174012697BE40B68BF /* Configuration.swift */; }; B562A927F1447725C696075D18A000E8 /* RefCountDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31DC6B167D2D13AFD8EAAF1E63021B52 /* RefCountDisposable.swift */; }; - B60370C99B46DA380B57C60F47E40581 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0AFF30E90AACB8750FD39A9976E6E7 /* HasOnlyReadOnly.swift */; }; B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA42FD2B1F921714FC4FEABAFB8D190A /* MultipartFormData.swift */; }; + B7E707ED3304DC2880A70A648405C3F4 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6E0B4B99BC9F44A670C49699492A9FE /* Order.swift */; }; + B8B06AE345D2EDFAADBA24DE5B9F9E8F /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = A48E3D95D5FE201A1BC906340E5BA25C /* OuterString.swift */; }; B96B42A1676C1B43E7E9D7AC8BE2B6D7 /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1F0B7854DD41D311F76522F61203F7F /* Sequence.swift */; }; - BB0B398A709DABBED7B4B9BAA3601585 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0528EC401C03A7544A658C38016A893 /* Validation.swift */; }; - BC4FBAF0A7DDBC841EE1F0C224F66EAA /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6847583F43C5149C306FEA14B59ACAE /* EnumTest.swift */; }; - BD4A3DC001CA9307DC25026055FCC3FC /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F8141809C5EBF896875D5A0D398AEC /* APIs.swift */; }; BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F69F88B1008A9EE1DDF85CBC79677A8 /* ParameterEncoding.swift */; }; BEA978738EF7DCA94F7B3C190FD11E6B /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F067CE8E1D793F3477FF78E26651CDB /* GroupBy.swift */; }; BF2C7E37667C7124C9B28A2DCE81870B /* Multicast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59E44229281B70ACA538454D8DB49FC0 /* Multicast.swift */; }; - BFC1F306440D496DCDAE34DAB229EAF9 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = F242145721D8A291FA20AA5D610E73BA /* Name.swift */; }; C0784BB732755A6A13BCFFE7CD7662B9 /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = DACA1956515F0B0CED7487724276C51B /* Lock.swift */; }; - C1479CDE82B9A38CC6754B5F6A2ACCA7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3E717317D46819E6BA262622A2B2090 /* Order.swift */; }; - C27DE83CDF87C91892F8D6BAC74EB3DB /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B0714A7CE3DFCBCC702F6279D146A4 /* AnimalFarm.swift */; }; + C18B62BC2701E2D05B1352515F91A5C1 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 911C6A3C96205B93025F13FBCA992687 /* Tag.swift */; }; C532982400133E7580724ADF30551965 /* Concat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 287F0ED0B2D6A3F3220B6F4E92A7F350 /* Concat.swift */; }; - C5AD393D58E9938EDEE3704EA376B1D7 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE56DF77148E9F1F9F1FB46D3B62377B /* OuterBoolean.swift */; }; + C58B42EA7B120CFDA0D45ED69CC347FD /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D8133C1AF527695DF9F34BEBFBAD4CB /* ArrayOfArrayOfNumberOnly.swift */; }; C7D96CE5C9E8C426F0A4E23201D71897 /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B782CE63F4EDE0F2FE5908E009D66D3 /* ConcurrentMainScheduler.swift */; }; + C7EBEDBD417428925528DC9BE13C3CD5 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD5077A09F9E9D3CA4F4FA368889BB02 /* ArrayTest.swift */; }; C820F2E6B25335D6288388FA5FD21F39 /* WithLatestFrom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A07BFAFDAB02F19561FDA4115668F66 /* WithLatestFrom.swift */; }; + C88D778A956F43A56BA03D6D8CBFDCE5 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 100C86AE9F32218EF6A633C7B7895CCC /* OuterBoolean.swift */; }; + C93468AFEE47CED3CF2C9EE43647369E /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78926FAD7615329921AC6B3E036268E /* APIHelper.swift */; }; CAFED669A4C8B0AE6DA35F45CE1D71BC /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = C541B03ABB2F0F5E10F027D5E3C9DF4B /* Just.swift */; }; CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF7CAA870676F2440AC2CCFC5A522F6C /* Response.swift */; }; CB9B0ED17EF239AEBD38EADE3ECDD377 /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883F8BF59AD1E1C16492B6CA9A82FB3D /* ImmediateSchedulerType.swift */; }; @@ -203,15 +202,17 @@ CEE7C773476EC0FD247E202637C84861 /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B258A9C347C516AA8D8A3FB2CD665D6D /* SchedulerType.swift */; }; D18EB5C2A679A80B7AE777522A469B82 /* RxSwift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 36918AB1CF9222600ABF5A21CBEDEAAC /* RxSwift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; D237954312B88EAF4DDB292F498C65E7 /* DefaultIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E29B89A0BDB135B2088F4F20D14F46 /* DefaultIfEmpty.swift */; }; + D285D4EB606DA906E58F886325157E7A /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016E5F3C3DA72BE3740A226E72B26933 /* NumberOnly.swift */; }; D2ECEB1A744E6AB4EB03988D8FB6E029 /* ConnectableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AC613DA00AD0B2ACF145E94AED80E86 /* ConnectableObservable.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE307308EA13685E2F9959277D7E355A /* Foundation.framework */; }; D9E153A5494E897ACF92A0D54873E3CA /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0668A90FD8DFEB8D178EE6721979B788 /* ElementAt.swift */; }; - DCD7BB46F54AF60D765009343633DB34 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BC9EFADA42C0213743B8D3108D2AA75 /* UserAPI.swift */; }; + DB1674B5221497F0781506BC3D3DB14D /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D2F69F61823A75B9D3A37C6EA502AB9 /* AdditionalPropertiesClass.swift */; }; DDCECA86BA5EA0402D24F995BA009730 /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA3E73A8C322E8F93F432A4821A988DD /* CombineLatest.swift */; }; DE82657C3F2C8448F284C22F24ED66D5 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E3BEFA00C2C7854A37F845BF40B59F4 /* SkipWhile.swift */; }; + DECDCFF8F77B285B8E565E1F3D759D86 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE38C38CB1C97603C0C7266A3B45F2AC /* AlamofireImplementations.swift */; }; DFDFDB3E1FC7EA20EDD5BD50F3FD8982 /* RetryWhen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F9DE8CE4FBC650CD1C45E4D55A76AB /* RetryWhen.swift */; }; E103DB3EB5359F4FE898B24CB6C1FCA6 /* VirtualTimeConverterType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 772DB63372E4253C20C516EBF68DD251 /* VirtualTimeConverterType.swift */; }; E67B1B718006058F330F898B17D8E790 /* PrimitiveSequence+Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269E63D0B9C1F5552DF3ABA3F5BF88EB /* PrimitiveSequence+Zip+arity.swift */; }; + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; E9DBC7D8412FCFEB52E4FBC1BAF0A3BB /* AsMaybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = A222C21465FACA23A74CB83AA9A51FF9 /* AsMaybe.swift */; }; EBC209AC9E49B6748B6C92985F4288A6 /* CombineLatest+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF6AF4017DB31B86B803FEA577F7A22 /* CombineLatest+arity.swift */; }; EE4A6BADF6A7164008D832EDD87FEED6 /* Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A96069F19C031BE285BF982214ABCB4 /* Create.swift */; }; @@ -219,18 +220,17 @@ EF0932F6037779CBEFA7914E034EA345 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5017E276F3AE00F1F45A62F9A35F51C0 /* InfiniteSequence.swift */; }; EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64082BE2455C7B840B138508D24C0B0C /* Notifications.swift */; }; F01964782FE633EB69390B3F433D7C64 /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FF46ACE1C78929AB44803AE915B394F /* Debug.swift */; }; + F03314F98A25C519B11F849BC7A325D0 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03F1F9E6E7C4A8537A517AD7A19AF471 /* EnumClass.swift */; }; F35ACF9966EDC4459F3FEF1913904AF5 /* SingleAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 805F15552659D5E233243B40C0C6F028 /* SingleAsync.swift */; }; - F40669C1C229D78C2DD3112880D60C1E /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53BB654DDCD6F1CF9FD0EEB09EB70F76 /* Pet.swift */; }; F49B8D0ACCA99304CA948C03F9849C4C /* SynchronizedOnType.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9178D3690ADCB4F8C9057F81C073A45 /* SynchronizedOnType.swift */; }; - F5A3ED1D316DBEC092A7CEC07130866B /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB83B104D9DB76F5DAB8D5C25F1987D /* PetAPI.swift */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1FCD92EC4EAB245624BBB2DDECF9B2C /* ResponseSerialization.swift */; }; F70C9E990861723D8B1785BD76D76353 /* SwitchIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4EEA393253D8586EB38190FC649A3FA /* SwitchIfEmpty.swift */; }; F79B8F1D869B9F255166AACBE92AC569 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5FE55155242FEDEC1B330C78429337F /* Bag.swift */; }; F8728CCDE6AD8408BFD6F9C612A7B116 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 821702C06296B57D769A8DCDD13DE971 /* Errors.swift */; }; F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6489C0664BA4C768FBB891CF9DF2CFD1 /* Alamofire.swift */; }; FA7E218FB106CAAA4F223D5EAD85B651 /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11316F7A1A5EB2E5B756703C0EE77CF6 /* TailRecursiveSink.swift */; }; - FB6ADAF415D6C6260BDE4EF13A89A87E /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 080866A4EA877817F1AA94B0C72201D6 /* AdditionalPropertiesClass.swift */; }; FD6E37C6BDBAAED7F2B7076C8DD48010 /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26CDF11A8572688E0011727ADD962B74 /* Timer.swift */; }; + FE117050A9DD8D8B7B10768B97070C9F /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = AACF3F3D813203894318A8EB451E126A /* Dog.swift */; }; FE9C72CF6913B5204B794AFA0BC44DB1 /* HistoricalSchedulerTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 870EAFD138EAD59EAC7EE2CE19DE25B4 /* HistoricalSchedulerTimeConverter.swift */; }; FEDEC41FE3E34FB114D871C645951310 /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = B80609FF38FDE35E5FE2D38886D2361F /* SubscribeOn.swift */; }; FEF6B9251547131BEC87C78EC07E5A04 /* Materialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D34B07FCD98BCADAA8A3B68F1ACF1E /* Materialize.swift */; }; @@ -276,19 +276,18 @@ /* Begin PBXFileReference section */ 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 016E5F3C3DA72BE3740A226E72B26933 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 0347C28BA18EC7F68A5BFB129BB6BD98 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 03DA799556B50E85F1141C4E2941FCC5 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 03F1F9E6E7C4A8537A517AD7A19AF471 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 0668A90FD8DFEB8D178EE6721979B788 /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/ElementAt.swift; sourceTree = ""; }; - 078CD337BBF933DB7D55A152DFF11AEB /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 080866A4EA877817F1AA94B0C72201D6 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 08A9FC90934F7A68C930C0F99508A737 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 09CF571E27DC65BF77EFFF62354B5EF0 /* Debounce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debounce.swift; path = RxSwift/Observables/Debounce.swift; sourceTree = ""; }; 0AF6AF4017DB31B86B803FEA577F7A22 /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/CombineLatest+arity.swift"; sourceTree = ""; }; 0B6D35FB8DCCEAAD8DC223CD5BC95E99 /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; 0BED5103BCF9D40F85068CF32B24A63E /* Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Event.swift; path = RxSwift/Event.swift; sourceTree = ""; }; + 100C86AE9F32218EF6A633C7B7895CCC /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 11316F7A1A5EB2E5B756703C0EE77CF6 /* TailRecursiveSink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TailRecursiveSink.swift; path = RxSwift/Observers/TailRecursiveSink.swift; sourceTree = ""; }; - 12B50D9BCCC227D4BCE7093EB51FA7DE /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; 14E29B89A0BDB135B2088F4F20D14F46 /* DefaultIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultIfEmpty.swift; path = RxSwift/Observables/DefaultIfEmpty.swift; sourceTree = ""; }; 15F7B4D89DB784C462A959824F1E698C /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionDisposable.swift; path = RxSwift/Disposables/SubscriptionDisposable.swift; sourceTree = ""; }; 16B7B7BE1A379F72CFC27449A45EE5AE /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Take.swift; sourceTree = ""; }; @@ -297,40 +296,44 @@ 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1A3D311EA38EC997A02CB05BACC0DD7D /* SingleAssignmentDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAssignmentDisposable.swift; path = RxSwift/Disposables/SingleAssignmentDisposable.swift; sourceTree = ""; }; 1C897A93D54D11502C0795F3D0F8510F /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/SkipUntil.swift; sourceTree = ""; }; - 1DB83B104D9DB76F5DAB8D5C25F1987D /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 213681FAAEF7EA349FE2EB13483D4CE0 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; 24917B863385D1BB04A2303451C9E272 /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OperationQueueScheduler.swift; path = RxSwift/Schedulers/OperationQueueScheduler.swift; sourceTree = ""; }; 269E63D0B9C1F5552DF3ABA3F5BF88EB /* PrimitiveSequence+Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PrimitiveSequence+Zip+arity.swift"; path = "RxSwift/Traits/PrimitiveSequence+Zip+arity.swift"; sourceTree = ""; }; 26CDF11A8572688E0011727ADD962B74 /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Timer.swift; sourceTree = ""; }; - 279F457A02A5F05C1C513048A59EC8FF /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 27B0714A7CE3DFCBCC702F6279D146A4 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; 287F0ED0B2D6A3F3220B6F4E92A7F350 /* Concat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Concat.swift; path = RxSwift/Observables/Concat.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; 2AF9D1F5A21CB847E913BF41EC110B1F /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; - 2BC9EFADA42C0213743B8D3108D2AA75 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 2CC7A4A0D213AA0C7831EA91E658003C /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; 30436E554B573E5078213F681DA0061F /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableScheduledItem.swift; path = RxSwift/Schedulers/Internal/InvocableScheduledItem.swift; sourceTree = ""; }; 31DC6B167D2D13AFD8EAAF1E63021B52 /* RefCountDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCountDisposable.swift; path = RxSwift/Disposables/RefCountDisposable.swift; sourceTree = ""; }; 321FE523C25A0EAF6FF886D6FDE6D24D /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; 32C44C9A30733440A3D263B43861FBA1 /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; 33E7362EED7450FC886B01AB15E22681 /* Dematerialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Dematerialize.swift; path = RxSwift/Observables/Dematerialize.swift; sourceTree = ""; }; + 34CAB06DC6B0D4E914DE8355ABD73685 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; 365AE864123C488FD72C61ADC9EC624D /* ShareReplay1WhileConnected.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplay1WhileConnected.swift; path = RxSwift/Observables/ShareReplay1WhileConnected.swift; sourceTree = ""; }; + 365E9435D48E21D0C47AFA0FC453B002 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 36918AB1CF9222600ABF5A21CBEDEAAC /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; 37CEC3599B3E7B7EB3DA8FBA9610E255 /* ToArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToArray.swift; path = RxSwift/Observables/ToArray.swift; sourceTree = ""; }; 39A2B57F2DAE55FA57D315FDD6953365 /* Variable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Variable.swift; path = RxSwift/Subjects/Variable.swift; sourceTree = ""; }; 3A07BFAFDAB02F19561FDA4115668F66 /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/WithLatestFrom.swift; sourceTree = ""; }; 3B1C5A8AB9C095DD01A23DB6B7179E5C /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentDispatchQueueScheduler.swift; path = RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift; sourceTree = ""; }; + 3C2545A0BD077774D3CA3B35CFD1FE40 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 3C2988432DEBFCFD8A5F5F0E2A220A8E /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 3D2F69F61823A75B9D3A37C6EA502AB9 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 3D9270FF743FC000569F250E309CB89E /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/Swaggers/APIs.swift; sourceTree = ""; }; 3ECB713449813E363ABB94C83D77F3A9 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3F1C7AD0D97D1F541A20DEDFD5AC30AF /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; 4313BF26CA6B25832E158F8FC403D849 /* Catch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Catch.swift; path = RxSwift/Observables/Catch.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 4611AE0764EA3CE44DAB9AE6853897A8 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + 45DDB27E2A52C09D734190B2C3E83BF5 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 463ABD4055AB6537A2C5B0EDB617C139 /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 48144D6C24CA10B6A3584D425416F37A /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; 48242CA8E564C2C50CFF8E3E77668FB7 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; 48E60FBF9296448D4A2FEC7E14FBE6DB /* ScheduledDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledDisposable.swift; path = RxSwift/Disposables/ScheduledDisposable.swift; sourceTree = ""; }; - 49C40576477EB5B6F3CA61283A3D3DC2 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; 4AF8DBA8D803E5226616EC41FA7405ED /* MainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MainScheduler.swift; path = RxSwift/Schedulers/MainScheduler.swift; sourceTree = ""; }; 4EACF73E072E466AF5911B9BB191E174 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/TakeLast.swift; sourceTree = ""; }; 4F69F88B1008A9EE1DDF85CBC79677A8 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; @@ -339,12 +342,10 @@ 5017E276F3AE00F1F45A62F9A35F51C0 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; 503A5FA54C11AE46D3333E6080D61E9A /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = RxSwift.modulemap; sourceTree = ""; }; 510BB12F1D8076F5BA1888E67E121E79 /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; - 53BB654DDCD6F1CF9FD0EEB09EB70F76 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; 56CC0097103243FBF2702AB35BF7C0A4 /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; - 590873A848A323526E77969A48236628 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 590A7488E9B89273069B539F03421606 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; 596A0129DA8C10F8A3BEECED9EE16F68 /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Buffer.swift; sourceTree = ""; }; - 599E954C7FCD17BF4ECECF02C1249ABA /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; 59E44229281B70ACA538454D8DB49FC0 /* Multicast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Multicast.swift; path = RxSwift/Observables/Multicast.swift; sourceTree = ""; }; 59EA941CFCC415131D36B17780FA7F33 /* RxMutableBox.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxMutableBox.swift; path = RxSwift/RxMutableBox.swift; sourceTree = ""; }; 5A98136CD6F078204F8B95D995205F04 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = RxSwift/Disposable.swift; sourceTree = ""; }; @@ -355,11 +356,11 @@ 5B5F05AEF12013DFCBEBE433EEBB3C8F /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; 5D641B399A74F0F9D45B05F8D357C806 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; 5E047D08FB3120A3AFA0DF05CCC1712A /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; + 5F379571B66704590E35A4719E6769F9 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 5FA4778A42883943FE99141A948880BE /* Scan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scan.swift; path = RxSwift/Observables/Scan.swift; sourceTree = ""; }; 60544C2EB93D2C784EF3673B4BA12FAD /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; 61148633F9614B9AD57C5470C729902C /* TakeWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeWhile.swift; path = RxSwift/Observables/TakeWhile.swift; sourceTree = ""; }; 62F9DE8CE4FBC650CD1C45E4D55A76AB /* RetryWhen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RetryWhen.swift; path = RxSwift/Observables/RetryWhen.swift; sourceTree = ""; }; - 63892157E6A5B54321974F619C1C74A4 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; 63A236E8B385B46BC8C1268A38CCBDE5 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxSwift/Deprecated.swift; sourceTree = ""; }; 64082BE2455C7B840B138508D24C0B0C /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; 6472AECA91A4E834A9AF15721BC6D569 /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; @@ -368,9 +369,8 @@ 65518CF96489DBA6322987069B264467 /* TakeUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeUntil.swift; path = RxSwift/Observables/TakeUntil.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; 6887D641E8100CE8A13FFA165FC59B73 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; - 68AE8E0718FFE9291FC66C0EB5441FD1 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + 69AC2285C925A617C06C7FB2086BAA68 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; 6A96069F19C031BE285BF982214ABCB4 /* Create.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Create.swift; path = RxSwift/Observables/Create.swift; sourceTree = ""; }; - 6B8157356A6AE7F892F5F0FB322B7510 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; 6BE16D6C9576956764F467AFD25183DC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6C32D4D3484C860B70069CD1C629F666 /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; 6CBCC23A46623376CB1616C1C121603D /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Timeout.swift; sourceTree = ""; }; @@ -381,13 +381,11 @@ 726381CBB76FD8C7554573BCD08F831E /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; 7269CAD149BFD0BE4D3B1CA43FE6424F /* ReplaySubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ReplaySubject.swift; path = RxSwift/Subjects/ReplaySubject.swift; sourceTree = ""; }; 72730856B78AF39AB4D248DDA7771A5B /* LockOwnerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LockOwnerType.swift; path = RxSwift/Concurrency/LockOwnerType.swift; sourceTree = ""; }; - 72D37DE9C6B404082FCF0C8386564789 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 75DAC3F84E978269F03F6516EE7E9FAE /* DistinctUntilChanged.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DistinctUntilChanged.swift; path = RxSwift/Observables/DistinctUntilChanged.swift; sourceTree = ""; }; 7728F2E75E01542A06BFA62D24420ADB /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; 772DB63372E4253C20C516EBF68DD251 /* VirtualTimeConverterType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeConverterType.swift; path = RxSwift/Schedulers/VirtualTimeConverterType.swift; sourceTree = ""; }; 7737478C5B309559EBEB826D48D81C26 /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; 77762B0005C750E84813994CE0075E3B /* DisposeBag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBag.swift; path = RxSwift/Disposables/DisposeBag.swift; sourceTree = ""; }; - 78512005DDEE4226A4CAC430BA81246F /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; 7A9E77B670AC48E19FB2C9FE2BD11E32 /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Reduce.swift; sourceTree = ""; }; 7AC7E0F67AECA3C1CBDBF7BC409CDADC /* GroupedObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupedObservable.swift; path = RxSwift/GroupedObservable.swift; sourceTree = ""; }; 7B70F2B6C174F1E6C285A5F774C3C97E /* SynchronizedSubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedSubscribeType.swift; path = RxSwift/Concurrency/SynchronizedSubscribeType.swift; sourceTree = ""; }; @@ -395,8 +393,8 @@ 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7D9BF77ECD45A0F08FB7892B9597B135 /* PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PrimitiveSequence.swift; path = RxSwift/Traits/PrimitiveSequence.swift; sourceTree = ""; }; 7E3BEFA00C2C7854A37F845BF40B59F4 /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/SkipWhile.swift; sourceTree = ""; }; + 7F4C7EC001A7DAE883053BE9583EECF1 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; 7FCDAA2549A70BCA3749CF5FCCF837E9 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Error.swift; sourceTree = ""; }; - 80315B443694B2EC8CCF76D4FABE028D /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; 805F15552659D5E233243B40C0C6F028 /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/SingleAsync.swift; sourceTree = ""; }; 80AD53E4312C3B362D3336BDC9D80A80 /* AsyncSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncSubject.swift; path = RxSwift/Subjects/AsyncSubject.swift; sourceTree = ""; }; 80C18B1881A0F511B8D6DDA77F355B51 /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = RxSwift/Observables/Range.swift; sourceTree = ""; }; @@ -405,121 +403,124 @@ 83CF28DA7318DA2566376ACECE87D6E3 /* AnonymousInvocable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousInvocable.swift; path = RxSwift/Schedulers/Internal/AnonymousInvocable.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 85F7A032DE7EF2A9B4E1C3349C3339B7 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 86B5A2A541FCAB86964565123DAF4719 /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; 870EAFD138EAD59EAC7EE2CE19DE25B4 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; 880C5FA0EC7B351BE64E748163FA1C31 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; 883F8BF59AD1E1C16492B6CA9A82FB3D /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; 88515C2D0E31A4BB398381850BBA2A54 /* ObserverType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverType.swift; path = RxSwift/ObserverType.swift; sourceTree = ""; }; - 8EC9E951298DE2A9A773FF2F9D580C77 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 88877D161F2CFC94AEB9EC3A87DCE137 /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 89E13D55B14894773A8FAECA0A7D37DE /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 8D8133C1AF527695DF9F34BEBFBAD4CB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; 8F94DF516E7B950F928922C1D41C6D4D /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; + 911C6A3C96205B93025F13FBCA992687 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 939E73AB843F47D6C9EA0D065BAF63FC /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Map.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 93D2B184ED95D52B41994F4AA9D93A6C /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; 9675783D8A4B72DF63BAA2050C4E5659 /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 96F8141809C5EBF896875D5A0D398AEC /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; 99787387CBF8F606AB2284B149518528 /* RxSwift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-prefix.pch"; sourceTree = ""; }; 9B782CE63F4EDE0F2FE5908E009D66D3 /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentMainScheduler.swift; path = RxSwift/Schedulers/ConcurrentMainScheduler.swift; sourceTree = ""; }; 9B939DC5892884F0418DD9231B1C333B /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/DelaySubscription.swift; sourceTree = ""; }; + 9B9FC0446DF4BE1DB94CBC0AB085954E /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; 9BE04EA000FD69A9AF7258C56417D785 /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; 9BEFD5C825FC7E42B492A86160C4B4D9 /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; - 9CCD3D06407423C18753CDF829B3751B /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 9E8814B64707AA238E44CC6739648D2B /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 9F067CE8E1D793F3477FF78E26651CDB /* GroupBy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupBy.swift; path = RxSwift/Observables/GroupBy.swift; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + 9F3FD0F9796D0E174012697BE40B68BF /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/Swaggers/Configuration.swift; sourceTree = ""; }; A222C21465FACA23A74CB83AA9A51FF9 /* AsMaybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsMaybe.swift; path = RxSwift/Observables/AsMaybe.swift; sourceTree = ""; }; + A2DDCF83AFCDDE5126ED96168870FCB4 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + A353DBED5E7E7B0EC48E7A4A4B5C5806 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; A45D3DB105B4381656B330C1B2B6301E /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Zip.swift; sourceTree = ""; }; - A5F0C909F84199ABBB040797658A665B /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; - A629F4D978DF923EE08DA27405E8B921 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + A48E3D95D5FE201A1BC906340E5BA25C /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; A6635256007E4FB66691FA58431C5B23 /* Amb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Amb.swift; path = RxSwift/Observables/Amb.swift; sourceTree = ""; }; - A8CA3F9326583E57838201C8F5288BB2 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + A844E504E62CB6AEA00B8DA3BAF7359B /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; A962E5C6DA31E53BA6DEFCE4F2BC34B8 /* AddRef.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AddRef.swift; path = RxSwift/Observables/AddRef.swift; sourceTree = ""; }; AA42FD2B1F921714FC4FEABAFB8D190A /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AE307308EA13685E2F9959277D7E355A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + AACF3F3D813203894318A8EB451E126A /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + AD5077A09F9E9D3CA4F4FA368889BB02 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + ADF7C6067B822BBAD3F14822D1B1CC81 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AFDFA640848914890DC3B2555740FF84 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; B1F0B7854DD41D311F76522F61203F7F /* Sequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sequence.swift; path = RxSwift/Observables/Sequence.swift; sourceTree = ""; }; B23F66A643FB8A1DEAC31DC3B637ACEB /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Zip+Collection.swift"; sourceTree = ""; }; B258A9C347C516AA8D8A3FB2CD665D6D /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; B34B9F812BB8C50E3EA28F4FB51A1095 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; B34E08DA58315FFF5FCCF17FBA995360 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B4644DAD437464D93509A585F99B235E /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; B4EEA393253D8586EB38190FC649A3FA /* SwitchIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwitchIfEmpty.swift; path = RxSwift/Observables/SwitchIfEmpty.swift; sourceTree = ""; }; B7677FD01A3CD0014041B75BD92F6D97 /* Switch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Switch.swift; path = RxSwift/Observables/Switch.swift; sourceTree = ""; }; B77F93192159DCCC6CEF8FC5A0924F9A /* StartWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StartWith.swift; path = RxSwift/Observables/StartWith.swift; sourceTree = ""; }; B80609FF38FDE35E5FE2D38886D2361F /* SubscribeOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscribeOn.swift; path = RxSwift/Observables/SubscribeOn.swift; sourceTree = ""; }; + B85C133791E08589EB1DCDD30204E0D1 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + B88AB92BE71D793E0172BDB03CBBAA1E /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; BA58F20D8C1234D395CD1165DC3690F3 /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; BB1413438046E9B3E8A94F51358A8205 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - BBB7C99381BFC166AE1C8C46B66E6935 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + BBBC3E633FF7A6EF8F18280770400F6E /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; BC5B3446AD01BE42D27E9F1B9673C334 /* ObserveOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOn.swift; path = RxSwift/Observables/ObserveOn.swift; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; BFBD0B4CB17B692257A69160584B0895 /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Zip+arity.swift"; sourceTree = ""; }; C0141EB6EAA64B81BBA6C558E75FE6A3 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; C0528EC401C03A7544A658C38016A893 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; C071467FD72C9E762BDC54865F1A4193 /* HistoricalScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalScheduler.swift; path = RxSwift/Schedulers/HistoricalScheduler.swift; sourceTree = ""; }; + C1A02E1847AE8F11E47BE4161FCABFA7 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; C1FCEDB728FD2060B1A8C36A71039328 /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Merge.swift; sourceTree = ""; }; - C2703D7A31059043BE2D013A096C8514 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - C2CEFB4563AAF003750C502652064250 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + C24CAB582243A8ABBCDA17324B26EB57 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; C30419C2A3E0EC1B15E0D3AF3D91FB15 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; - C3255087A708A0A56D2DC5C2A719BCDF /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; C367D19B8DD4C0F9954A24DD5A2A6AFB /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; + C3BBD18F117F47C44487A0FB4650EF0D /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; C541B03ABB2F0F5E10F027D5E3C9DF4B /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Just.swift; sourceTree = ""; }; + C6E0B4B99BC9F44A670C49699492A9FE /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + C74872D21B74B20DED53ABF8CAF1C0A8 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + C78926FAD7615329921AC6B3E036268E /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/Swaggers/APIHelper.swift; sourceTree = ""; }; C860BEC2AFE3C3670391CECBA2707574 /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Empty.swift; sourceTree = ""; }; CA3E73A8C322E8F93F432A4821A988DD /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/CombineLatest.swift; sourceTree = ""; }; CB186FED84E02D4539A7335A7D657AEB /* AnonymousDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousDisposable.swift; path = RxSwift/Disposables/AnonymousDisposable.swift; sourceTree = ""; }; CB3FCE54551234A4F3910C33EB48C016 /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Do.swift; sourceTree = ""; }; - CDB96088C8107BB39EF01E984039D8A0 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; - D1328AA3B0C915CDCE647BD5BE5EE0B9 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + CB5ABAF432E141A4D578C1ECEA8D3D06 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/Swaggers/Models.swift; sourceTree = ""; }; + CC04CE09EBAD4D6F48048F82504397F4 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; D14A5F119805F0FCFCC8C1314040D871 /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Delay.swift; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; + D2AD7DFB58BCC2F73ADF9157DD2BA644 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + D3726BB3EDFF36AE68CFA5EFB3F8ADCF /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = ""; }; D497E96ABC5BEF4E26087D1F8D61D35E /* CompositeDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompositeDisposable.swift; path = RxSwift/Disposables/CompositeDisposable.swift; sourceTree = ""; }; + D5D46171F3DE7355BBDB8A0594675BB4 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; D5FE55155242FEDEC1B330C78429337F /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - D6847583F43C5149C306FEA14B59ACAE /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; - D756CC001719820E35D7EDC74440A99A /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + D80C1B1AFFC108C1C4EC607179620DD8 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; D984AFE3BDFDD95C397A0D0F80DFECA6 /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; DACA1956515F0B0CED7487724276C51B /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; DAE1A43C13EDE68CF0C6AEA7EA3A2521 /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; DAE679F6024F9BDC9690AFE107798377 /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; - DB0AFF30E90AACB8750FD39A9976E6E7 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - DC87EB1FDE1FA15565F929FD45E8F8DF /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; DF7CAA870676F2440AC2CCFC5A522F6C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; E181A2141028C3EB376581163644E247 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - E38495D719155033404DC23C9A2E1A4C /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; - E3E717317D46819E6BA262622A2B2090 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; + E70ED98C12C528D9F88F8CF7A7E3E518 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; E721CFEFA8C057FD4766D5603B283218 /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; E7513ADBA4C19938F615442415D28732 /* ShareReplay1.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplay1.swift; path = RxSwift/Observables/ShareReplay1.swift; sourceTree = ""; }; E7A01B1A67EE04FE1D9C036932C4C037 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Filter.swift; sourceTree = ""; }; E841A5E38033B35ED3073E4BBB921518 /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; E9178D3690ADCB4F8C9057F81C073A45 /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; + E94FD1527D47A90A58A6E226AF6C4A44 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EA39A7A8DF958888156A2207EF666EB1 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; EA4F47C5A2E55E47E45F95C0672F0820 /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; - EA681327FF596AFD3B758BD16ED8AD12 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; EA907F82073836CB66D5D606FB1333D9 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; + EACCA67328F0A3AC89EA2158DAFC9B3A /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; EAED6E7C8067874A040C7B3863732D73 /* Repeat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Repeat.swift; path = RxSwift/Observables/Repeat.swift; sourceTree = ""; }; ECB0A2EA86FF43E01E3D3ACE3BD2752B /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Optional.swift; sourceTree = ""; }; EDC14250FB9B1DCE1112D8F3FB5FCEDA /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EEFE0D42E486B898D1D43EE1C0F96501 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - F02116EF9AA682F86771D7A0EC2C8D31 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EE38C38CB1C97603C0C7266A3B45F2AC /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = ""; }; F104D45199031F05FCEEFA8E947F210E /* String+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+Rx.swift"; path = "RxSwift/Extensions/String+Rx.swift"; sourceTree = ""; }; F119426570E6238D04EAB498E1902F13 /* Deferred.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deferred.swift; path = RxSwift/Observables/Deferred.swift; sourceTree = ""; }; F1D34B07FCD98BCADAA8A3B68F1ACF1E /* Materialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Materialize.swift; path = RxSwift/Observables/Materialize.swift; sourceTree = ""; }; F1FCD92EC4EAB245624BBB2DDECF9B2C /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F242145721D8A291FA20AA5D610E73BA /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - F3050B56DC142944463FA79F9B91AC70 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; F42569FD7843064F8467B7215CC7A9A9 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; F4668C7356C845C883E13EAB41F34154 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - F4C48FFB103870F7F9978AA7BDE59E74 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + F511E345C77AFF186F61FCC34A664ED5 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; F57EA9DD77194E4F1E5E5E6CB4CDAE4E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; F5F0AE167B06634076A6A2605697CE49 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; F777764A45E0A77BE276ADA473AF453A /* ImmediateScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateScheduler.swift; path = RxSwift/Schedulers/ImmediateScheduler.swift; sourceTree = ""; }; @@ -530,8 +531,7 @@ FA436001918C6F92DC029B7E695520E8 /* PublishSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishSubject.swift; path = RxSwift/Subjects/PublishSubject.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; FB65A0C0C98ACB27CAE43B38C6B4A9FC /* RxSwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.xcconfig; sourceTree = ""; }; - FC9008ECB8D4F9BA319D0DAFC68443A3 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - FE56DF77148E9F1F9F1FB46D3B62377B /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; + FFF5F36FD4FA023FAEED7C490D4112F7 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -540,7 +540,7 @@ buildActionMask = 2147483647; files = ( 234470CC48A18683C120E00A087C42E7 /* Alamofire.framework in Frameworks */, - 1FC024F353F75F19F8DE0A7B836FD613 /* Foundation.framework in Frameworks */, + 7BFA5CE6E3698A79CE6269680DC4DAB3 /* Foundation.framework in Frameworks */, 84AA76C9E940EF23C4579B9CE71BE070 /* RxSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -549,7 +549,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -557,7 +557,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -565,7 +565,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 802B25F7F9BE8A9A8BF14B5B8500419F /* Foundation.framework in Frameworks */, + A82A9149306EF4D972CCDEBE265B37F2 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -573,19 +573,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BB0B398A709DABBED7B4B9BAA3601585 /* Foundation.framework in Frameworks */, + A7C5CF056E08D8CF885F5A923F8A7655 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { + 1E168A7457F1CC081BB2E1D97AE9AE29 /* APIs */ = { isa = PBXGroup; children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, + 88877D161F2CFC94AEB9EC3A87DCE137 /* Fake_classname_tags123API.swift */, + E70ED98C12C528D9F88F8CF7A7E3E518 /* FakeAPI.swift */, + C74872D21B74B20DED53ABF8CAF1C0A8 /* PetAPI.swift */, + 45DDB27E2A52C09D734190B2C3E83BF5 /* StoreAPI.swift */, + 365E9435D48E21D0C47AFA0FC453B002 /* UserAPI.swift */, ); - name = "Development Pods"; + name = APIs; + path = PetstoreClient/Classes/Swaggers/APIs; + sourceTree = ""; + }; + 278550D14ED46E76A8C3F458B5E6177F /* iOS */ = { + isa = PBXGroup; + children = ( + 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */, + ); + name = iOS; sourceTree = ""; }; 2E07FFE8D5239059E139DA4A84322919 /* Support Files */ = { @@ -602,22 +615,6 @@ path = "../Target Support Files/RxSwift"; sourceTree = ""; }; - 3C43FF4930E692605519546FF8535814 /* Swaggers */ = { - isa = PBXGroup; - children = ( - 4611AE0764EA3CE44DAB9AE6853897A8 /* AlamofireImplementations.swift */, - 279F457A02A5F05C1C513048A59EC8FF /* APIHelper.swift */, - 96F8141809C5EBF896875D5A0D398AEC /* APIs.swift */, - 0347C28BA18EC7F68A5BFB129BB6BD98 /* Configuration.swift */, - 72D37DE9C6B404082FCF0C8386564789 /* Extensions.swift */, - 6B8157356A6AE7F892F5F0FB322B7510 /* Models.swift */, - 9448CB24F2D69B4CEE74D9710FA36228 /* APIs */, - A902E147C4C16181F1F8C1758213FE5C /* Models */, - ); - name = Swaggers; - path = Swaggers; - sourceTree = ""; - }; 3F6894F6346ED0522534B4531C76C476 /* Support Files */ = { isa = PBXGroup; children = ( @@ -632,21 +629,90 @@ path = "../Target Support Files/Alamofire"; sourceTree = ""; }; + 4C0AE1291BF66ABD86D58AF2CBC25D4A /* Models */ = { + isa = PBXGroup; + children = ( + 3D2F69F61823A75B9D3A37C6EA502AB9 /* AdditionalPropertiesClass.swift */, + BBBC3E633FF7A6EF8F18280770400F6E /* Animal.swift */, + 213681FAAEF7EA349FE2EB13483D4CE0 /* AnimalFarm.swift */, + E94FD1527D47A90A58A6E226AF6C4A44 /* ApiResponse.swift */, + 8D8133C1AF527695DF9F34BEBFBAD4CB /* ArrayOfArrayOfNumberOnly.swift */, + 34CAB06DC6B0D4E914DE8355ABD73685 /* ArrayOfNumberOnly.swift */, + AD5077A09F9E9D3CA4F4FA368889BB02 /* ArrayTest.swift */, + C24CAB582243A8ABBCDA17324B26EB57 /* Capitalization.swift */, + D80C1B1AFFC108C1C4EC607179620DD8 /* Cat.swift */, + A353DBED5E7E7B0EC48E7A4A4B5C5806 /* Category.swift */, + 89E13D55B14894773A8FAECA0A7D37DE /* ClassModel.swift */, + C3BBD18F117F47C44487A0FB4650EF0D /* Client.swift */, + AACF3F3D813203894318A8EB451E126A /* Dog.swift */, + A2DDCF83AFCDDE5126ED96168870FCB4 /* EnumArrays.swift */, + 03F1F9E6E7C4A8537A517AD7A19AF471 /* EnumClass.swift */, + 2CC7A4A0D213AA0C7831EA91E658003C /* EnumTest.swift */, + EACCA67328F0A3AC89EA2158DAFC9B3A /* FormatTest.swift */, + D5D46171F3DE7355BBDB8A0594675BB4 /* HasOnlyReadOnly.swift */, + 3C2988432DEBFCFD8A5F5F0E2A220A8E /* List.swift */, + 590A7488E9B89273069B539F03421606 /* MapTest.swift */, + CC04CE09EBAD4D6F48048F82504397F4 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + B88AB92BE71D793E0172BDB03CBBAA1E /* Model200Response.swift */, + C1A02E1847AE8F11E47BE4161FCABFA7 /* Name.swift */, + 016E5F3C3DA72BE3740A226E72B26933 /* NumberOnly.swift */, + C6E0B4B99BC9F44A670C49699492A9FE /* Order.swift */, + 100C86AE9F32218EF6A633C7B7895CCC /* OuterBoolean.swift */, + 3C2545A0BD077774D3CA3B35CFD1FE40 /* OuterComposite.swift */, + B85C133791E08589EB1DCDD30204E0D1 /* OuterEnum.swift */, + A844E504E62CB6AEA00B8DA3BAF7359B /* OuterNumber.swift */, + A48E3D95D5FE201A1BC906340E5BA25C /* OuterString.swift */, + 5F379571B66704590E35A4719E6769F9 /* Pet.swift */, + 69AC2285C925A617C06C7FB2086BAA68 /* ReadOnlyFirst.swift */, + F511E345C77AFF186F61FCC34A664ED5 /* Return.swift */, + 48144D6C24CA10B6A3584D425416F37A /* SpecialModelName.swift */, + 911C6A3C96205B93025F13FBCA992687 /* Tag.swift */, + 08A9FC90934F7A68C930C0F99508A737 /* User.swift */, + ); + name = Models; + path = PetstoreClient/Classes/Swaggers/Models; + sourceTree = ""; + }; + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 75DB99FD1A2922D8F12E9A97A5DB2E01 /* PetstoreClient */, + ); + name = "Development Pods"; + sourceTree = ""; + }; 69750F9014CEFA9B29584C65B2491D2E /* Frameworks */ = { isa = PBXGroup; children = ( AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */, 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */, - B0BAC2B4E5CC03E6A71598C4F4BB9298 /* iOS */, + 278550D14ED46E76A8C3F458B5E6177F /* iOS */, ); name = Frameworks; sourceTree = ""; }; + 75DB99FD1A2922D8F12E9A97A5DB2E01 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + EE38C38CB1C97603C0C7266A3B45F2AC /* AlamofireImplementations.swift */, + C78926FAD7615329921AC6B3E036268E /* APIHelper.swift */, + 3D9270FF743FC000569F250E309CB89E /* APIs.swift */, + 9F3FD0F9796D0E174012697BE40B68BF /* Configuration.swift */, + D3726BB3EDFF36AE68CFA5EFB3F8ADCF /* Extensions.swift */, + CB5ABAF432E141A4D578C1ECEA8D3D06 /* Models.swift */, + 1E168A7457F1CC081BB2E1D97AE9AE29 /* APIs */, + 4C0AE1291BF66ABD86D58AF2CBC25D4A /* Models */, + D82B01DC4E2A8A19C06CDA44ECD278AA /* Support Files */, + ); + name = PetstoreClient; + path = ../..; + sourceTree = ""; + }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, + 4DEB624A2186E265CF56EBC3503FD8C9 /* Development Pods */, 69750F9014CEFA9B29584C65B2491D2E /* Frameworks */, B569DEF8BE40A2041ADDA9EB1B3163F0 /* Pods */, C1398CE2D296EEBAA178C160CA6E6AD6 /* Products */, @@ -672,85 +738,6 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { - isa = PBXGroup; - children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; - 9448CB24F2D69B4CEE74D9710FA36228 /* APIs */ = { - isa = PBXGroup; - children = ( - 8EC9E951298DE2A9A773FF2F9D580C77 /* Fake_classname_tags123API.swift */, - 85F7A032DE7EF2A9B4E1C3349C3339B7 /* FakeAPI.swift */, - 1DB83B104D9DB76F5DAB8D5C25F1987D /* PetAPI.swift */, - 078CD337BBF933DB7D55A152DFF11AEB /* StoreAPI.swift */, - 2BC9EFADA42C0213743B8D3108D2AA75 /* UserAPI.swift */, - ); - name = APIs; - path = APIs; - sourceTree = ""; - }; - A902E147C4C16181F1F8C1758213FE5C /* Models */ = { - isa = PBXGroup; - children = ( - 080866A4EA877817F1AA94B0C72201D6 /* AdditionalPropertiesClass.swift */, - A629F4D978DF923EE08DA27405E8B921 /* Animal.swift */, - 27B0714A7CE3DFCBCC702F6279D146A4 /* AnimalFarm.swift */, - BBB7C99381BFC166AE1C8C46B66E6935 /* ApiResponse.swift */, - C2703D7A31059043BE2D013A096C8514 /* ArrayOfArrayOfNumberOnly.swift */, - A8CA3F9326583E57838201C8F5288BB2 /* ArrayOfNumberOnly.swift */, - F02116EF9AA682F86771D7A0EC2C8D31 /* ArrayTest.swift */, - 68AE8E0718FFE9291FC66C0EB5441FD1 /* Capitalization.swift */, - 78512005DDEE4226A4CAC430BA81246F /* Cat.swift */, - 80315B443694B2EC8CCF76D4FABE028D /* Category.swift */, - EEFE0D42E486B898D1D43EE1C0F96501 /* ClassModel.swift */, - F3050B56DC142944463FA79F9B91AC70 /* Client.swift */, - DC87EB1FDE1FA15565F929FD45E8F8DF /* Dog.swift */, - FC9008ECB8D4F9BA319D0DAFC68443A3 /* EnumArrays.swift */, - 63892157E6A5B54321974F619C1C74A4 /* EnumClass.swift */, - D6847583F43C5149C306FEA14B59ACAE /* EnumTest.swift */, - C2CEFB4563AAF003750C502652064250 /* FormatTest.swift */, - DB0AFF30E90AACB8750FD39A9976E6E7 /* HasOnlyReadOnly.swift */, - D1328AA3B0C915CDCE647BD5BE5EE0B9 /* List.swift */, - F4C48FFB103870F7F9978AA7BDE59E74 /* MapTest.swift */, - D756CC001719820E35D7EDC74440A99A /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - EA681327FF596AFD3B758BD16ED8AD12 /* Model200Response.swift */, - F242145721D8A291FA20AA5D610E73BA /* Name.swift */, - 599E954C7FCD17BF4ECECF02C1249ABA /* NumberOnly.swift */, - E3E717317D46819E6BA262622A2B2090 /* Order.swift */, - FE56DF77148E9F1F9F1FB46D3B62377B /* OuterBoolean.swift */, - E38495D719155033404DC23C9A2E1A4C /* OuterComposite.swift */, - C3255087A708A0A56D2DC5C2A719BCDF /* OuterEnum.swift */, - A5F0C909F84199ABBB040797658A665B /* OuterNumber.swift */, - CDB96088C8107BB39EF01E984039D8A0 /* OuterString.swift */, - 53BB654DDCD6F1CF9FD0EEB09EB70F76 /* Pet.swift */, - 9CCD3D06407423C18753CDF829B3751B /* ReadOnlyFirst.swift */, - 12B50D9BCCC227D4BCE7093EB51FA7DE /* Return.swift */, - 49C40576477EB5B6F3CA61283A3D3DC2 /* SpecialModelName.swift */, - 590873A848A323526E77969A48236628 /* Tag.swift */, - 03DA799556B50E85F1141C4E2941FCC5 /* User.swift */, - ); - name = Models; - path = Models; - sourceTree = ""; - }; - B0BAC2B4E5CC03E6A71598C4F4BB9298 /* iOS */ = { - isa = PBXGroup; - children = ( - AE307308EA13685E2F9959277D7E355A /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; B569DEF8BE40A2041ADDA9EB1B3163F0 /* Pods */ = { isa = PBXGroup; children = ( @@ -799,13 +786,18 @@ path = "Target Support Files/Pods-SwaggerClientTests"; sourceTree = ""; }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { + D82B01DC4E2A8A19C06CDA44ECD278AA /* Support Files */ = { isa = PBXGroup; children = ( - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */, + ADF7C6067B822BBAD3F14822D1B1CC81 /* Info.plist */, + FFF5F36FD4FA023FAEED7C490D4112F7 /* PetstoreClient.modulemap */, + 9B9FC0446DF4BE1DB94CBC0AB085954E /* PetstoreClient.xcconfig */, + 9E8814B64707AA238E44CC6739648D2B /* PetstoreClient-dummy.m */, + D2AD7DFB58BCC2F73ADF9157DD2BA644 /* PetstoreClient-prefix.pch */, + 7F4C7EC001A7DAE883053BE9583EECF1 /* PetstoreClient-umbrella.h */, ); - name = PetstoreClient; - path = PetstoreClient; + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; sourceTree = ""; }; E7F23A0F12E60AD47285170493A15C47 /* RxSwift */ = { @@ -963,25 +955,6 @@ path = RxSwift; sourceTree = ""; }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - F26F242B4BD93A8BF2D5654A38B86ABC /* Classes */ = { - isa = PBXGroup; - children = ( - 3C43FF4930E692605519546FF8535814 /* Swaggers */, - ); - name = Classes; - path = Classes; - sourceTree = ""; - }; FF61792A0279354AB25395F889F59979 /* Alamofire */ = { isa = PBXGroup; children = ( @@ -1112,7 +1085,7 @@ isa = PBXNativeTarget; buildConfigurationList = 571608A4767C3A782EB9F4C0D6CE6BAF /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - 777900BF867D70D54730B4033954BD74 /* Sources */, + F894D75CBDE6A4F9B7DA28460CF690AB /* Sources */, 2C2AC7F85A0925E946CB2F88456DD41C /* Frameworks */, EB7C12C7ADF8C984756CB74177CB2B54 /* Headers */, ); @@ -1150,7 +1123,7 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; @@ -1354,74 +1327,74 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 777900BF867D70D54730B4033954BD74 /* Sources */ = { + BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FB6ADAF415D6C6260BDE4EF13A89A87E /* AdditionalPropertiesClass.swift in Sources */, - 15D4F44ABBB42806F52CDB40C3D3FAD9 /* AlamofireImplementations.swift in Sources */, - 54F27D86602946D5B05FAA7815DF3C9D /* Animal.swift in Sources */, - C27DE83CDF87C91892F8D6BAC74EB3DB /* AnimalFarm.swift in Sources */, - 8DBBDB1DAB3F820778447F938968ADE3 /* APIHelper.swift in Sources */, - 7709DD414A524588A144DE443610C3FD /* ApiResponse.swift in Sources */, - BD4A3DC001CA9307DC25026055FCC3FC /* APIs.swift in Sources */, - AAC9A6049EBB4C7E897F06F5AA653AC0 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 2BAA1E2F9E057A259B5A4FD9554820CC /* ArrayOfNumberOnly.swift in Sources */, - B1E93AC38EE125ED28E0F65C24F3CF4E /* ArrayTest.swift in Sources */, - 90CD3BB0624706A481D3EEA50DE6A00D /* Capitalization.swift in Sources */, - 4E22260F68870F3F5B2CBABE055B30C3 /* Cat.swift in Sources */, - 21D925E566EDCF2015C26F3B0534C18B /* Category.swift in Sources */, - 5177A8F28385B02A28B251F628D5BF9E /* ClassModel.swift in Sources */, - 0B57F42F9F0D7EEC37BC9E0C11D9B17A /* Client.swift in Sources */, - 433130E6F5F6ADD76FF8137412DE1CC5 /* Configuration.swift in Sources */, - 67DF08DD80B5D58484F736D9AF26C18F /* Dog.swift in Sources */, - 25447075CCEFE492C62DD9B5343609DE /* EnumArrays.swift in Sources */, - A3508B5B8F1C327C2AAEA79FBDBD2AD8 /* EnumClass.swift in Sources */, - BC4FBAF0A7DDBC841EE1F0C224F66EAA /* EnumTest.swift in Sources */, - 8596FF7C15793C2BE30ED72657A722C0 /* Extensions.swift in Sources */, - 526B7E412BE480FEFA82C6875BFC208A /* Fake_classname_tags123API.swift in Sources */, - 759C49C4AF0A68116FED5D2B91EAE6F0 /* FakeAPI.swift in Sources */, - 07B6BCAC1CB401E72E73445EAF0CC011 /* FormatTest.swift in Sources */, - B60370C99B46DA380B57C60F47E40581 /* HasOnlyReadOnly.swift in Sources */, - 510749288AC04924FCA3AAAD2C9CF882 /* List.swift in Sources */, - 26E0F4D71550CA1C212CB7E7A488ADE2 /* MapTest.swift in Sources */, - 1E26E53EEAA558B4AAAB0413BCD87D4C /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - A2ABE4DA0B7DB062BA3114D1550A2E7D /* Model200Response.swift in Sources */, - A6B3140D43833D41246C9EC8A02544E3 /* Models.swift in Sources */, - BFC1F306440D496DCDAE34DAB229EAF9 /* Name.swift in Sources */, - 8C3A6A42AC6BD3A0C147E12B3EE27199 /* NumberOnly.swift in Sources */, - C1479CDE82B9A38CC6754B5F6A2ACCA7 /* Order.swift in Sources */, - C5AD393D58E9938EDEE3704EA376B1D7 /* OuterBoolean.swift in Sources */, - 686AA603B7707166FBAA28EBB562AADA /* OuterComposite.swift in Sources */, - 63C3CC4A0625B4BE1959D5B6A1EC1B94 /* OuterEnum.swift in Sources */, - A110620E31B25C0FF43FD7DD5E9E5E15 /* OuterNumber.swift in Sources */, - 442F4B0E1CB45747A394F28298C56C39 /* OuterString.swift in Sources */, - F40669C1C229D78C2DD3112880D60C1E /* Pet.swift in Sources */, - F5A3ED1D316DBEC092A7CEC07130866B /* PetAPI.swift in Sources */, - A2FA29BDF6B44B64D23DDD4FD0CA487E /* PetstoreClient-dummy.m in Sources */, - B33DD030E58293B740E39FB0006CB56F /* ReadOnlyFirst.swift in Sources */, - 65987B3FECA58D1ED06F7056EEF6236E /* Return.swift in Sources */, - 88F107B2F442369A48B94CE079CADF11 /* SpecialModelName.swift in Sources */, - 953DE9669794F503CAAA4F1B0B166CE2 /* StoreAPI.swift in Sources */, - ACEB8953D68D199AD6E0968D6ED11BCD /* Tag.swift in Sources */, - A84528A62CB64590B2827841B2464E7E /* User.swift in Sources */, - DCD7BB46F54AF60D765009343633DB34 /* UserAPI.swift in Sources */, + 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { + CAA04C85A4D103374E9D4360A031FE9B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, + 91BCA631F516CB40742B0D2B1A211246 /* Pods-SwaggerClient-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CAA04C85A4D103374E9D4360A031FE9B /* Sources */ = { + F894D75CBDE6A4F9B7DA28460CF690AB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 91BCA631F516CB40742B0D2B1A211246 /* Pods-SwaggerClient-dummy.m in Sources */, + DB1674B5221497F0781506BC3D3DB14D /* AdditionalPropertiesClass.swift in Sources */, + DECDCFF8F77B285B8E565E1F3D759D86 /* AlamofireImplementations.swift in Sources */, + 5640D4D6568ED402D0789D4CE76CA707 /* Animal.swift in Sources */, + A95E05FA3760CAA9BD09D1DA2E63C1C7 /* AnimalFarm.swift in Sources */, + C93468AFEE47CED3CF2C9EE43647369E /* APIHelper.swift in Sources */, + 41D7E74614B7E7289F55DC3C2C5E1BC7 /* ApiResponse.swift in Sources */, + 7E3483337526BAB8F018A0D3F4AB3301 /* APIs.swift in Sources */, + C58B42EA7B120CFDA0D45ED69CC347FD /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 537747BEC46420B59A6E6404B55519E0 /* ArrayOfNumberOnly.swift in Sources */, + C7EBEDBD417428925528DC9BE13C3CD5 /* ArrayTest.swift in Sources */, + 609D36645D868B8D4B2175FF76785490 /* Capitalization.swift in Sources */, + A26C90236BB15DB7900521CC97C4F1D6 /* Cat.swift in Sources */, + 6A366BBAFAD2E0C249DF77A193516D52 /* Category.swift in Sources */, + 71AA7E64651C50855F1E8D6672A92A97 /* ClassModel.swift in Sources */, + 07538F6EF28CF0D537B45B6210077B6F /* Client.swift in Sources */, + B55EB691D0BA0B3A7B30B397735B8C45 /* Configuration.swift in Sources */, + FE117050A9DD8D8B7B10768B97070C9F /* Dog.swift in Sources */, + 6C7806F381D2AC4D92A3C93986F18F82 /* EnumArrays.swift in Sources */, + F03314F98A25C519B11F849BC7A325D0 /* EnumClass.swift in Sources */, + 386F9A49ADAB8E03CE41B6EC146B5FA2 /* EnumTest.swift in Sources */, + 4FE4C667BB96C218E29D53392D21AEC9 /* Extensions.swift in Sources */, + 8F82AE7F51351B9E13D405006482FEE6 /* Fake_classname_tags123API.swift in Sources */, + 860E77C38C6A9E6F9C6DD4457119C4CE /* FakeAPI.swift in Sources */, + 6B266E73D0D76B5DFF4900963F3561FC /* FormatTest.swift in Sources */, + 22EE4A36063EC92A1E44595D3CA1285E /* HasOnlyReadOnly.swift in Sources */, + AC5EA05CC3AB722B8FAFA500AE9AE14D /* List.swift in Sources */, + 2528BD9FDA9E26A202E8A8AB6DEFFB0F /* MapTest.swift in Sources */, + 9BB27EC494EC7A1DE605C2F9C651EAC8 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 0D5164E0905ADFD6E8801868FF767491 /* Model200Response.swift in Sources */, + 0E06A7A24FEC623CCD59A64464FA0F4B /* Models.swift in Sources */, + 1A54AFBFE909D0F2608D4F47C52ED045 /* Name.swift in Sources */, + D285D4EB606DA906E58F886325157E7A /* NumberOnly.swift in Sources */, + B7E707ED3304DC2880A70A648405C3F4 /* Order.swift in Sources */, + C88D778A956F43A56BA03D6D8CBFDCE5 /* OuterBoolean.swift in Sources */, + 4417ABCFF958D02DF8E985AF534F7BCC /* OuterComposite.swift in Sources */, + 7A2028722035DA3B8440147EE06D9F10 /* OuterEnum.swift in Sources */, + 670915CFD068A67AA6C01E7596315E4D /* OuterNumber.swift in Sources */, + B8B06AE345D2EDFAADBA24DE5B9F9E8F /* OuterString.swift in Sources */, + 371D450E9B85ACBA18E949DEEC06DAE3 /* Pet.swift in Sources */, + 5D4EE628D324BC4A7EF5878364796DED /* PetAPI.swift in Sources */, + 058099234763329A48424C8A10C5824E /* PetstoreClient-dummy.m in Sources */, + 0CAD756A07CDD3214A87984F53D2D553 /* ReadOnlyFirst.swift in Sources */, + 0588C627138A5FC717BE474F7F6099F4 /* Return.swift in Sources */, + A56413C6A12B1D2F50BF5461C2849DB9 /* SpecialModelName.swift in Sources */, + 9C5C95CBEBBF8ADB142C102234C396EC /* StoreAPI.swift in Sources */, + C18B62BC2701E2D05B1352515F91A5C1 /* Tag.swift in Sources */, + 79FE0B73A3F9EE4A7E0CACBB97650798 /* User.swift in Sources */, + 7B3A68DD690D4DC76D988FFDABA3A53C /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1461,42 +1434,11 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 077AC2C20828A223032367E113C20E26 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */ = { + 077C4BB7DBEAA715DED46C057DC8051C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = C0141EB6EAA64B81BBA6C558E75FE6A3 /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1518,6 +1460,8 @@ PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1525,11 +1469,12 @@ }; name = Release; }; - 13E96A645A77DAD1FD4F541F18F5DDBF /* Debug */ = { + 157AF0CD5E5AB2A2E74D3B8ECD865185 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1537,24 +1482,23 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", + "POD_CONFIGURATION_RELEASE=1", "$(inherited)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1562,69 +1506,78 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.3; - ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; }; - name = Debug; + name = Release; }; - 3CA64354DC73F0B7E5AFEC775F83415E /* Debug */ = { + 1713B0CEBD1F85062687B67D4C05B369 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FB65A0C0C98ACB27CAE43B38C6B4A9FC /* RxSwift.xcconfig */; + baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = RxSwift; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 4A509E84D21040F6EF5BB290FF311380 /* Release */ = { + 225CFF6825EFDC3BC5E0BD17DB796AD3 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FB65A0C0C98ACB27CAE43B38C6B4A9FC /* RxSwift.xcconfig */; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = RxSwift; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; @@ -1632,12 +1585,13 @@ VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 7DF398BA95C03133FA075421DCE0F3A2 /* Debug */ = { + 4637BF406E4C4B9FD8F323E585FCAD4F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + baseConfigurationReference = 9B9FC0446DF4BE1DB94CBC0AB085954E /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1649,20 +1603,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1670,86 +1622,81 @@ }; name = Debug; }; - 862AF3139CD84E18D34FAF2F43CD0DA6 /* Release */ = { + 6DE21489DDEB128A7B20C23FD2CF9D36 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = FB65A0C0C98ACB27CAE43B38C6B4A9FC /* RxSwift.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = RxSwift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; name = Release; }; - C45D0F76749207E7E5705591412F9A28 /* Release */ = { + 7DB6F1AE8E8584FBAA1F2DC4EAB7F4A1 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; + baseConfigurationReference = FB65A0C0C98ACB27CAE43B38C6B4A9FC /* RxSwift.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = RxSwift; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - C5CA9151745B15E40168EB5564219ADA /* Debug */ = { + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; + baseConfigurationReference = C0141EB6EAA64B81BBA6C558E75FE6A3 /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1761,20 +1708,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1783,10 +1727,11 @@ }; name = Debug; }; - DA5584B68BA62D0430D7F179D8B4EA21 /* Release */ = { + E55DEB5F7A7C75B015C79914E39D8028 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1812,6 +1757,7 @@ PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1819,10 +1765,11 @@ }; name = Release; }; - F383079BFBF927813EA3613CFB679FDE /* Debug */ = { + EADCEA8D9D624267A5AE96B0C0D68BCB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C0141EB6EAA64B81BBA6C558E75FE6A3 /* Alamofire.xcconfig */; + baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1834,16 +1781,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Alamofire; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1852,15 +1804,65 @@ }; name = Debug; }; - FB48E1881DDE553BC3A1CB1E73A72D47 /* Debug */ = { + EED546DBB23FC32035C9BDC4E22B30BD /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + FE0340FD75EFCA060255E9DA84041497 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9B9FC0446DF4BE1DB94CBC0AB085954E /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1873,17 +1875,18 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; /* End XCBuildConfiguration section */ @@ -1891,8 +1894,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 13E96A645A77DAD1FD4F541F18F5DDBF /* Debug */, - 862AF3139CD84E18D34FAF2F43CD0DA6 /* Release */, + EED546DBB23FC32035C9BDC4E22B30BD /* Debug */, + 157AF0CD5E5AB2A2E74D3B8ECD865185 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1900,8 +1903,8 @@ 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - F383079BFBF927813EA3613CFB679FDE /* Debug */, - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */, + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */, + 077C4BB7DBEAA715DED46C057DC8051C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1909,8 +1912,8 @@ 571608A4767C3A782EB9F4C0D6CE6BAF /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - FB48E1881DDE553BC3A1CB1E73A72D47 /* Debug */, - 077AC2C20828A223032367E113C20E26 /* Release */, + 4637BF406E4C4B9FD8F323E585FCAD4F /* Debug */, + FE0340FD75EFCA060255E9DA84041497 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1918,8 +1921,8 @@ B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 7DF398BA95C03133FA075421DCE0F3A2 /* Debug */, - C45D0F76749207E7E5705591412F9A28 /* Release */, + 225CFF6825EFDC3BC5E0BD17DB796AD3 /* Debug */, + 1713B0CEBD1F85062687B67D4C05B369 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1927,8 +1930,8 @@ DB44D5A97F47588D95DEAB88B712FB63 /* Build configuration list for PBXNativeTarget "RxSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3CA64354DC73F0B7E5AFEC775F83415E /* Debug */, - 4A509E84D21040F6EF5BB290FF311380 /* Release */, + 7DB6F1AE8E8584FBAA1F2DC4EAB7F4A1 /* Debug */, + 6DE21489DDEB128A7B20C23FD2CF9D36 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1936,8 +1939,8 @@ F74B56615E0AC0F998019998CF3D73B7 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - C5CA9151745B15E40168EB5564219ADA /* Debug */, - DA5584B68BA62D0430D7F179D8B4EA21 /* Release */, + EADCEA8D9D624267A5AE96B0C0D68BCB /* Debug */, + E55DEB5F7A7C75B015C79914E39D8028 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h index 02327b85e88..00014e3cd82 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig index 772ef0b2bca..619e5f4acef 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist index df276491a16..c1c4a98b9a1 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.0 + 4.5.0 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h index 435b682a106..2a366623a36 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig index 2a33e782857..0b6473e99b9 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -6,5 +6,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh index 37889bda5c3..def160388eb 100755 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -84,12 +102,15 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/RxSwift/RxSwift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/RxSwift/RxSwift.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h index 2bdb03cd939..b7da51aaf25 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig index 6bee65857b2..b86868ff727 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig index 6bee65857b2..b86868ff727 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh index 893c16a6313..88dd5379907 100755 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -82,3 +100,6 @@ strip_invalid_archs() { fi } +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h index 950bb19ca7a..b2e4925a9e4 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig index baa93dce4dc..740c74ce0dc 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig index baa93dce4dc..740c74ce0dc 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h index 91c9282a73e..9a272119378 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig index 3307fdc9bc6..8b032eddccb 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/RxSwift PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 42c123e8f5b..7c3242275ff 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -275,13 +275,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */ = { @@ -290,13 +293,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */ = { @@ -305,9 +311,16 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec b/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec index 21af9e9df50..7a28d478bf8 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec @@ -9,5 +9,5 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.0' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock index de11941ae62..dbc19e59b6a 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock @@ -12,8 +12,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: 77e3465a18f2380eff57e5075a2d59021308dde4 + PetstoreClient: 224b8a1c6244bcba3eef8fc2d64ff398a014f7c8 PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index 6e7e3ef32c4..613c1411ce8 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -13,7 +13,7 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", + "source_files": "PetstoreClient/Classes/**/*.swift", "dependencies": { "Alamofire": [ "~> 4.5" diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock index de11941ae62..dbc19e59b6a 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock @@ -12,8 +12,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: 77e3465a18f2380eff57e5075a2d59021308dde4 + PetstoreClient: 224b8a1c6244bcba3eef8fc2d64ff398a014f7c8 PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index d761f17efc0..f751e87ca00 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,86 +7,87 @@ objects = { /* Begin PBXBuildFile section */ - 079F2BD52F24416F7C5A53877F54566A /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */; }; - 0D33BB30417B9584629B6D880037AA2B /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */; }; + 0F662FA5B2EB748EA516B8C83742DE29 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */; }; 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; - 1151CDE98B5CB5F152ED39BF798EF5CF /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */; }; - 154A6488A4E591935A82473995C15AE4 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */; }; - 1B13BFD9084781D7ED2E079E6BF2C557 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */; }; + 127354085F10006D6B57C16D3AE2E043 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */; }; + 1982792C8B5D5B4999228D16CDBE3E28 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */; }; 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1CFDE72D9E7E9750A9ADE03AB4669311 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */; }; - 1E2B97D6050471F3C9440D7AEA63029D /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; - 22FDE110EA91A85020A5B47486558282 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 24FFD130F7E23492281B79C5C678F00D /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */; }; - 253BED146B97E5F268DB986D0EC87081 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */; }; - 27BF2E059FCCB3CDA349738B75A9EDD3 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */; }; - 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - 29BBA290461F57554F9D63A842505063 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - 2D5A60538984183CDF16344E07DE6016 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */; }; - 2DEA81B2292287FEE1BC4A520801F675 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69BC1C993ED1722CE6D63E07381785E /* Category.swift */; }; + 24F9EAC555D87891496C9873A3A353BC /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */; }; + 281150C5E93967FEA2D3921AEC92BA3D /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */; }; + 2B1BE5C3FED4683F31A1DA3E4D4FE6C6 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */; }; + 2B22A023463A6CF04BB1BFF869D30AC6 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */; }; + 2D208564DFB2C2849316BD87AA3F53AC /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */; }; 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 342645FD19CD3977B12C869E662DF658 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */; }; 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; - 39755FB5994F45FBD67C9ADFD5915EF2 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */; }; + 363930DE8DE4B17D8EF901F5C249A9AC /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D3039E712D1279434152E805AEDA65 /* Order.swift */; }; + 39C0CB11CA9812CD5BB73A893D27BEE9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */; }; + 3B0E9022805FED1731E3C6474C700253 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */; }; + 3E11073F08C80332AEFC3A10FC489313 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */; }; + 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4378EAAAA7D2FDACD110A1ED9D2FED5F /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */; }; - 483C65BB55BCA70C8B65BBD266151A1C /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */; }; - 491FD17DCEA4455874451D174A9A182E /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */; }; - 4AE57833EC2315CC8EDA4864CAD7382B /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */; }; - 4E168284FE74373DE791FA46610F6E85 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */; }; + 472DF233EF1CA028A52DB57F87A5687F /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */; }; + 4814A739814A3809C4D9C61F96012C62 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7417953898146193F86A165CD5F3AF4A /* Category.swift */; }; + 4CBD58C64013924FB5A74A106D838285 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */; }; + 4DF5B60FEFEAC2BA370EE79D2567B3E9 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */; }; 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; + 55F9C83CA76F9B2DA873122BEC278855 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */; }; + 5E38839B97A3FB54831CB0CE3B177E06 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */; }; + 5EC075C471A4F4D9A43857B8629D95EE /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */; }; 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; - 700AFFD25A3F79F704E1F48E1090C719 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */; }; - 75332AEFA1C56AD923C581FB7CC4B580 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 785570E189782F883FC7F30096107F05 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */; }; - 798B0EDE6CDDDFA67A576CC5D7356197 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C21C617FCA30726E782E8A67D0149138 /* Cat.swift */; }; + 707F832EEA6E7DD274201962E4D85B5B /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + 73BF6D173C637DEE9571E96E19EADABD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + 74E60841671B65510C2E9DBD34EDD96B /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */; }; + 7A854DC997BF3D7E3449FF58278EC967 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */; }; 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - 7EA0B4343115F6BD6062C1A3C5924380 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */; }; - 804A773AC1F6CAD0833113365C437ED6 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */; }; - 858A507A04D7EBD392B5E38BFA5C0FB1 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */; }; + 7D99F1CDFA55B21CBDB1603DA46C0599 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */; }; + 7EE07906770CB8D69F00429072D7DC02 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */; }; + 8158ED5AEE2D6FE60EBA456F691D823C /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */; }; + 82F7587E619353285C601A5677961853 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */; }; + 857A7B68378E7164FD99F549C092436E /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 8B3DB4230FDB986C273707551D5C098D /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80F4034540947434A69B02246F8ABBD /* Order.swift */; }; - 8CBE860E26B3E63F905AABB8C2ED8408 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */; }; - 94B455FDE2B057DB680F439EA3FD1B49 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */; }; - 97809A3EC41B70910367804F24749488 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */; }; - 97D4E3413AADDB57435C6E01E40F1737 /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */; }; - 98A62599B00ECECEE6693F10291DCA8E /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */; }; - 9D4EC73C4EC0F4CA643BFB0F744E206E /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */; }; - 9DF1DB10A8D8AD5D760AD2119464BBFA /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */; }; - 9ED1C3E564D542971480A55F74192BA2 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */; }; + 8A4C36FD6B751F6F87BFC6C4E01DD793 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */; }; + 9067B627206EA4FFE8E94388031FBB70 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 90D416A6F921DADEF05F65AFF7E1E5B0 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */; }; + 9145FC4EDCAF00080761172112D6B4E1 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */; }; + 96179D2776662CFF1D8CD2BA7599E165 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; + 973AF350C705E18926C330359F0DAC29 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */; }; + 9B73E49DCB45F1F471FA4DE8264BA512 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */; }; 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; - A19592FE4371E4FCDAAB8AEE09AB93B9 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */; }; + 9F4FF785FA604AD3A70C4B87FA0ED450 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */; }; + A0F161A5D21EFF05B0208B7C1B6C3C67 /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */; }; A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; - A563CBF0CB0A2D620BCE488727AFE9BC /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */; }; - A63D913EAA7D50833B860D9FB011E761 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */; }; - A6546161061DFBD9AD9CD2669B3407DD /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */; }; - A73E115FCBAE1F29A37D5327AE87AAB8 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */; }; - A7F2C30678B7926A18C64F71A5CFDB3E /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */; }; A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; + AAEFA9B66A1EE281AA8D76AC0DCA3C97 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */; }; AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; - B0A93172B99BF60154ED6242AFBE4026 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */; }; + B384569B4208ADC0A68233491ED19609 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */; }; + B4D9507C3602C7D37EB6F7B88269CD52 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */; }; + B65AABE5C7EB03365333C4783B36CCDC /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */; }; B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; - B746D752789DABA80AC0ABF066B719BB /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */; }; + BA15A21EB63AC8A5B7B859AC8D6E7B23 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B87E0BA794A79025212F37D32449C63 /* List.swift */; }; BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; - C05B6F5687193D4F8C45A876DD05D53E /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */; }; + C888F5D0484D08C3F110B48DF18DDFD6 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */; }; + CA6B474618AA720ABFB571F69B227AF7 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */; }; CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - D000C65F968C44B544101279E763C0C9 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56F57C400928D9344121036AC8E4220D /* Return.swift */; }; - D102CB4FA078626BF684F476910012A1 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - D319019CE9A48494F3ED480F1226517A /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */; }; D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - D9657D5FFD53727FA47D8C6E8EE258A3 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */; }; - EE614419EAB1923DFB520AE1E35D4D54 /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8F6D8048F257672069D2008983C66D /* OuterString.swift */; }; + DE8F9190013C0FECA7C3413F214B2BAB /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */; }; + E05C5957E89CE7129CC4880299444A81 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */; }; + E0B2924D681BAA663ADE94DC43706E3D /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */; }; + E0C687FEA77962F5E1CE2D4347246984 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */; }; + E6A0A5C14D3633FFE1551CFDE39FA4C3 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */; }; + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + EA063534695F7232C7E7FF9C5A61483A /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */; }; + EDFB99BED377CAB8D24E0256E1208BD1 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - F37C6CFB2C08C9727ABCBD83044789EE /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */; }; + F1ACDB1E74FDDF4609EA027BB6D5C9D8 /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; + F81E110F1F9AAD6C448DCF5DF99C2F41 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8F990A8905B95231C6D1955750D23C /* Client.swift */; }; F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; - F9B80B148598B14AF1EFC8C590CDA38B /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */; }; - FA158D72EECF92FF935BB38B670E6CFE /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */; }; + F9884BC36100EA0FC9AAABAC5D4A0371 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */; }; + FBB089E4407481B7A92F96EEC803A04D /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -94,10 +95,10 @@ isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 872AA614769F12C7EFF56226C25D2EE5; + remoteGlobalIDString = F273DBB2E19E2286018971F2B25DEB52; remoteInfo = PetstoreClient; }; - DD169196715C246D6848CD38092BCBFE /* PBXContainerItemProxy */ = { + 53846F4D999F8096A92BE0AB60034710 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; @@ -115,120 +116,121 @@ /* Begin PBXFileReference section */ 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; - 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; + 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 13A0A663B36A229C69D5274A83E93F88 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 24D3039E712D1279434152E805AEDA65 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + 2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; + 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; + 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/Swaggers/APIs.swift; sourceTree = ""; }; + 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/Swaggers/Models.swift; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/Swaggers/Configuration.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 56F57C400928D9344121036AC8E4220D /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 5B8F990A8905B95231C6D1955750D23C /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 7417953898146193F86A165CD5F3AF4A /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/Swaggers/CodableHelper.swift; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = ""; }; + 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 8B87E0BA794A79025212F37D32449C63 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/Swaggers/APIHelper.swift; sourceTree = ""; }; B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + BA7C170F1E6A7A846F3D1C4BF9F78EAA /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; BCCA9CA7D9C1A2047BB93336C5708DFD /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - C21C617FCA30726E782E8A67D0149138 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - E80F4034540947434A69B02246F8ABBD /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - EA8F6D8048F257672069D2008983C66D /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EB834CA4A0478028D959D9EBD119D953 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F69BC1C993ED1722CE6D63E07381785E /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; + FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 606C951710A3AAEA962F236422DE5D8C /* Frameworks */ = { + 2D7583F1D86C34DDA26383E3BD322469 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1E2B97D6050471F3C9440D7AEA63029D /* Alamofire.framework in Frameworks */, - 29BBA290461F57554F9D63A842505063 /* Foundation.framework in Frameworks */, + 96179D2776662CFF1D8CD2BA7599E165 /* Alamofire.framework in Frameworks */, + 73BF6D173C637DEE9571E96E19EADABD /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,7 +238,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -244,7 +246,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2940D84FC5A76050A9281E6E49A8BDFC /* Foundation.framework in Frameworks */, + 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -252,22 +254,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 02E57F930C8EDC9AD0C9932B5CAD1DC8 /* Classes */ = { - isa = PBXGroup; - children = ( - 6D8231D013B59DBC75D89B4D4FC1781D /* Swaggers */, - ); - name = Classes; - path = Classes; - sourceTree = ""; - }; 200D10EB20F0397D47F022B50CF0433F /* Alamofire */ = { isa = PBXGroup; children = ( @@ -294,20 +287,20 @@ path = Alamofire; sourceTree = ""; }; - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { + 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { isa = PBXGroup; children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, + 200D10EB20F0397D47F022B50CF0433F /* Alamofire */, ); - name = "Development Pods"; + name = Pods; sourceTree = ""; }; - 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { + 51A9B78D6A7E7FB5A465754528750815 /* iOS */ = { isa = PBXGroup; children = ( - 200D10EB20F0397D47F022B50CF0433F /* Alamofire */, + 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */, ); - name = Pods; + name = iOS; sourceTree = ""; }; 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */ = { @@ -328,48 +321,44 @@ isa = PBXGroup; children = ( 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */, - 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */, + 51A9B78D6A7E7FB5A465754528750815 /* iOS */, ); name = Frameworks; sourceTree = ""; }; - 6D8231D013B59DBC75D89B4D4FC1781D /* Swaggers */ = { + 60558172C46150B1CC244DFD7F495889 /* Support Files */ = { isa = PBXGroup; children = ( - 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */, - 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */, - 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */, - C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */, - 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */, - 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */, - 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */, - 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */, - 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */, - 79B0B5EF51D76393D11143FD83D1F224 /* APIs */, - BDF2B05EE3EDF246153D7BDD1A3D065A /* Models */, + EB834CA4A0478028D959D9EBD119D953 /* Info.plist */, + 2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */, + FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */, + 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */, + BA7C170F1E6A7A846F3D1C4BF9F78EAA /* PetstoreClient-prefix.pch */, + C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */, ); - name = Swaggers; - path = Swaggers; + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; sourceTree = ""; }; - 79B0B5EF51D76393D11143FD83D1F224 /* APIs */ = { + 7C3C4943F0B3A9E87CCF23AA96272CB5 /* APIs */ = { isa = PBXGroup; children = ( - 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */, - 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */, - 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */, - 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */, - CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */, + 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */, + 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */, + 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */, + 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */, + 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */, + 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */, ); name = APIs; - path = APIs; + path = PetstoreClient/Classes/Swaggers/APIs; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, + EDE36CDEEF568DD818B58A28C3C0DA80 /* Development Pods */, 59B91F212518421F271EBA85D5530651 /* Frameworks */, 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */, 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */, @@ -377,12 +366,24 @@ ); sourceTree = ""; }; - 7EB15E2C7EC8DD0E4C409FA3E5AC30A1 /* iOS */ = { + 80845DB4F55E7613E45819034AAA6B0F /* PetstoreClient */ = { isa = PBXGroup; children = ( - 3F9B2E024A80A62FE090406312870D33 /* Foundation.framework */, + 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */, + A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */, + 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */, + 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */, + 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */, + F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */, + 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */, + DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */, + 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */, + 7C3C4943F0B3A9E87CCF23AA96272CB5 /* APIs */, + B7C7CFA5065F490C632218EDF496EB25 /* Models */, + 60558172C46150B1CC244DFD7F495889 /* Support Files */, ); - name = iOS; + name = PetstoreClient; + path = ../..; sourceTree = ""; }; 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { @@ -403,20 +404,6 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { - isa = PBXGroup; - children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */ = { isa = PBXGroup; children = ( @@ -428,48 +415,48 @@ name = Products; sourceTree = ""; }; - BDF2B05EE3EDF246153D7BDD1A3D065A /* Models */ = { + B7C7CFA5065F490C632218EDF496EB25 /* Models */ = { isa = PBXGroup; children = ( - 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */, - 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */, - 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */, - 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */, - 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */, - 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */, - 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */, - BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */, - C21C617FCA30726E782E8A67D0149138 /* Cat.swift */, - F69BC1C993ED1722CE6D63E07381785E /* Category.swift */, - D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */, - E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */, - 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */, - 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */, - 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */, - 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */, - 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */, - 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */, - 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */, - 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */, - 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */, - 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */, - 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */, - E80F4034540947434A69B02246F8ABBD /* Order.swift */, - 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */, - 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */, - C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */, - E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */, - EA8F6D8048F257672069D2008983C66D /* OuterString.swift */, - DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */, - 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */, - 56F57C400928D9344121036AC8E4220D /* Return.swift */, - 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */, - 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */, - 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */, + C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */, + 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */, + C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */, + C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */, + 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */, + 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */, + 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */, + E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */, + 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */, + 7417953898146193F86A165CD5F3AF4A /* Category.swift */, + C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */, + 5B8F990A8905B95231C6D1955750D23C /* Client.swift */, + 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */, + 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */, + 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */, + C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */, + 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */, + B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */, + 8B87E0BA794A79025212F37D32449C63 /* List.swift */, + DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */, + 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */, + 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */, + 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */, + 24D3039E712D1279434152E805AEDA65 /* Order.swift */, + 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */, + 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */, + 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */, + 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */, + 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */, + E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */, + 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */, + 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */, + C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */, + 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */, + C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */, ); name = Models; - path = Models; + path = PetstoreClient/Classes/Swaggers/Models; sourceTree = ""; }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { @@ -499,23 +486,12 @@ path = "Target Support Files/Pods-SwaggerClientTests"; sourceTree = ""; }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { + EDE36CDEEF568DD818B58A28C3C0DA80 /* Development Pods */ = { isa = PBXGroup; children = ( - 02E57F930C8EDC9AD0C9932B5CAD1DC8 /* Classes */, + 80845DB4F55E7613E45819034AAA6B0F /* PetstoreClient */, ); - name = PetstoreClient; - path = PetstoreClient; - sourceTree = ""; - }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, - ); - name = PetstoreClient; - path = ../..; + name = "Development Pods"; sourceTree = ""; }; /* End PBXGroup section */ @@ -529,11 +505,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 2EA2C52BF67117065AE36B4A6D8D6377 /* Headers */ = { + 977FD2449A760A426BC92AD40BF0FAE9 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 75332AEFA1C56AD923C581FB7CC4B580 /* PetstoreClient-umbrella.h in Headers */, + 9067B627206EA4FFE8E94388031FBB70 /* PetstoreClient-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -575,39 +551,39 @@ productReference = 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */; productType = "com.apple.product-type.framework"; }; - 872AA614769F12C7EFF56226C25D2EE5 /* PetstoreClient */ = { + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { isa = PBXNativeTarget; - buildConfigurationList = 5F49FB411DAA9B738ED9CDC2D3A52892 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; buildPhases = ( - E4E9EABE96879C615522F4577C46D492 /* Sources */, - 606C951710A3AAEA962F236422DE5D8C /* Frameworks */, - 2EA2C52BF67117065AE36B4A6D8D6377 /* Headers */, + 32B9974868188C4803318E36329C87FE /* Sources */, + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, ); buildRules = ( ); dependencies = ( - 79FA2B89589FCBFA2C873E411E00D832 /* PBXTargetDependency */, ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */; + name = Alamofire; + productName = Alamofire; + productReference = 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */; productType = "com.apple.product-type.framework"; }; - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { + F273DBB2E19E2286018971F2B25DEB52 /* PetstoreClient */ = { isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildConfigurationList = 0E45B203539274106092021633F5C54E /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - 32B9974868188C4803318E36329C87FE /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, + CCAD31695209FE4A1313C16F1B7A220D /* Sources */, + 2D7583F1D86C34DDA26383E3BD322469 /* Frameworks */, + 977FD2449A760A426BC92AD40BF0FAE9 /* Headers */, ); buildRules = ( ); dependencies = ( + 14D50D2534F42D5E57F9341C234C9364 /* PBXTargetDependency */, ); - name = Alamofire; - productName = Alamofire; - productReference = 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */; + name = PetstoreClient; + productName = PetstoreClient; + productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */; productType = "com.apple.product-type.framework"; }; F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */ = { @@ -633,7 +609,7 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; @@ -649,7 +625,7 @@ projectRoot = ""; targets = ( 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - 872AA614769F12C7EFF56226C25D2EE5 /* PetstoreClient */, + F273DBB2E19E2286018971F2B25DEB52 /* PetstoreClient */, 41903051A113E887E262FB29130EB187 /* Pods-SwaggerClient */, F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */, ); @@ -698,79 +674,80 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - E4E9EABE96879C615522F4577C46D492 /* Sources */ = { + CCAD31695209FE4A1313C16F1B7A220D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 94B455FDE2B057DB680F439EA3FD1B49 /* AdditionalPropertiesClass.swift in Sources */, - 24FFD130F7E23492281B79C5C678F00D /* AlamofireImplementations.swift in Sources */, - C05B6F5687193D4F8C45A876DD05D53E /* Animal.swift in Sources */, - 8CBE860E26B3E63F905AABB8C2ED8408 /* AnimalFarm.swift in Sources */, - 785570E189782F883FC7F30096107F05 /* APIHelper.swift in Sources */, - 700AFFD25A3F79F704E1F48E1090C719 /* ApiResponse.swift in Sources */, - A6546161061DFBD9AD9CD2669B3407DD /* APIs.swift in Sources */, - F9B80B148598B14AF1EFC8C590CDA38B /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 9DF1DB10A8D8AD5D760AD2119464BBFA /* ArrayOfNumberOnly.swift in Sources */, - A73E115FCBAE1F29A37D5327AE87AAB8 /* ArrayTest.swift in Sources */, - 97809A3EC41B70910367804F24749488 /* Capitalization.swift in Sources */, - 798B0EDE6CDDDFA67A576CC5D7356197 /* Cat.swift in Sources */, - 2DEA81B2292287FEE1BC4A520801F675 /* Category.swift in Sources */, - 0D33BB30417B9584629B6D880037AA2B /* ClassModel.swift in Sources */, - 804A773AC1F6CAD0833113365C437ED6 /* Client.swift in Sources */, - 9ED1C3E564D542971480A55F74192BA2 /* CodableHelper.swift in Sources */, - 39755FB5994F45FBD67C9ADFD5915EF2 /* Configuration.swift in Sources */, - 079F2BD52F24416F7C5A53877F54566A /* Dog.swift in Sources */, - 1151CDE98B5CB5F152ED39BF798EF5CF /* EnumArrays.swift in Sources */, - A19592FE4371E4FCDAAB8AEE09AB93B9 /* EnumClass.swift in Sources */, - 1B13BFD9084781D7ED2E079E6BF2C557 /* EnumTest.swift in Sources */, - D9657D5FFD53727FA47D8C6E8EE258A3 /* Extensions.swift in Sources */, - 1CFDE72D9E7E9750A9ADE03AB4669311 /* FakeAPI.swift in Sources */, - 4378EAAAA7D2FDACD110A1ED9D2FED5F /* FakeclassnametagsAPI.swift in Sources */, - 2D5A60538984183CDF16344E07DE6016 /* FormatTest.swift in Sources */, - B0A93172B99BF60154ED6242AFBE4026 /* HasOnlyReadOnly.swift in Sources */, - A563CBF0CB0A2D620BCE488727AFE9BC /* JSONEncodableEncoding.swift in Sources */, - 154A6488A4E591935A82473995C15AE4 /* JSONEncodingHelper.swift in Sources */, - F37C6CFB2C08C9727ABCBD83044789EE /* List.swift in Sources */, - FA158D72EECF92FF935BB38B670E6CFE /* MapTest.swift in Sources */, - 22FDE110EA91A85020A5B47486558282 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9D4EC73C4EC0F4CA643BFB0F744E206E /* Model200Response.swift in Sources */, - 4E168284FE74373DE791FA46610F6E85 /* Models.swift in Sources */, - 858A507A04D7EBD392B5E38BFA5C0FB1 /* Name.swift in Sources */, - 98A62599B00ECECEE6693F10291DCA8E /* NumberOnly.swift in Sources */, - 8B3DB4230FDB986C273707551D5C098D /* Order.swift in Sources */, - D319019CE9A48494F3ED480F1226517A /* OuterBoolean.swift in Sources */, - 342645FD19CD3977B12C869E662DF658 /* OuterComposite.swift in Sources */, - 253BED146B97E5F268DB986D0EC87081 /* OuterEnum.swift in Sources */, - 97D4E3413AADDB57435C6E01E40F1737 /* OuterNumber.swift in Sources */, - EE614419EAB1923DFB520AE1E35D4D54 /* OuterString.swift in Sources */, - 4AE57833EC2315CC8EDA4864CAD7382B /* Pet.swift in Sources */, - A7F2C30678B7926A18C64F71A5CFDB3E /* PetAPI.swift in Sources */, - D102CB4FA078626BF684F476910012A1 /* PetstoreClient-dummy.m in Sources */, - 27BF2E059FCCB3CDA349738B75A9EDD3 /* ReadOnlyFirst.swift in Sources */, - D000C65F968C44B544101279E763C0C9 /* Return.swift in Sources */, - A63D913EAA7D50833B860D9FB011E761 /* SpecialModelName.swift in Sources */, - 491FD17DCEA4455874451D174A9A182E /* StoreAPI.swift in Sources */, - 7EA0B4343115F6BD6062C1A3C5924380 /* Tag.swift in Sources */, - 483C65BB55BCA70C8B65BBD266151A1C /* User.swift in Sources */, - B746D752789DABA80AC0ABF066B719BB /* UserAPI.swift in Sources */, + 2B1BE5C3FED4683F31A1DA3E4D4FE6C6 /* AdditionalPropertiesClass.swift in Sources */, + 82F7587E619353285C601A5677961853 /* AlamofireImplementations.swift in Sources */, + B384569B4208ADC0A68233491ED19609 /* Animal.swift in Sources */, + 3E11073F08C80332AEFC3A10FC489313 /* AnimalFarm.swift in Sources */, + 2D208564DFB2C2849316BD87AA3F53AC /* APIHelper.swift in Sources */, + DE8F9190013C0FECA7C3413F214B2BAB /* ApiResponse.swift in Sources */, + 9F4FF785FA604AD3A70C4B87FA0ED450 /* APIs.swift in Sources */, + 74E60841671B65510C2E9DBD34EDD96B /* ArrayOfArrayOfNumberOnly.swift in Sources */, + E0C687FEA77962F5E1CE2D4347246984 /* ArrayOfNumberOnly.swift in Sources */, + B4D9507C3602C7D37EB6F7B88269CD52 /* ArrayTest.swift in Sources */, + E0B2924D681BAA663ADE94DC43706E3D /* Capitalization.swift in Sources */, + 90D416A6F921DADEF05F65AFF7E1E5B0 /* Cat.swift in Sources */, + 4814A739814A3809C4D9C61F96012C62 /* Category.swift in Sources */, + 2B22A023463A6CF04BB1BFF869D30AC6 /* ClassModel.swift in Sources */, + F81E110F1F9AAD6C448DCF5DF99C2F41 /* Client.swift in Sources */, + 3B0E9022805FED1731E3C6474C700253 /* CodableHelper.swift in Sources */, + 5E38839B97A3FB54831CB0CE3B177E06 /* Configuration.swift in Sources */, + E6A0A5C14D3633FFE1551CFDE39FA4C3 /* Dog.swift in Sources */, + 0F662FA5B2EB748EA516B8C83742DE29 /* EnumArrays.swift in Sources */, + 9145FC4EDCAF00080761172112D6B4E1 /* EnumClass.swift in Sources */, + 1982792C8B5D5B4999228D16CDBE3E28 /* EnumTest.swift in Sources */, + B65AABE5C7EB03365333C4783B36CCDC /* Extensions.swift in Sources */, + 472DF233EF1CA028A52DB57F87A5687F /* Fake_classname_tags123API.swift in Sources */, + 7EE07906770CB8D69F00429072D7DC02 /* FakeAPI.swift in Sources */, + FBB089E4407481B7A92F96EEC803A04D /* FakeclassnametagsAPI.swift in Sources */, + 4CBD58C64013924FB5A74A106D838285 /* FormatTest.swift in Sources */, + F9884BC36100EA0FC9AAABAC5D4A0371 /* HasOnlyReadOnly.swift in Sources */, + 8158ED5AEE2D6FE60EBA456F691D823C /* JSONEncodableEncoding.swift in Sources */, + AAEFA9B66A1EE281AA8D76AC0DCA3C97 /* JSONEncodingHelper.swift in Sources */, + BA15A21EB63AC8A5B7B859AC8D6E7B23 /* List.swift in Sources */, + 9B73E49DCB45F1F471FA4DE8264BA512 /* MapTest.swift in Sources */, + EDFB99BED377CAB8D24E0256E1208BD1 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 973AF350C705E18926C330359F0DAC29 /* Model200Response.swift in Sources */, + 24F9EAC555D87891496C9873A3A353BC /* Models.swift in Sources */, + 55F9C83CA76F9B2DA873122BEC278855 /* Name.swift in Sources */, + 7A854DC997BF3D7E3449FF58278EC967 /* NumberOnly.swift in Sources */, + 363930DE8DE4B17D8EF901F5C249A9AC /* Order.swift in Sources */, + F1ACDB1E74FDDF4609EA027BB6D5C9D8 /* OuterBoolean.swift in Sources */, + 707F832EEA6E7DD274201962E4D85B5B /* OuterComposite.swift in Sources */, + CA6B474618AA720ABFB571F69B227AF7 /* OuterEnum.swift in Sources */, + EA063534695F7232C7E7FF9C5A61483A /* OuterNumber.swift in Sources */, + A0F161A5D21EFF05B0208B7C1B6C3C67 /* OuterString.swift in Sources */, + E05C5957E89CE7129CC4880299444A81 /* Pet.swift in Sources */, + 8A4C36FD6B751F6F87BFC6C4E01DD793 /* PetAPI.swift in Sources */, + 7D99F1CDFA55B21CBDB1603DA46C0599 /* PetstoreClient-dummy.m in Sources */, + 5EC075C471A4F4D9A43857B8629D95EE /* ReadOnlyFirst.swift in Sources */, + C888F5D0484D08C3F110B48DF18DDFD6 /* Return.swift in Sources */, + 281150C5E93967FEA2D3921AEC92BA3D /* SpecialModelName.swift in Sources */, + 127354085F10006D6B57C16D3AE2E043 /* StoreAPI.swift in Sources */, + 857A7B68378E7164FD99F549C092436E /* Tag.swift in Sources */, + 4DF5B60FEFEAC2BA370EE79D2567B3E9 /* User.swift in Sources */, + 39C0CB11CA9812CD5BB73A893D27BEE9 /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 14D50D2534F42D5E57F9341C234C9364 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 53846F4D999F8096A92BE0AB60034710 /* PBXContainerItemProxy */; + }; 374AD22F26F7E9801AB27C2FCBBF4EC9 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PetstoreClient; - target = 872AA614769F12C7EFF56226C25D2EE5 /* PetstoreClient */; + target = F273DBB2E19E2286018971F2B25DEB52 /* PetstoreClient */; targetProxy = 398B30E9B8AE28E1BDA1C6D292107659 /* PBXContainerItemProxy */; }; - 79FA2B89589FCBFA2C873E411E00D832 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = DD169196715C246D6848CD38092BCBFE /* PBXContainerItemProxy */; - }; AC31F7EF81A7A1C4862B1BA6879CEC1C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Alamofire; @@ -780,10 +757,11 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */ = { + 077C4BB7DBEAA715DED46C057DC8051C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -805,6 +783,8 @@ PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -812,15 +792,16 @@ }; name = Release; }; - 42A81EAE5BACD74C1473CE27A30E0600 /* Debug */ = { + 1FDD9BDA3D686D0B50227E3667FE27BB /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -833,22 +814,117 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; + name = Release; + }; + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; name = Debug; }; - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */ = { + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 86E66B7CE6321797D5D4EB3E7593B23B /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -874,6 +950,7 @@ PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -882,10 +959,11 @@ }; name = Debug; }; - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */ = { + 8ABD810FE320ED013B51DFEA7CBA6A0D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -911,6 +989,7 @@ PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -918,130 +997,46 @@ }; name = Release; }; - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */ = { + 91CAE672CBB3E023C8A80A82BB928A22 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; + baseConfigurationReference = FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; - }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; name = Debug; }; - C17C4519E8C8AFCD2A0153817F672A34 /* Release */ = { + C66477B6E5656B1F4785FD5D9546905A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1053,14 +1048,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PetstoreClient; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; @@ -1070,10 +1069,11 @@ }; name = Release; }; - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */ = { + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1085,20 +1085,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1106,10 +1104,11 @@ }; name = Debug; }; - F383079BFBF927813EA3613CFB679FDE /* Debug */ = { + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1121,17 +1120,20 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Alamofire; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1142,38 +1144,38 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 0E45B203539274106092021633F5C54E /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, + 91CAE672CBB3E023C8A80A82BB928A22 /* Debug */, + 1FDD9BDA3D686D0B50227E3667FE27BB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - F383079BFBF927813EA3613CFB679FDE /* Debug */, - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */, + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */, + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - 72DE84F6EA4EE4A32348CCB7D5F4B968 /* Debug */, - 82D3AD5A5FD240EEC1B1FEFF53FE2566 /* Release */, + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */, + 077C4BB7DBEAA715DED46C057DC8051C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5F49FB411DAA9B738ED9CDC2D3A52892 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 42A81EAE5BACD74C1473CE27A30E0600 /* Debug */, - C17C4519E8C8AFCD2A0153817F672A34 /* Release */, + 86E66B7CE6321797D5D4EB3E7593B23B /* Debug */, + 8ABD810FE320ED013B51DFEA7CBA6A0D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1181,8 +1183,8 @@ B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */, - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */, + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */, + C66477B6E5656B1F4785FD5D9546905A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h index 02327b85e88..00014e3cd82 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig index 772ef0b2bca..619e5f4acef 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h index 435b682a106..2a366623a36 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig index 323b0fc6f1d..904973a3bdc 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -6,5 +6,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh index d3d3acc3025..4d253d90186 100755 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -84,10 +102,13 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h index 2bdb03cd939..b7da51aaf25 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig index a5ecec32a87..ad32982f5bf 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig index a5ecec32a87..ad32982f5bf 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh index 893c16a6313..88dd5379907 100755 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -82,3 +100,6 @@ strip_invalid_archs() { fi } +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h index 950bb19ca7a..b2e4925a9e4 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig index d578539810a..a3871374db0 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig index d578539810a..a3871374db0 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 2728b93f24d..1406071ba7e 100644 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -313,9 +313,14 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -373,13 +378,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */ = { @@ -388,13 +396,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */ = { diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec index f6c991f53d2..c7fe7969a40 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec @@ -9,6 +9,6 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'PromiseKit', '~> 4.2.2' + s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' s.dependency 'Alamofire', '~> 4.5' end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock index 2ecaf7a82b0..fa4d4714cb9 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock @@ -2,18 +2,8 @@ PODS: - Alamofire (4.5.0) - PetstoreClient (0.0.1): - Alamofire (~> 4.5) - - PromiseKit (~> 4.2.2) - - PromiseKit (4.2.2): - - PromiseKit/Foundation (= 4.2.2) - - PromiseKit/QuartzCore (= 4.2.2) - - PromiseKit/UIKit (= 4.2.2) - - PromiseKit/CorePromise (4.2.2) - - PromiseKit/Foundation (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/QuartzCore (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/UIKit (4.2.2): - - PromiseKit/CorePromise + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.0) DEPENDENCIES: - PetstoreClient (from `../`) @@ -24,9 +14,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: dd4a9f18265468d1f25e14ed1651245c668448c3 - PromiseKit: 00e8886881f151c7e573d06b437915b0bb2970ec + PetstoreClient: 8c88e8c9531ace21041af9c85942deac3ba99104 + PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json index e171d315138..8feb1b62368 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -13,10 +13,10 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", + "source_files": "PetstoreClient/Classes/**/*.swift", "dependencies": { - "PromiseKit": [ - "~> 4.2.2" + "PromiseKit/CorePromise": [ + "~> 4.4.0" ], "Alamofire": [ "~> 4.5" diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock index 2ecaf7a82b0..fa4d4714cb9 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock @@ -2,18 +2,8 @@ PODS: - Alamofire (4.5.0) - PetstoreClient (0.0.1): - Alamofire (~> 4.5) - - PromiseKit (~> 4.2.2) - - PromiseKit (4.2.2): - - PromiseKit/Foundation (= 4.2.2) - - PromiseKit/QuartzCore (= 4.2.2) - - PromiseKit/UIKit (= 4.2.2) - - PromiseKit/CorePromise (4.2.2) - - PromiseKit/Foundation (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/QuartzCore (4.2.2): - - PromiseKit/CorePromise - - PromiseKit/UIKit (4.2.2): - - PromiseKit/CorePromise + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.0) DEPENDENCIES: - PetstoreClient (from `../`) @@ -24,9 +14,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: dd4a9f18265468d1f25e14ed1651245c668448c3 - PromiseKit: 00e8886881f151c7e573d06b437915b0bb2970ec + PetstoreClient: 8c88e8c9531ace21041af9c85942deac3ba99104 + PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 -COCOAPODS: 1.1.1 +COCOAPODS: 1.3.1 diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj index 4d0503356d1..83257ca4cb5 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -7,558 +7,475 @@ objects = { /* Begin PBXBuildFile section */ - 0000257E6138186889F38B8A7F797C33 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */; }; - 003F98B2C041FC1DE84490CDB4598F89 /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0097805BEFC942B10049FCF37ED24E0D /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */; }; - 0298FFF35BEF4948A42E55756D7C81A8 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */; }; - 0323E3530C2A481A0C10B0EBB7DCD2E4 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */; }; - 032C9FCA8EA6C8553275B1F7641A1CD8 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */; }; - 04364ACE71EDEA482E970EDC82ED01B9 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */; }; - 050D8EBD37B9EBC551614518F5C70CF2 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */; }; - 0AF188BAD0E51575891ACE80B0BA6AE9 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */; }; - 0DF2F6645EE3AB16827B6212F6DEDFDA /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */; }; - 109135A9E832B6E00D3258B9A7A95D2E /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */; }; - 14FA5791C21B38B5D90017F182AA77C6 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */; }; - 173A377B378B75AADE06A397128BC8AB /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1870983702DCF95885BECDBF3E5757E3 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 18F9B7517B71D53CC011E7F88676B527 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */; }; - 197CBB45FF699E91B3E8DEDFCD596612 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */; }; - 1B50D83C35A942533A18AA3AF0A80421 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1D3E8E496572E1D4244811D5A3973171 /* NSURLSession+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1D670869022E7C0EA2DEE5155BD1864A /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */; }; - 1DA594AF0F2972E05DF99942E216377A /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */; }; - 1EFA4EB14D39ED739309A086ECEA8906 /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */; }; - 1F6BD2584EF72ECAA323B94528BE7992 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */; }; - 1FB6E55D4CD4F11D4D7C8722E8C33A42 /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 00E45C819B259C722DA2BF90EE63DDE6 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */; }; + 02650248013496C5AB857B869C562661 /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0B974B8BCA617D23C87619DADD37D39B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */; }; + 0BC6EA4CC7B942917A160339B54748B6 /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 47F1D5162720B2001CA614017A1ACE90 /* join.m */; }; + 0E4F6AB01CA15D7ACE27641BA3803ACE /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */; }; + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */; }; + 1392D80ECC22365B4831BC95032F0F0B /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */; }; + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F4886332EE9958B4953893705FF9246 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */; }; 20E2CC1FD887EC3DA74724A32DDA1132 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 22980ADB7D228364F99E8EA145509B4F /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */; }; - 2642DF6CB39C87B120397F5C178010F9 /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */; }; - 286FDA09B99338DDAE8AEEAF3D2769FA /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */; }; - 3064A0BD79720BAD39B0F3ECD5C93FFA /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */; }; - 30B8557D047D60B5F8332BCE95DD693E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */; }; + 21E703668E91D10CECB8BBE59650D58F /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */; }; + 2AA4FCEA014BFBBBD56C909C02B98A77 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */; }; + 30F26AB48B6038D292000A176A0A25D2 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */; }; + 3149FCFDA10385D31F93F2F781AA34D0 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */; }; 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3312221F642766FE185B9B697A8BAE4B /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */; }; - 33457D935182159E14829CE7BEEBDD6D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */; }; - 3440FB38AAE8B9EA4CDCEE98B931B524 /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */; }; - 3DAA524BB89E475536B71207F5F2C0F5 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */; }; - 3F034997ED7849F2C6CC86D5B8C50BC1 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 465DC8B52B3D7D0585D772ED29683D3E /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */; }; - 468BB42B90797F64A371FDE8C7185AF4 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */; }; - 4E482819CF1AD28A5960095805A803ED /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */; }; - 508395CE75541C444206B78E2E94F435 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */; }; - 53A8D9F8E089D32918F3A5843ADDC26A /* PMKFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 545C5A303A209C2C009E242F9D310001 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */; }; - 57451FA0255A49DEBAEB885DD0658750 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */; }; - 5765C7B9F6084011161DA2267C2A0B57 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 578E746892610EA4B83D264A05D6FC60 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */; }; - 5909B4BACAF8557FE13B325FA529BE57 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */; }; - 5BE1865A8083F6AD7AE7DCFE51E58891 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */; }; - 5CBC2597C5EED08A74430DD6E8C3C9C5 /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */; }; - 5D63858F4E9812FAAF772FFDCB4ACE45 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */; }; - 6084F899BF2E35FD09D072A5C0394BD3 /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */; }; - 622B5DBF5E128A33315BE8EFF05792EA /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */; }; - 6A47436E31CAD703E4ABB641F80FC7DF /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = F69BC1C993ED1722CE6D63E07381785E /* Category.swift */; }; - 6CE003919AF6139793694D58ADFAF9E6 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */; }; - 6DCD351570B86AADFD4BF754096A2DAE /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */; }; - 6FA5895264E0223B0A016644C59C6046 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */; }; - 77F4CFE0094EBDC63B49257B074C936B /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */; }; - 7878FCD0D2F00BCD00002F6BD6E297A7 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56F57C400928D9344121036AC8E4220D /* Return.swift */; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */; }; - 7E40C3A7DBC7306738AC9E27C734C25E /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */; }; - 7E60F24604C0F467F63D451E410390D8 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */; }; - 7F1456C9A2A6684F13FD1B5A1DFD7E74 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */; }; - 7F4DA286C82EE5687AFC2FE1B7C60292 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */; }; - 81DF78F6697313B98D66D012475E8067 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 825645C19A9BDB1D138D5DFDF69C143A /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86463DE0FB886D57EFACE9747D72E1E6 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; + 32495BBAAED67B464B26E37EFC43BFAA /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */; }; + 34104D7277F8474FCBB80637A8364337 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */; }; + 34C9317929C1DA5F022B5AEC56DED275 /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */; }; + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */; }; + 36C43C6EB14FFC6C23618D2EE8C6D64B /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */; }; + 38C508C4B73F4EEF12972C4DEBBB59BD /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */; }; + 3A6675715B2BD21963134EE7CB699FEE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 453006CD439DABF8B2B378F4A40AC1CA /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */; }; + 46C3E70BD716E72351EA9828A496E59A /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6251246DA0044C165AC891CDE64344 /* hang.m */; }; + 4CEC13EBEA756DB01D9EDD495477148E /* OuterNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */; }; + 4D46B19B21C17385C251DBFD6B5CC9B5 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */; }; + 4E875FE97DC4CFCD45EF180B1930BA87 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */; }; + 50FC50E41FA283FD8EACEED8EB7CC15C /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */; }; + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */; }; + 5491C5AA65355E89637F78928E52D24C /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8F990A8905B95231C6D1955750D23C /* Client.swift */; }; + 5742106D27D324737B72F32CBAC98924 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */; }; + 58F07EB0BF05A369A3952852632562F6 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */; }; + 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 60E0243A7018DE1E7755825685D30151 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */; }; + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */; }; + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */; }; + 669789618901F2B104F686A8A44E4F23 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */; }; + 6939CF29A58F770558A46D229F33CDEF /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */; }; + 6FABE818191D2C7497B657CB717435A9 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */; }; + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */; }; + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */; }; + 7DBDDA5406CB59867FC877F1032BC905 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */; }; + 7F7153A9E140DB803EFB19D4C3D2408A /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */; }; + 812B1864BB988DE4C71DE5755B9A7D1C /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24D3039E712D1279434152E805AEDA65 /* Order.swift */; }; + 85543B6F540EED8FFF82015FED6CB68B /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */; }; + 8591B80B88C9A955D3E898EEF9DA71E1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + 8628572254ED43AD0FB157E20D3B6DCF /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */; }; 8740BC8B595A54E9C973D7110740D43F /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; + 878E6E228B4A3D2725656142AA379D7F /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */; }; + 884B23FB0C4EA228B4694F191D531090 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */; }; + 888EF901304106608916A05E6EC6A0A0 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */; }; 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 8C1BEB026BACC90CE05F5DA21C8CFF67 /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */; }; - 908D609C8BB8E370E1A3C03D05F0A23C /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */; }; - 95630631BB8BFEB5540B6CF0C5D029E2 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */; }; - 960FAEEAEDD7034D1E1B0D5B5AB43088 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05F43847135C8DA403312FBEDB1F49F /* after.swift */; }; - 99C82D0F8CF5B60591EF533A62F0E10A /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80F4034540947434A69B02246F8ABBD /* Order.swift */; }; - 9CBC2DEF8C73F54A32071F82D8F12DF5 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */; }; - 9F31C123624CA2B1C281D5F975EDE616 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - A04DA97EEE7A057FC4EDA1D95309E9A3 /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */; }; - A22E02C8FB1A44C7AAFED7E121904807 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */; }; - A81AD325D55AF5D8972809300D8F36E5 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */; }; - AA72696A13BD17947CAEDA22B0C89372 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */; }; - AB0054D02002325BD7DF0BE3FD742D9C /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */; }; - ADF417E7FD14C452F475C4328B1661C3 /* PMKUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */; }; - B0D0A8D9EB7248222E444C3004709BB4 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B2CF10965316B20D0BB59BDEC2AB0131 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943618599D753D3CF9CEA416875D6417 /* Validation.swift */; }; - BC1063342B57CB4A07D50F277CAC4783 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */; }; - BD80FDBAC0BA32059AE47295D91CA7D5 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */; }; - BDEA72204E0F3D235E5B0950762CC3DF /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 152E92E58DF288044CE0369CD8522B52 /* when.m */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */; }; - BFAD00B3B746E0E08E9155FF4E84F24A /* NSTask+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C4450B687C7F4706A5E8ADD7826A85 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - C0D858800E557D0A38D2E61CB98523F3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - C2432D8D7746A8E8DCA5B602151C42E4 /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */; }; - C764F495BF6DFEBE52AFD13FDFB8E77F /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */; }; - C80991D67ADACC9C48704248AC151933 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */; }; - C8DC229B790728AF1D8DBE1C9DBC4149 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */; }; - C9D7613956EB06CD6E42B97ABEC9B673 /* PMKQuartzCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CA4691ACA6280C902F0B1EA26C33A367 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5021828D3563560F50658622F55322A /* Response.swift */; }; - CFFAD4C93D9A9D8455B4D4C18FFE8055 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */; }; - D2451BD00C9ED3883D70BDDE178EAE89 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - D67D0F8EB46ED3C4256F87DF09186EEA /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */; }; - DA76C2A4D3AB587E749A0F66577E9304 /* NSURLSession+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */; }; - DBDF86E562197D5CD9642080A12A5BE4 /* NSTask+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */; }; - DC594EF39ADAFC9B59E1DE1A9BE58D97 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C21C617FCA30726E782E8A67D0149138 /* Cat.swift */; }; - DDEE5C6AA270829DE886561F304A4824 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */; }; - E3EC746788D5F275062D0285A256889F /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4655B4C1707E9902435774C9B1981618 /* Error.swift */; }; - E58EC13E8E0CD973265C55501616B315 /* Process+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */; }; - E59910F3BA3F43E74B24DC9AE4612B88 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */; }; - E76FE98378C097EE9C5A718F5BD2F581 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */; }; - E856B555D4283924AE496FB9A447189A /* OuterString.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8F6D8048F257672069D2008983C66D /* OuterString.swift */; }; - E9709BDE6A967F82A034B01DD832123C /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */; }; - EB1F02E78667DE59E495E496FFEFC8CB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */; }; - F08AFEBD1802D01C74266BF23F184138 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */; }; - F45D65E76C21F99D26C25A71AE5566DD /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */; }; - F4FD458A3DA6D643C08F837463C11B79 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */; }; - F9A79B29AC1077DE04896B7C0ED7FEF7 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */; }; - FC3CD5AA2DA8A499EB23571E14325F13 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */; }; - FD795A688F4488A09DC07632E6280D8C /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */; }; + 95DD56D8244A0F779EA3D24617389DFA /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7824BE1937712800889974B222CAB1AD /* GlobalState.m */; }; + 9621FE3846B399A31C9D874A68B814EA /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 98859B984F0B8D1BA8C419626A541DDF /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = E775A7621846699F1A762DB966B3DC48 /* State.swift */; }; + 989A8D9C15575595501B0525EA04B7C4 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */; }; + 9DCADBA52F4BA9C2BCDD2AD9FC39291E /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */; }; + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */; }; + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */; }; + A3B4F53480EF96400D782F3507A42573 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */; }; + A6FAEDD331C7E9BD959076F2CC466B5A /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */; }; + A7803F0032BE57E83C9E1CC15442058E /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */; }; + A9A1683640F2AEEE1463B4564735F52C /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */; }; + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */; }; + AA022DF933E15BC6AF9A8C157370CF96 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */; }; + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */; }; + AF0CAB7D38117E91D76835CE62FE9530 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */; }; + B319CCF9C8F0F08FADAEA89F9655B54E /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */; }; + B40BA9338A0622CC69161949F42E0ADE /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */; }; + B65BFA719D8195A2FAA0E067DE5A6DA4 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */; }; + B6FE8649C8F2D879752D6CC0BAA7D8D3 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */; }; + BA9D88BD67EA9ACBDE9FEBF06E4FBD4D /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */; }; + BB3C554F09627EA5E6E36084E4AA5545 /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */; }; + BE111800D151B74E9EB6CFFA5375A378 /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */; }; + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */; }; + C2C77FE3B30FA828B5A6F8611C84AB03 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */; }; + C36D10DCACB58234D9ADAE75457BB1F7 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */; }; + C57A01A8A02024DD3C4F013AB8F41F71 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */; }; + C77EFC1A12788F4EC02C8F08DF687A1B /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */; }; + C807A7AC785D77909FF2288E66669889 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */; }; + C9004CA15837C724215DE3E1A7AB42AB /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */; }; + CAA786E247A67408ED8FDDD3BD9EACC3 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */; }; + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */; }; + D5275BCBC0725D755D5945A9AB6C5A40 /* FakeclassnametagsAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */; }; + D54935D8A773E7BC8DED0861487D5CEB /* OuterBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */; }; + D6184AB54A12F4F580FE7766FFD1A491 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22932972F4F492160D4694C01CAF311D /* Promise.swift */; }; + D9FEE02D3C00097A882DCF9AF60C4FDC /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */; }; + DBC481AC7EB3A4F2E547F52BAF547922 /* Fake_classname_tags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */; }; + DBFDFCF61E2F2C7A49FD50B9222E3495 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7417953898146193F86A165CD5F3AF4A /* Category.swift */; }; + DDF666793202988950DA52A8C528C076 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */; }; + E52BCAD4A070EEAA1EA08F2D299F4EDB /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */; }; + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; + E80880F475CC14AFB6795F1451DDE2B4 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */; }; + E86EED1FA38087909568DED335E7B9A5 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */; }; + E8AD4D7E49710B99BFD77E32C5EBFAE8 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E9783E1D3A6A0CD9CF2ACCA74A89CC8F /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */; }; + EF15BEAF1A002B97A226F9AF3D3C0F26 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */; }; + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */; }; + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */; }; + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */; }; + F9D35B36A805D504C9383C5743874D23 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */; }; + FC0B3667BB40C86FC84990EEDF29B534 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */; }; + FCB75043BDF47C08F944EFD06D4636D9 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */; }; + FD5C92BE0C43E605D5AED2BEE74BC595 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B87E0BA794A79025212F37D32449C63 /* List.swift */; }; + FE73D6A3B0670590535EC0D79F4F7246 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - B173CFF2A1174933D7851E8CE1CA77AB /* PBXContainerItemProxy */ = { + 0166D6CEA46A405AF6440470518778BB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = CD79A5D6FCA04E079B656EC73E0CF0A9; - remoteInfo = PetstoreClient; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; }; - BBE116AAF20C2D98E0CC5B0D86765D22 /* PBXContainerItemProxy */ = { + 2A6F85761AF8DEABF6BBF52FD80B83C1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; + remoteGlobalIDString = 05AABECB91CEE9C8C520680DDD9BA9AB; + remoteInfo = PromiseKit; }; - CB26706D98170EB16B463236FA3B7559 /* PBXContainerItemProxy */ = { + B173CFF2A1174933D7851E8CE1CA77AB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; + remoteGlobalIDString = BEF02C72A6656158D171985B49ABDD62; + remoteInfo = PetstoreClient; }; - D74571BD294009BB075CA105B3BA8274 /* PBXContainerItemProxy */ = { + BBE116AAF20C2D98E0CC5B0D86765D22 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = C7C5ED0DB8AF8EA86EC1631F79346F2C; - remoteInfo = PromiseKit; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; }; F4F5C9A84714BE23040A5FB7588DA6BD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = C7C5ED0DB8AF8EA86EC1631F79346F2C; + remoteGlobalIDString = 05AABECB91CEE9C8C520680DDD9BA9AB; remoteInfo = PromiseKit; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; - 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; + 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Process+Promise.swift"; path = "Extensions/Foundation/Sources/Process+Promise.swift"; sourceTree = ""; }; - 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; - 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 08BC2EAEE303ADCEB346C66DA76C7B56 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; - 0A0A7AF3E4D82A790BC8A16BB4972FA7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; + 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; + 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; - 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; - 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; - 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; - 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 152E92E58DF288044CE0369CD8522B52 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; - 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; - 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; - 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; - 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; + 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; + 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 17FF216D0378037475BAB48A20D5CB0F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 1F11D15E4489C7F4DC1171EB9F5448D0 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterBoolean.swift; sourceTree = ""; }; + 22932972F4F492160D4694C01CAF311D /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; + 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; + 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; + 24D3039E712D1279434152E805AEDA65 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PMKAlertController.swift; path = Extensions/UIKit/Sources/PMKAlertController.swift; sourceTree = ""; }; - 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; - 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + 2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; + 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Fake_classname_tags123API.swift; sourceTree = ""; }; + 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; - 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m"; sourceTree = ""; }; - 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; - 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.h"; sourceTree = ""; }; + 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 34E180DB9A06BFDDA525853716B57541 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/Swaggers/APIs.swift; sourceTree = ""; }; + 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; + 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/Swaggers/Models.swift; sourceTree = ""; }; + 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/Swaggers/Configuration.swift; sourceTree = ""; }; + 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; + 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 4655B4C1707E9902435774C9B1981618 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; + 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift; sourceTree = ""; }; 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKUIKit.h; path = Extensions/UIKit/Sources/PMKUIKit.h; sourceTree = ""; }; - 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 4C1356040CC9A1CCCED79A1A510AF74E /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Extensions/UIKit/Sources/UIViewController+AnyPromise.m"; sourceTree = ""; }; - 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Extensions/Foundation/Sources/afterlife.swift; sourceTree = ""; }; - 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; - 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; - 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 47F1D5162720B2001CA614017A1ACE90 /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; + 48CCB9793CCE13A24831B3E01B29171A /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; + 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 56F57C400928D9344121036AC8E4220D /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKQuartzCore.h; path = Extensions/QuartzCore/Sources/PMKQuartzCore.h; sourceTree = ""; }; - 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Extensions/UIKit/Sources/UIView+AnyPromise.m"; sourceTree = ""; }; - 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; - 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; + 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 5B8F990A8905B95231C6D1955750D23C /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; + 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; + 607281BBD24DC152F24F58E6046F4652 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; + 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; + 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Extensions/UIKit/Sources/UIView+AnyPromise.h"; sourceTree = ""; }; - 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSTask+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSTask+AnyPromise.h"; sourceTree = ""; }; - 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; - 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLDataPromise.swift; path = Extensions/Foundation/Sources/URLDataPromise.swift; sourceTree = ""; }; - 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 776D1D6E37D1EF4B16870DB0A90BD5B6 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; - 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; + 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 6D7294312CFFF12B79A7AD2E8D219344 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; + 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + 7417953898146193F86A165CD5F3AF4A /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 7824BE1937712800889974B222CAB1AD /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; + 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; - 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h"; sourceTree = ""; }; - 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; - 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Extensions/UIKit/Sources/UIView+Promise.swift"; sourceTree = ""; }; + 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/Swaggers/CodableHelper.swift; sourceTree = ""; }; + 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift; sourceTree = ""; }; + 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeclassnametagsAPI.swift; sourceTree = ""; }; + 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift"; sourceTree = ""; }; - 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + 8B87E0BA794A79025212F37D32449C63 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Promise.swift"; path = "Extensions/UIKit/Sources/UIViewController+Promise.swift"; sourceTree = ""; }; - 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 943618599D753D3CF9CEA416875D6417 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; + 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSURLSession+AnyPromise.h"; path = "Extensions/Foundation/Sources/NSURLSession+AnyPromise.h"; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; - A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSTask+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSTask+AnyPromise.m"; sourceTree = ""; }; - AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; + 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; + A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/Swaggers/APIHelper.swift; sourceTree = ""; }; + ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Extensions/Foundation/Sources/NSURLSession+Promise.swift"; sourceTree = ""; }; - BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Extensions/QuartzCore/Sources/CALayer+AnyPromise.m"; sourceTree = ""; }; + AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; + BA7C170F1E6A7A846F3D1C4BF9F78EAA /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Extensions/UIKit/Sources/UIViewController+AnyPromise.h"; sourceTree = ""; }; - C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - C21C617FCA30726E782E8A67D0149138 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PMKFoundation.h; path = Extensions/Foundation/Sources/PMKFoundation.h; sourceTree = ""; }; - C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; - CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; + CA6251246DA0044C165AC891CDE64344 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; + CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D5021828D3563560F50658622F55322A /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; + DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift; sourceTree = ""; }; DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; - E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+AnyPromise.m"; path = "Extensions/Foundation/Sources/NSURLSession+AnyPromise.m"; sourceTree = ""; }; + E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Extensions/Foundation/Sources/NSObject+Promise.swift"; sourceTree = ""; }; - E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterNumber.swift; sourceTree = ""; }; + E775A7621846699F1A762DB966B3DC48 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; + E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E80F4034540947434A69B02246F8ABBD /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; - EA8F6D8048F257672069D2008983C66D /* OuterString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterString.swift; sourceTree = ""; }; - F05F43847135C8DA403312FBEDB1F49F /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + EB834CA4A0478028D959D9EBD119D953 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/Swaggers/Extensions.swift; sourceTree = ""; }; F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; - F69BC1C993ED1722CE6D63E07381785E /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; + FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 1D8C8B25D2467630E50174D221B39B90 /* Frameworks */ = { + 1B8C72E45D5881E52545540F3F4881C1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0C4450B687C7F4706A5E8ADD7826A85 /* Foundation.framework in Frameworks */, + 0B974B8BCA617D23C87619DADD37D39B /* Alamofire.framework in Frameworks */, + 3A6675715B2BD21963134EE7CB699FEE /* Foundation.framework in Frameworks */, + 989A8D9C15575595501B0525EA04B7C4 /* PromiseKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 4B4E3FA81CA094AF6C75A1E6C915869B /* Frameworks */ = { + 1D8C8B25D2467630E50174D221B39B90 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0D858800E557D0A38D2E61CB98523F3 /* Foundation.framework in Frameworks */, - 30B8557D047D60B5F8332BCE95DD693E /* QuartzCore.framework in Frameworks */, - EB1F02E78667DE59E495E496FFEFC8CB /* UIKit.framework in Frameworks */, + 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */ = { + 21F0744FB2561027A81E019DEB9FBE9E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, + 8591B80B88C9A955D3E898EEF9DA71E1 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { + 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, + E723EED99F633C8620915572700A2D2E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D6F457FE461B17076A16F6175AFC7647 /* Frameworks */ = { + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B2CF10965316B20D0BB59BDEC2AB0131 /* Alamofire.framework in Frameworks */, - FC3CD5AA2DA8A499EB23571E14325F13 /* Foundation.framework in Frameworks */, - F4FD458A3DA6D643C08F837463C11B79 /* PromiseKit.framework in Frameworks */, + 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 02E57F930C8EDC9AD0C9932B5CAD1DC8 /* Classes */ = { + 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */ = { isa = PBXGroup; children = ( - 6D8231D013B59DBC75D89B4D4FC1781D /* Swaggers */, - ); - name = Classes; - path = Classes; - sourceTree = ""; - }; - 07B4ADF8C410B092809517B0BAB36E30 /* Foundation */ = { - isa = PBXGroup; - children = ( - 4E15893D6DA076F151391488D212E3FE /* afterlife.swift */, - 7DEB18C435BF545F4290754BD12ACA89 /* NSNotificationCenter+AnyPromise.h */, - 3BF219E6163D01FB1E793CA0AE97EF67 /* NSNotificationCenter+AnyPromise.m */, - 86FB9D88F32EB25214615C461AC6C432 /* NSNotificationCenter+Promise.swift */, - E6880118613493912D876F6EDAC620D3 /* NSObject+Promise.swift */, - 6B5E5BE3E3FECE0F54F54CE7C4EDBF6F /* NSTask+AnyPromise.h */, - A583E04FA44E6EB8B13CFBD3C4BC1016 /* NSTask+AnyPromise.m */, - 99A593C5CAA9E46E3EA8A5F0A3A5E892 /* NSURLSession+AnyPromise.h */, - E470520443CDA5BBDA7D716E9AFEF14C /* NSURLSession+AnyPromise.m */, - BA71549EA391E3A6799E5E2083D51179 /* NSURLSession+Promise.swift */, - C31B213B335DFB715738D846C9799EC8 /* PMKFoundation.h */, - 06FB2C2C487F62C8E234E5F309EE50EE /* Process+Promise.swift */, - 707A13EC65734755A4354861F095D56B /* URLDataPromise.swift */, - ); - name = Foundation; - sourceTree = ""; - }; - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { - isa = PBXGroup; - children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 27454559852AC8B9DDF3F084C1E09F22 /* PromiseKit */ = { - isa = PBXGroup; - children = ( - 6B8BED723E1865D5B9F1AC8B17FF7035 /* CorePromise */, - 07B4ADF8C410B092809517B0BAB36E30 /* Foundation */, - ADEB788C7842BDA6F8D266DFB6B6D00D /* QuartzCore */, - 8349D367FE0957C4AFA12D8CA5EA5B44 /* Support Files */, - 4C35F42FA9EA91ABFFA7ECEDDFB2E61A /* UIKit */, + 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */, + A5A38542CF9E498066C1C41B2E15BBFF /* Support Files */, ); name = PromiseKit; path = PromiseKit; sourceTree = ""; }; - 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */ = { + 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */ = { isa = PBXGroup; children = ( - C0C4B8ED879AE799525B69F4E8C51B1E /* Alamofire.modulemap */, - 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */, - F20826EF67AE5149D903E774F67507DD /* Alamofire-dummy.m */, - 4C1356040CC9A1CCCED79A1A510AF74E /* Alamofire-prefix.pch */, - 6C7ACDC625BF00A435AF4AB3554CDDF0 /* Alamofire-umbrella.h */, - 0A0A7AF3E4D82A790BC8A16BB4972FA7 /* Info.plist */, + 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */, + B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */, + 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */, + CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */, + C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */, + ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */, + 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */, + 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */, + 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */, + 7824BE1937712800889974B222CAB1AD /* GlobalState.m */, + CA6251246DA0044C165AC891CDE64344 /* hang.m */, + 47F1D5162720B2001CA614017A1ACE90 /* join.m */, + 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */, + 22932972F4F492160D4694C01CAF311D /* Promise.swift */, + 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */, + 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */, + 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */, + 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */, + E775A7621846699F1A762DB966B3DC48 /* State.swift */, + 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */, + 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */, + 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */, + DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */, ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; + name = CorePromise; sourceTree = ""; }; - 4C35F42FA9EA91ABFFA7ECEDDFB2E61A /* UIKit */ = { + 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */ = { isa = PBXGroup; children = ( - 2A1934708EF63D8175858BE77D4CC707 /* PMKAlertController.swift */, - 475705EF39C1CD6FEAE0873C0353F9A7 /* PMKUIKit.h */, - 69AAB5FB4A56193E40C41542AAAFD310 /* UIView+AnyPromise.h */, - 607DB4D4E14EB20C4DE0C6BD2FA4A922 /* UIView+AnyPromise.m */, - 8461ED3F533CF9C212A6A3F024CC8F5A /* UIView+Promise.swift */, - BFD4C386443F3A9950AA00E1C6127C2B /* UIViewController+AnyPromise.h */, - 4DD1AADF1F309F00ABA66EF864526D79 /* UIViewController+AnyPromise.m */, - 8E47C91B82D7EF2401C4A7D2DA4F7B72 /* UIViewController+Promise.swift */, + EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */, + 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */, + F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */, + D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */, + 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */, + BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */, + 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */, + C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */, + 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */, + 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */, + DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */, + 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */, + 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */, + 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */, + 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */, + AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */, + 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */, + 8949F214ACEA39133A2AAB6508F73CC0 /* Support Files */, ); - name = UIKit; + name = Alamofire; + path = Alamofire; sourceTree = ""; }; - 6B8BED723E1865D5B9F1AC8B17FF7035 /* CorePromise */ = { + 60558172C46150B1CC244DFD7F495889 /* Support Files */ = { isa = PBXGroup; children = ( - 2CD0480A6F4D769F6CE8B6BEC16F5CFE /* after.m */, - F05F43847135C8DA403312FBEDB1F49F /* after.swift */, - 0720785FA765917D0C03A126E07CB2C5 /* AnyPromise.h */, - 0296C2154D0CAB4EE1AF3AD456C7207F /* AnyPromise.m */, - 706B5E9B8BA544EE1CCA46D4A1F29216 /* AnyPromise.swift */, - F57895C0FD129E4ACA6D2DF8C5C960BC /* dispatch_promise.m */, - 103847E55D2DB836C4726FD119FCFA4F /* DispatchQueue+Promise.swift */, - 4655B4C1707E9902435774C9B1981618 /* Error.swift */, - 501CB163DE7B7F59F59C62C76F13A1E3 /* fwd.h */, - 2174DBFD409F34598A78447BBC01DB23 /* GlobalState.m */, - 0E0D7BCA2C0C3C6ABB215B192FE61633 /* hang.m */, - 64849EF7FCD1A24F508478A6B82F15B4 /* join.m */, - E92EF227AB7E7DD3F054096F5CC1A430 /* join.swift */, - AAC0733365F6A9BF565156D2FFA419ED /* Promise.swift */, - CAFBFC23A6A4DB2974DAB9A6FADE9E11 /* Promise+AnyPromise.swift */, - 3C42CC2D632364C7CA8BB4857F2F9C6F /* Promise+Properties.swift */, - A1F75405F0BABFF928C6618F11B55DD2 /* PromiseKit.h */, - 16F53B93392AAECDF2A786BC34DEE42B /* race.swift */, - 7CB03045DB10F7089377C70AF5B3F670 /* State.swift */, - 152E92E58DF288044CE0369CD8522B52 /* when.m */, - 1EA0E986221EEA08549F8CA73563FE27 /* when.swift */, - 0B83848569669227892C0BF2A5CE1835 /* wrap.swift */, - 827F697F6F7FF65D0850AF04A0CC3806 /* Zalgo.swift */, + EB834CA4A0478028D959D9EBD119D953 /* Info.plist */, + 2ACC287E45C0FCE8717A34B8ECA88A30 /* PetstoreClient.modulemap */, + FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */, + 3B26D25AFB2018A320BA1C7EDE3F560C /* PetstoreClient-dummy.m */, + BA7C170F1E6A7A846F3D1C4BF9F78EAA /* PetstoreClient-prefix.pch */, + C0C60220F2C965335A15C6C5688ACE4F /* PetstoreClient-umbrella.h */, ); - name = CorePromise; + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; sourceTree = ""; }; - 6D8231D013B59DBC75D89B4D4FC1781D /* Swaggers */ = { + 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */ = { isa = PBXGroup; children = ( - 1024470B7B0142DFF1DF7E009ED9260D /* AlamofireImplementations.swift */, - 14FA6FDDB70F2EFB58DE7D635F6946D4 /* APIHelper.swift */, - 798454EC551811276A6837CFCD4ADC8A /* APIs.swift */, - C387A09BFC4D29F2B2C308F55CD2BFB7 /* CodableHelper.swift */, - 1194146F3B5CFFECFE93B4E1DBB369BA /* Configuration.swift */, - 074AB602E0D52FDEFEAC391A71BE362C /* Extensions.swift */, - 8F07EB5B38222CE6DB8CC7EC894E9E73 /* JSONEncodableEncoding.swift */, - 25616A3E91482393BFD64C92FE312F0E /* JSONEncodingHelper.swift */, - 2C877E250DAECFEE1CDABF476EF2B25C /* Models.swift */, - 79B0B5EF51D76393D11143FD83D1F224 /* APIs */, - BDF2B05EE3EDF246153D7BDD1A3D065A /* Models */, + A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */, + 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */, + DD9EED10DC8740383600E1BFF8D2162B /* iOS */, ); - name = Swaggers; - path = Swaggers; + name = Frameworks; sourceTree = ""; }; - 79B0B5EF51D76393D11143FD83D1F224 /* APIs */ = { + 7C3C4943F0B3A9E87CCF23AA96272CB5 /* APIs */ = { isa = PBXGroup; children = ( - 6815FAC9A7B1782239E161DEEF54357F /* FakeAPI.swift */, - 09F0396C30B906DB9EFEFBE97E091406 /* FakeclassnametagsAPI.swift */, - 7A0B8917069F5E9591DD17A113737986 /* PetAPI.swift */, - 10156F0F886EC2F50651B704A3A6D742 /* StoreAPI.swift */, - CC87361174534D6D1655DD60071A3D83 /* UserAPI.swift */, + 2AE3690E05FA4B6B3A8600FCA1631D8C /* Fake_classname_tags123API.swift */, + 7C6145F09A87143B7FC501BE989C8BBD /* FakeAPI.swift */, + 85A2666A7F91E968D48E2EEC1623BB02 /* FakeclassnametagsAPI.swift */, + 475EFFB863F38801DE73965C1438E2FF /* PetAPI.swift */, + 897799EBBCCE802354256F9E7984C2CF /* StoreAPI.swift */, + 158D0513D0844E7FE6AEFAEE70E88618 /* UserAPI.swift */, ); name = APIs; - path = APIs; + path = PetstoreClient/Classes/Swaggers/APIs; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, - E1A132DCFF79A96DE3636D6C3ED161C5 /* Frameworks */, - E3012ACC12C4AE1521338E1834D7BDF0 /* Pods */, + EDE36CDEEF568DD818B58A28C3C0DA80 /* Development Pods */, + 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */, + A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */, D2A28169658A67F83CC3B568D7E0E6A1 /* Products */, C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, ); sourceTree = ""; }; - 8349D367FE0957C4AFA12D8CA5EA5B44 /* Support Files */ = { + 80845DB4F55E7613E45819034AAA6B0F /* PetstoreClient */ = { isa = PBXGroup; children = ( - 08BC2EAEE303ADCEB346C66DA76C7B56 /* Info.plist */, - 333A9E9802CC9090A44946166799777F /* PromiseKit.modulemap */, - D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */, - 7B8FB736CDFAAADBDB70EA060535FFEB /* PromiseKit-dummy.m */, - 776D1D6E37D1EF4B16870DB0A90BD5B6 /* PromiseKit-prefix.pch */, - B2D46CA33667445037B49DB2E4682861 /* PromiseKit-umbrella.h */, + 854F6A83AC5201A267F39995BF249D32 /* AlamofireImplementations.swift */, + A9930F8E68307FDF3470DAFB398895B2 /* APIHelper.swift */, + 3581DEB2B2BDC3D8A0BF7C43BD317506 /* APIs.swift */, + 7EA034E64EC60C1FCC5609CA9962CD51 /* CodableHelper.swift */, + 411BB07BE03DCC7000891F6A5E62BBC6 /* Configuration.swift */, + F05D3E8C18F8C0EF732558438FAA421A /* Extensions.swift */, + 466D426E7AA31C27ABC601DD606EF126 /* JSONEncodableEncoding.swift */, + DB3DDF6C3277994828CD09F3155BB74E /* JSONEncodingHelper.swift */, + 3ED6F43B3A7602CD88ED67B9873B2036 /* Models.swift */, + 7C3C4943F0B3A9E87CCF23AA96272CB5 /* APIs */, + B7C7CFA5065F490C632218EDF496EB25 /* Models */, + 60558172C46150B1CC244DFD7F495889 /* Support Files */, ); - name = "Support Files"; - path = "../Target Support Files/PromiseKit"; + name = PetstoreClient; + path = ../..; sourceTree = ""; }; 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { @@ -579,82 +496,85 @@ path = "Target Support Files/Pods-SwaggerClient"; sourceTree = ""; }; - 8D4D0246A623990315CCCFC95C6D7152 /* iOS */ = { + 8949F214ACEA39133A2AAB6508F73CC0 /* Support Files */ = { isa = PBXGroup; children = ( - C8F4E041B8F062D0E58498A365070ED8 /* Foundation.framework */, - 2141FBF0CC0A4A8349C016ECD4ABBEE2 /* QuartzCore.framework */, - 2ABF01CA3A8264BCD945D29D45416B97 /* UIKit.framework */, + 1F11D15E4489C7F4DC1171EB9F5448D0 /* Alamofire.modulemap */, + 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */, + 4AC04C8B5F4B690622341DB807DAEB0B /* Alamofire-dummy.m */, + 607281BBD24DC152F24F58E6046F4652 /* Alamofire-prefix.pch */, + 95DA780B317CD76B87D2843B3922D627 /* Alamofire-umbrella.h */, + 17FF216D0378037475BAB48A20D5CB0F /* Info.plist */, ); - name = iOS; + name = "Support Files"; + path = "../Target Support Files/Alamofire"; sourceTree = ""; }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { + A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */ = { isa = PBXGroup; children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, + 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */, + 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */, ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; + name = Pods; sourceTree = ""; }; - ADEB788C7842BDA6F8D266DFB6B6D00D /* QuartzCore */ = { + A5A38542CF9E498066C1C41B2E15BBFF /* Support Files */ = { isa = PBXGroup; children = ( - 3DB83DEE18EB958220B42D26A726EA74 /* CALayer+AnyPromise.h */, - BAF01D809260F177266BCDEB5D85A6F4 /* CALayer+AnyPromise.m */, - 584464ED8CD0D083C3125CBCE3F07BA1 /* PMKQuartzCore.h */, + 34E180DB9A06BFDDA525853716B57541 /* Info.plist */, + 6D7294312CFFF12B79A7AD2E8D219344 /* PromiseKit.modulemap */, + 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */, + E7B845A9435BD8A5A34664D1A66B8484 /* PromiseKit-dummy.m */, + 48CCB9793CCE13A24831B3E01B29171A /* PromiseKit-prefix.pch */, + 3C7BB9DA6D00D51D3DB475EDCFC925B3 /* PromiseKit-umbrella.h */, ); - name = QuartzCore; + name = "Support Files"; + path = "../Target Support Files/PromiseKit"; sourceTree = ""; }; - BDF2B05EE3EDF246153D7BDD1A3D065A /* Models */ = { + B7C7CFA5065F490C632218EDF496EB25 /* Models */ = { isa = PBXGroup; children = ( - 5F54BE613A3988D2B9B506E8E6BEE157 /* AdditionalPropertiesClass.swift */, - 44E7AE2E18EA6D3B341C419A4B2813F3 /* Animal.swift */, - 688103EFA108516ADBACAFEF5DF33690 /* AnimalFarm.swift */, - 26189A4CE9006C2C9BB1AAE144CB191F /* ApiResponse.swift */, - 81632F006BE1334AB9EE06329318FE60 /* ArrayOfArrayOfNumberOnly.swift */, - 6D9891D7095BE60AF5240E9C34D72085 /* ArrayOfNumberOnly.swift */, - 53AFC29FAA23E6156D43BCDE6F4EFEF7 /* ArrayTest.swift */, - BE4C2705D4C3B913D44B4F26C6817A9C /* Capitalization.swift */, - C21C617FCA30726E782E8A67D0149138 /* Cat.swift */, - F69BC1C993ED1722CE6D63E07381785E /* Category.swift */, - D679EE988B8B8734D2AAAAAFD25CDB9B /* ClassModel.swift */, - E2FCD5F3D2C6621D4355CACB49530DB3 /* Client.swift */, - 975DAA5E04C557E1AA63DD67304C3466 /* Dog.swift */, - 249B8C876D70EDBA1D831123AE8EE0F8 /* EnumArrays.swift */, - 03597C306A2FB3B657BCFF572F74F4D4 /* EnumClass.swift */, - 4199B3084AC46DC42D15500A1C964ECC /* EnumTest.swift */, - 8DD5A1187D47A6FFAC34F927DA186750 /* FormatTest.swift */, - 2A2DACCC87696D352D52090A939EE230 /* HasOnlyReadOnly.swift */, - 3BD1A4B33356A3CDF1DC77EE6C70D752 /* List.swift */, - 0C11B4AA97BB6048B4FFD944AEE16E85 /* MapTest.swift */, - 4EE549F80BAFEF84BF212F0C315BC9BF /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - C82495B2E8EC7A268E3C9F068458102B /* Model200Response.swift */, - 237AE2907A722F87C756BCE4EF772C4C /* Name.swift */, - 076A25934936127AC03A2B855ACCDF5E /* NumberOnly.swift */, - E80F4034540947434A69B02246F8ABBD /* Order.swift */, - 1365D135EB77F78D4ED50CB4CEA2BA76 /* OuterBoolean.swift */, - 749C03CC31823CCADA2EFFFD06BF9E98 /* OuterComposite.swift */, - C2A49053FD4226BD3513549F61A5944F /* OuterEnum.swift */, - E6E0984D5B0599817A4E48CBAE9AAB9A /* OuterNumber.swift */, - EA8F6D8048F257672069D2008983C66D /* OuterString.swift */, - DE081085EBFE0D670AAC85E74ACFDE8D /* Pet.swift */, - 1DF0A17DD1DCF7B53BFC5E09C07C84B1 /* ReadOnlyFirst.swift */, - 56F57C400928D9344121036AC8E4220D /* Return.swift */, - 2AC757CC02124D5B17B6867095DBB70D /* SpecialModelName.swift */, - 8A3C1EDF28A8B80DB140B65CDE450E09 /* Tag.swift */, - 83A7AB2A1DA3632E843B3336E8D41A8E /* User.swift */, + C3153AF6539569349FDEA90444438B8A /* AdditionalPropertiesClass.swift */, + 8689097AED0350F905AFA5B0962FA969 /* Animal.swift */, + C3862A83F9BE857B1E903ABBBDE37EF7 /* AnimalFarm.swift */, + C3102957D0FBF5FFA80969BB2A15F8FF /* ApiResponse.swift */, + 1B900B675208453FB7767B0D97D50932 /* ArrayOfArrayOfNumberOnly.swift */, + 45CB52E75AED2F044F187FD71FDFC880 /* ArrayOfNumberOnly.swift */, + 30B827D77F92D24E6D24561F491F2A50 /* ArrayTest.swift */, + E0A482A15F21B4BC206B31E7A0FAB79F /* Capitalization.swift */, + 4530F24A4BDA094563779F1D4313B9E1 /* Cat.swift */, + 7417953898146193F86A165CD5F3AF4A /* Category.swift */, + C925A1EF89E6AF23AE6EA4BA515A6E11 /* ClassModel.swift */, + 5B8F990A8905B95231C6D1955750D23C /* Client.swift */, + 28F73294B64CD8821EC2467CB7F1F073 /* Dog.swift */, + 88EC57640E276EA2387256530FB1F868 /* EnumArrays.swift */, + 30E08D3E06CED1E4F2876EFA44A239ED /* EnumClass.swift */, + C3941FB77CA24840ADF5671D16FE460C /* EnumTest.swift */, + 9776B33259DFB803A3E6D9573FA3DE3E /* FormatTest.swift */, + B5DF7C9C577375BE47CAE380DE3EBE19 /* HasOnlyReadOnly.swift */, + 8B87E0BA794A79025212F37D32449C63 /* List.swift */, + DF26681AB7FB981F237CD8EA4F059708 /* MapTest.swift */, + 3FB1FE2028948C532392F549A4356FBC /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 3617A5AF85A2814F852C73FD5D575262 /* Model200Response.swift */, + 2C0EF68B5117187E979D1DE4ECDB938E /* Name.swift */, + 2A332587F10679E262455F979B3D1055 /* NumberOnly.swift */, + 24D3039E712D1279434152E805AEDA65 /* Order.swift */, + 21A143975CF52EBFEF79A307CC7CB00E /* OuterBoolean.swift */, + 5AE839994FB9B18B77FC95BCC9594683 /* OuterComposite.swift */, + 13C6EEF1D81A0C523AE569F1732AC8DC /* OuterEnum.swift */, + 0BA93068A5B18A779CC9B0FC3F685400 /* OuterNumber.swift */, + 5EB640315A574EA2C8E4584499B31A44 /* OuterString.swift */, + E1FF93AC280A80800873A20A8F72AD29 /* Pet.swift */, + 4A0977DBA9BAE46013DFD65E4400A0CB /* ReadOnlyFirst.swift */, + 87DCB85380B2EC22CFE743BEDE7E4114 /* Return.swift */, + C7E7932024A79370E61700F5FD439D37 /* SpecialModelName.swift */, + 02E62B78D97471D708B23605FCAA9EA1 /* Tag.swift */, + C4B3F69D54C19FC502362EEE3544ECA0 /* User.swift */, ); name = Models; - path = Models; + path = PetstoreClient/Classes/Swaggers/Models; sourceTree = ""; }; C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { @@ -678,32 +598,6 @@ name = Products; sourceTree = ""; }; - D630949B04477DB25A8CE685790D41CD /* Alamofire */ = { - isa = PBXGroup; - children = ( - F35E3788DA69834B7CF86EC61FEB453C /* AFError.swift */, - C3DD4689CB744B566DA645A762474D50 /* Alamofire.swift */, - F7C414EFC68CF0C5DB0E5D9E33863B44 /* DispatchQueue+Alamofire.swift */, - CF7474663A857DD4540585C7AABD1E42 /* MultipartFormData.swift */, - 68757F29FA6F6C42DBA6342A3E62044D /* NetworkReachabilityManager.swift */, - 2DE0CB8D9EE8A56D63B991586247B70A /* Notifications.swift */, - 51E0E750323BD31207928C6D05DBA443 /* ParameterEncoding.swift */, - 2F0DEFA8B8F894D4BFC00D53E40611EC /* Request.swift */, - D5021828D3563560F50658622F55322A /* Response.swift */, - 82CFB52B2B1C4E72218F01A4034E11C4 /* ResponseSerialization.swift */, - 475A72056C770A5978AB453E7DC5B3AE /* Result.swift */, - 19B892C7CE6610E1CA2ADC23C7B1C5B9 /* ServerTrustPolicy.swift */, - A4AECF8B352819D57BE253B02387B58E /* SessionDelegate.swift */, - 3227553C2F6B960B53F2DADD2091E856 /* SessionManager.swift */, - 641D30DAD8B334C67D53DB9FE3E1156F /* TaskDelegate.swift */, - F738520F03FD7B756BB4DF21CF3DF1DC /* Timeline.swift */, - 943618599D753D3CF9CEA416875D6417 /* Validation.swift */, - 470B2EC4B502506F1DCAE0EE7E194226 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */ = { isa = PBXGroup; children = ( @@ -722,42 +616,20 @@ path = "Target Support Files/Pods-SwaggerClientTests"; sourceTree = ""; }; - E1A132DCFF79A96DE3636D6C3ED161C5 /* Frameworks */ = { + DD9EED10DC8740383600E1BFF8D2162B /* iOS */ = { isa = PBXGroup; children = ( - F53D6FE99858297507D97FCDF5F0F461 /* Alamofire.framework */, - 31D680492464F6D65F2FAFA3D645CFFC /* PromiseKit.framework */, - 8D4D0246A623990315CCCFC95C6D7152 /* iOS */, + 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */, ); - name = Frameworks; - sourceTree = ""; - }; - E3012ACC12C4AE1521338E1834D7BDF0 /* Pods */ = { - isa = PBXGroup; - children = ( - D630949B04477DB25A8CE685790D41CD /* Alamofire */, - 27454559852AC8B9DDF3F084C1E09F22 /* PromiseKit */, - ); - name = Pods; - sourceTree = ""; - }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - 02E57F930C8EDC9AD0C9932B5CAD1DC8 /* Classes */, - ); - name = PetstoreClient; - path = PetstoreClient; + name = iOS; sourceTree = ""; }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { + EDE36CDEEF568DD818B58A28C3C0DA80 /* Development Pods */ = { isa = PBXGroup; children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, + 80845DB4F55E7613E45819034AAA6B0F /* PetstoreClient */, ); - name = PetstoreClient; - path = ../..; + name = "Development Pods"; sourceTree = ""; }; /* End PBXGroup section */ @@ -771,31 +643,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8C605DB733F0B4EC31CC50556BD08B92 /* Headers */ = { + 247861DD0240A7F61EE9BD1526A71052 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - B0D0A8D9EB7248222E444C3004709BB4 /* PetstoreClient-umbrella.h in Headers */, + E8AD4D7E49710B99BFD77E32C5EBFAE8 /* PetstoreClient-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - A99DB1B2B8050CD5EEC454140260FB13 /* Headers */ = { + 7732E969446BF18D45DF5D7762E56585 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 173A377B378B75AADE06A397128BC8AB /* AnyPromise.h in Headers */, - 3F034997ED7849F2C6CC86D5B8C50BC1 /* CALayer+AnyPromise.h in Headers */, - 825645C19A9BDB1D138D5DFDF69C143A /* fwd.h in Headers */, - 81DF78F6697313B98D66D012475E8067 /* NSNotificationCenter+AnyPromise.h in Headers */, - BFAD00B3B746E0E08E9155FF4E84F24A /* NSTask+AnyPromise.h in Headers */, - 1D3E8E496572E1D4244811D5A3973171 /* NSURLSession+AnyPromise.h in Headers */, - 53A8D9F8E089D32918F3A5843ADDC26A /* PMKFoundation.h in Headers */, - C9D7613956EB06CD6E42B97ABEC9B673 /* PMKQuartzCore.h in Headers */, - ADF417E7FD14C452F475C4328B1661C3 /* PMKUIKit.h in Headers */, - 1FB6E55D4CD4F11D4D7C8722E8C33A42 /* PromiseKit-umbrella.h in Headers */, - 5765C7B9F6084011161DA2267C2A0B57 /* PromiseKit.h in Headers */, - 1B50D83C35A942533A18AA3AF0A80421 /* UIView+AnyPromise.h in Headers */, - 003F98B2C041FC1DE84490CDB4598F89 /* UIViewController+AnyPromise.h in Headers */, + FE73D6A3B0670590535EC0D79F4F7246 /* AnyPromise.h in Headers */, + BB3C554F09627EA5E6E36084E4AA5545 /* fwd.h in Headers */, + 02650248013496C5AB857B869C562661 /* PromiseKit-umbrella.h in Headers */, + B65BFA719D8195A2FAA0E067DE5A6DA4 /* PromiseKit.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -818,53 +681,53 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { + 05AABECB91CEE9C8C520680DDD9BA9AB /* PromiseKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildConfigurationList = EF55B259278E6A593DF7F60BDD524C1D /* Build configuration list for PBXNativeTarget "PromiseKit" */; buildPhases = ( - 32B9974868188C4803318E36329C87FE /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, + 8E56111DCEAA0843CC2406F80FC6AC8E /* Sources */, + 21F0744FB2561027A81E019DEB9FBE9E /* Frameworks */, + 7732E969446BF18D45DF5D7762E56585 /* Headers */, ); buildRules = ( ); dependencies = ( ); - name = Alamofire; - productName = Alamofire; - productReference = E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */; + name = PromiseKit; + productName = PromiseKit; + productReference = AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */; productType = "com.apple.product-type.framework"; }; - C7C5ED0DB8AF8EA86EC1631F79346F2C /* PromiseKit */ = { + 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { isa = PBXNativeTarget; - buildConfigurationList = 02482B3666DC12E2ABD164F8C86F2B54 /* Build configuration list for PBXNativeTarget "PromiseKit" */; + buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; buildPhases = ( - F11C32C4518B2E95254C966B5EC111FA /* Sources */, - 4B4E3FA81CA094AF6C75A1E6C915869B /* Frameworks */, - A99DB1B2B8050CD5EEC454140260FB13 /* Headers */, + 32B9974868188C4803318E36329C87FE /* Sources */, + 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, + B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, ); buildRules = ( ); dependencies = ( ); - name = PromiseKit; - productName = PromiseKit; - productReference = AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */; + name = Alamofire; + productName = Alamofire; + productReference = E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */; productType = "com.apple.product-type.framework"; }; - CD79A5D6FCA04E079B656EC73E0CF0A9 /* PetstoreClient */ = { + BEF02C72A6656158D171985B49ABDD62 /* PetstoreClient */ = { isa = PBXNativeTarget; - buildConfigurationList = B1A4CABC9A5EAB96E49E2FD508880661 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildConfigurationList = 9EAF730020668F908855C7CE58AD558B /* Build configuration list for PBXNativeTarget "PetstoreClient" */; buildPhases = ( - BC392AC4415A71BAD9D8AAC1DCE30B0E /* Sources */, - D6F457FE461B17076A16F6175AFC7647 /* Frameworks */, - 8C605DB733F0B4EC31CC50556BD08B92 /* Headers */, + 4F6B3944D9B6D707C48F41C03EEE78C5 /* Sources */, + 1B8C72E45D5881E52545540F3F4881C1 /* Frameworks */, + 247861DD0240A7F61EE9BD1526A71052 /* Headers */, ); buildRules = ( ); dependencies = ( - 1EDC13795DA36DC88CF1A4EB19B00C27 /* PBXTargetDependency */, - F49B4E5A7446788D16D901B71DE002E8 /* PBXTargetDependency */, + 673D77682E593868E01C5FA765287285 /* PBXTargetDependency */, + 54BB4F0799462BDB807AAD5F3BF68BFD /* PBXTargetDependency */, ); name = PetstoreClient; productName = PetstoreClient; @@ -914,7 +777,7 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; @@ -930,10 +793,10 @@ projectRoot = ""; targets = ( 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - CD79A5D6FCA04E079B656EC73E0CF0A9 /* PetstoreClient */, + BEF02C72A6656158D171985B49ABDD62 /* PetstoreClient */, E5B96E99C219DDBC57BC27EE9DF5EC22 /* Pods-SwaggerClient */, F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */, - C7C5ED0DB8AF8EA86EC1631F79346F2C /* PromiseKit */, + 05AABECB91CEE9C8C520680DDD9BA9AB /* PromiseKit */, ); }; /* End PBXProject section */ @@ -964,112 +827,98 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BC392AC4415A71BAD9D8AAC1DCE30B0E /* Sources */ = { + 4F6B3944D9B6D707C48F41C03EEE78C5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 14FA5791C21B38B5D90017F182AA77C6 /* AdditionalPropertiesClass.swift in Sources */, - 0000257E6138186889F38B8A7F797C33 /* AlamofireImplementations.swift in Sources */, - A81AD325D55AF5D8972809300D8F36E5 /* Animal.swift in Sources */, - 622B5DBF5E128A33315BE8EFF05792EA /* AnimalFarm.swift in Sources */, - 578E746892610EA4B83D264A05D6FC60 /* APIHelper.swift in Sources */, - 5D63858F4E9812FAAF772FFDCB4ACE45 /* ApiResponse.swift in Sources */, - A22E02C8FB1A44C7AAFED7E121904807 /* APIs.swift in Sources */, - 109135A9E832B6E00D3258B9A7A95D2E /* ArrayOfArrayOfNumberOnly.swift in Sources */, - E59910F3BA3F43E74B24DC9AE4612B88 /* ArrayOfNumberOnly.swift in Sources */, - 3DAA524BB89E475536B71207F5F2C0F5 /* ArrayTest.swift in Sources */, - C80991D67ADACC9C48704248AC151933 /* Capitalization.swift in Sources */, - DC594EF39ADAFC9B59E1DE1A9BE58D97 /* Cat.swift in Sources */, - 6A47436E31CAD703E4ABB641F80FC7DF /* Category.swift in Sources */, - F45D65E76C21F99D26C25A71AE5566DD /* ClassModel.swift in Sources */, - 22980ADB7D228364F99E8EA145509B4F /* Client.swift in Sources */, - D67D0F8EB46ED3C4256F87DF09186EEA /* CodableHelper.swift in Sources */, - BC1063342B57CB4A07D50F277CAC4783 /* Configuration.swift in Sources */, - 7E40C3A7DBC7306738AC9E27C734C25E /* Dog.swift in Sources */, - 032C9FCA8EA6C8553275B1F7641A1CD8 /* EnumArrays.swift in Sources */, - 3064A0BD79720BAD39B0F3ECD5C93FFA /* EnumClass.swift in Sources */, - 545C5A303A209C2C009E242F9D310001 /* EnumTest.swift in Sources */, - C764F495BF6DFEBE52AFD13FDFB8E77F /* Extensions.swift in Sources */, - 4E482819CF1AD28A5960095805A803ED /* FakeAPI.swift in Sources */, - 5909B4BACAF8557FE13B325FA529BE57 /* FakeclassnametagsAPI.swift in Sources */, - 0298FFF35BEF4948A42E55756D7C81A8 /* FormatTest.swift in Sources */, - 6FA5895264E0223B0A016644C59C6046 /* HasOnlyReadOnly.swift in Sources */, - AB0054D02002325BD7DF0BE3FD742D9C /* JSONEncodableEncoding.swift in Sources */, - 7E60F24604C0F467F63D451E410390D8 /* JSONEncodingHelper.swift in Sources */, - 0AF188BAD0E51575891ACE80B0BA6AE9 /* List.swift in Sources */, - 508395CE75541C444206B78E2E94F435 /* MapTest.swift in Sources */, - 1870983702DCF95885BECDBF3E5757E3 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - E76FE98378C097EE9C5A718F5BD2F581 /* Model200Response.swift in Sources */, - 1F6BD2584EF72ECAA323B94528BE7992 /* Models.swift in Sources */, - 9F31C123624CA2B1C281D5F975EDE616 /* Name.swift in Sources */, - D2451BD00C9ED3883D70BDDE178EAE89 /* NumberOnly.swift in Sources */, - 99C82D0F8CF5B60591EF533A62F0E10A /* Order.swift in Sources */, - 6DCD351570B86AADFD4BF754096A2DAE /* OuterBoolean.swift in Sources */, - 0097805BEFC942B10049FCF37ED24E0D /* OuterComposite.swift in Sources */, - F08AFEBD1802D01C74266BF23F184138 /* OuterEnum.swift in Sources */, - 77F4CFE0094EBDC63B49257B074C936B /* OuterNumber.swift in Sources */, - E856B555D4283924AE496FB9A447189A /* OuterString.swift in Sources */, - 3312221F642766FE185B9B697A8BAE4B /* Pet.swift in Sources */, - CFFAD4C93D9A9D8455B4D4C18FFE8055 /* PetAPI.swift in Sources */, - 86463DE0FB886D57EFACE9747D72E1E6 /* PetstoreClient-dummy.m in Sources */, - E9709BDE6A967F82A034B01DD832123C /* ReadOnlyFirst.swift in Sources */, - 7878FCD0D2F00BCD00002F6BD6E297A7 /* Return.swift in Sources */, - 0DF2F6645EE3AB16827B6212F6DEDFDA /* SpecialModelName.swift in Sources */, - 33457D935182159E14829CE7BEEBDD6D /* StoreAPI.swift in Sources */, - AA72696A13BD17947CAEDA22B0C89372 /* Tag.swift in Sources */, - 18F9B7517B71D53CC011E7F88676B527 /* User.swift in Sources */, - 286FDA09B99338DDAE8AEEAF3D2769FA /* UserAPI.swift in Sources */, + 00E45C819B259C722DA2BF90EE63DDE6 /* AdditionalPropertiesClass.swift in Sources */, + 21E703668E91D10CECB8BBE59650D58F /* AlamofireImplementations.swift in Sources */, + 1F4886332EE9958B4953893705FF9246 /* Animal.swift in Sources */, + E9783E1D3A6A0CD9CF2ACCA74A89CC8F /* AnimalFarm.swift in Sources */, + E80880F475CC14AFB6795F1451DDE2B4 /* APIHelper.swift in Sources */, + 38C508C4B73F4EEF12972C4DEBBB59BD /* ApiResponse.swift in Sources */, + 7F7153A9E140DB803EFB19D4C3D2408A /* APIs.swift in Sources */, + 4E875FE97DC4CFCD45EF180B1930BA87 /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 30F26AB48B6038D292000A176A0A25D2 /* ArrayOfNumberOnly.swift in Sources */, + C77EFC1A12788F4EC02C8F08DF687A1B /* ArrayTest.swift in Sources */, + C9004CA15837C724215DE3E1A7AB42AB /* Capitalization.swift in Sources */, + 1392D80ECC22365B4831BC95032F0F0B /* Cat.swift in Sources */, + DBFDFCF61E2F2C7A49FD50B9222E3495 /* Category.swift in Sources */, + 3149FCFDA10385D31F93F2F781AA34D0 /* ClassModel.swift in Sources */, + 5491C5AA65355E89637F78928E52D24C /* Client.swift in Sources */, + BA9D88BD67EA9ACBDE9FEBF06E4FBD4D /* CodableHelper.swift in Sources */, + 453006CD439DABF8B2B378F4A40AC1CA /* Configuration.swift in Sources */, + AA022DF933E15BC6AF9A8C157370CF96 /* Dog.swift in Sources */, + 58F07EB0BF05A369A3952852632562F6 /* EnumArrays.swift in Sources */, + 0E4F6AB01CA15D7ACE27641BA3803ACE /* EnumClass.swift in Sources */, + 34104D7277F8474FCBB80637A8364337 /* EnumTest.swift in Sources */, + 884B23FB0C4EA228B4694F191D531090 /* Extensions.swift in Sources */, + DBC481AC7EB3A4F2E547F52BAF547922 /* Fake_classname_tags123API.swift in Sources */, + 2AA4FCEA014BFBBBD56C909C02B98A77 /* FakeAPI.swift in Sources */, + D5275BCBC0725D755D5945A9AB6C5A40 /* FakeclassnametagsAPI.swift in Sources */, + D9FEE02D3C00097A882DCF9AF60C4FDC /* FormatTest.swift in Sources */, + 5742106D27D324737B72F32CBAC98924 /* HasOnlyReadOnly.swift in Sources */, + B6FE8649C8F2D879752D6CC0BAA7D8D3 /* JSONEncodableEncoding.swift in Sources */, + 4D46B19B21C17385C251DBFD6B5CC9B5 /* JSONEncodingHelper.swift in Sources */, + FD5C92BE0C43E605D5AED2BEE74BC595 /* List.swift in Sources */, + A9A1683640F2AEEE1463B4564735F52C /* MapTest.swift in Sources */, + 9621FE3846B399A31C9D874A68B814EA /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + DDF666793202988950DA52A8C528C076 /* Model200Response.swift in Sources */, + 6FABE818191D2C7497B657CB717435A9 /* Models.swift in Sources */, + 8628572254ED43AD0FB157E20D3B6DCF /* Name.swift in Sources */, + C2C77FE3B30FA828B5A6F8611C84AB03 /* NumberOnly.swift in Sources */, + 812B1864BB988DE4C71DE5755B9A7D1C /* Order.swift in Sources */, + D54935D8A773E7BC8DED0861487D5CEB /* OuterBoolean.swift in Sources */, + C807A7AC785D77909FF2288E66669889 /* OuterComposite.swift in Sources */, + F9D35B36A805D504C9383C5743874D23 /* OuterEnum.swift in Sources */, + 4CEC13EBEA756DB01D9EDD495477148E /* OuterNumber.swift in Sources */, + 32495BBAAED67B464B26E37EFC43BFAA /* OuterString.swift in Sources */, + AF0CAB7D38117E91D76835CE62FE9530 /* Pet.swift in Sources */, + C57A01A8A02024DD3C4F013AB8F41F71 /* PetAPI.swift in Sources */, + E86EED1FA38087909568DED335E7B9A5 /* PetstoreClient-dummy.m in Sources */, + EF15BEAF1A002B97A226F9AF3D3C0F26 /* ReadOnlyFirst.swift in Sources */, + 7DBDDA5406CB59867FC877F1032BC905 /* Return.swift in Sources */, + A7803F0032BE57E83C9E1CC15442058E /* SpecialModelName.swift in Sources */, + 36C43C6EB14FFC6C23618D2EE8C6D64B /* StoreAPI.swift in Sources */, + 60E0243A7018DE1E7755825685D30151 /* Tag.swift in Sources */, + 50FC50E41FA283FD8EACEED8EB7CC15C /* User.swift in Sources */, + E52BCAD4A070EEAA1EA08F2D299F4EDB /* UserAPI.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { + 8E56111DCEAA0843CC2406F80FC6AC8E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, + B40BA9338A0622CC69161949F42E0ADE /* after.m in Sources */, + A3B4F53480EF96400D782F3507A42573 /* after.swift in Sources */, + A6FAEDD331C7E9BD959076F2CC466B5A /* AnyPromise.m in Sources */, + 85543B6F540EED8FFF82015FED6CB68B /* AnyPromise.swift in Sources */, + FC0B3667BB40C86FC84990EEDF29B534 /* dispatch_promise.m in Sources */, + 9DCADBA52F4BA9C2BCDD2AD9FC39291E /* DispatchQueue+Promise.swift in Sources */, + 669789618901F2B104F686A8A44E4F23 /* Error.swift in Sources */, + 95DD56D8244A0F779EA3D24617389DFA /* GlobalState.m in Sources */, + 46C3E70BD716E72351EA9828A496E59A /* hang.m in Sources */, + 0BC6EA4CC7B942917A160339B54748B6 /* join.m in Sources */, + 6939CF29A58F770558A46D229F33CDEF /* join.swift in Sources */, + BE111800D151B74E9EB6CFFA5375A378 /* Promise+AnyPromise.swift in Sources */, + 878E6E228B4A3D2725656142AA379D7F /* Promise+Properties.swift in Sources */, + D6184AB54A12F4F580FE7766FFD1A491 /* Promise.swift in Sources */, + 888EF901304106608916A05E6EC6A0A0 /* PromiseKit-dummy.m in Sources */, + C36D10DCACB58234D9ADAE75457BB1F7 /* race.swift in Sources */, + 98859B984F0B8D1BA8C419626A541DDF /* State.swift in Sources */, + CAA786E247A67408ED8FDDD3BD9EACC3 /* when.m in Sources */, + FCB75043BDF47C08F944EFD06D4636D9 /* when.swift in Sources */, + B319CCF9C8F0F08FADAEA89F9655B54E /* wrap.swift in Sources */, + 34C9317929C1DA5F022B5AEC56DED275 /* Zalgo.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - F11C32C4518B2E95254C966B5EC111FA /* Sources */ = { + BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6CE003919AF6139793694D58ADFAF9E6 /* after.m in Sources */, - 960FAEEAEDD7034D1E1B0D5B5AB43088 /* after.swift in Sources */, - 5BE1865A8083F6AD7AE7DCFE51E58891 /* afterlife.swift in Sources */, - BD80FDBAC0BA32059AE47295D91CA7D5 /* AnyPromise.m in Sources */, - 95630631BB8BFEB5540B6CF0C5D029E2 /* AnyPromise.swift in Sources */, - 6084F899BF2E35FD09D072A5C0394BD3 /* CALayer+AnyPromise.m in Sources */, - 7F1456C9A2A6684F13FD1B5A1DFD7E74 /* dispatch_promise.m in Sources */, - 1D670869022E7C0EA2DEE5155BD1864A /* DispatchQueue+Promise.swift in Sources */, - E3EC746788D5F275062D0285A256889F /* Error.swift in Sources */, - 5CBC2597C5EED08A74430DD6E8C3C9C5 /* GlobalState.m in Sources */, - 57451FA0255A49DEBAEB885DD0658750 /* hang.m in Sources */, - C2432D8D7746A8E8DCA5B602151C42E4 /* join.m in Sources */, - 9CBC2DEF8C73F54A32071F82D8F12DF5 /* join.swift in Sources */, - 197CBB45FF699E91B3E8DEDFCD596612 /* NSNotificationCenter+AnyPromise.m in Sources */, - 465DC8B52B3D7D0585D772ED29683D3E /* NSNotificationCenter+Promise.swift in Sources */, - 2642DF6CB39C87B120397F5C178010F9 /* NSObject+Promise.swift in Sources */, - DBDF86E562197D5CD9642080A12A5BE4 /* NSTask+AnyPromise.m in Sources */, - DA76C2A4D3AB587E749A0F66577E9304 /* NSURLSession+AnyPromise.m in Sources */, - 0323E3530C2A481A0C10B0EBB7DCD2E4 /* NSURLSession+Promise.swift in Sources */, - 8C1BEB026BACC90CE05F5DA21C8CFF67 /* PMKAlertController.swift in Sources */, - E58EC13E8E0CD973265C55501616B315 /* Process+Promise.swift in Sources */, - FD795A688F4488A09DC07632E6280D8C /* Promise+AnyPromise.swift in Sources */, - CA4691ACA6280C902F0B1EA26C33A367 /* Promise+Properties.swift in Sources */, - DDEE5C6AA270829DE886561F304A4824 /* Promise.swift in Sources */, - 7F4DA286C82EE5687AFC2FE1B7C60292 /* PromiseKit-dummy.m in Sources */, - 050D8EBD37B9EBC551614518F5C70CF2 /* race.swift in Sources */, - 468BB42B90797F64A371FDE8C7185AF4 /* State.swift in Sources */, - C8DC229B790728AF1D8DBE1C9DBC4149 /* UIView+AnyPromise.m in Sources */, - 1DA594AF0F2972E05DF99942E216377A /* UIView+Promise.swift in Sources */, - F9A79B29AC1077DE04896B7C0ED7FEF7 /* UIViewController+AnyPromise.m in Sources */, - 908D609C8BB8E370E1A3C03D05F0A23C /* UIViewController+Promise.swift in Sources */, - 1EFA4EB14D39ED739309A086ECEA8906 /* URLDataPromise.swift in Sources */, - BDEA72204E0F3D235E5B0950762CC3DF /* when.m in Sources */, - 04364ACE71EDEA482E970EDC82ED01B9 /* when.swift in Sources */, - A04DA97EEE7A057FC4EDA1D95309E9A3 /* wrap.swift in Sources */, - 3440FB38AAE8B9EA4CDCEE98B931B524 /* Zalgo.swift in Sources */, + 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1090,37 +939,38 @@ target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; targetProxy = BBE116AAF20C2D98E0CC5B0D86765D22 /* PBXContainerItemProxy */; }; - 1EDC13795DA36DC88CF1A4EB19B00C27 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = CB26706D98170EB16B463236FA3B7559 /* PBXContainerItemProxy */; - }; 328C6C7DF03199CFF8F5B47C39DEE2BC /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PromiseKit; - target = C7C5ED0DB8AF8EA86EC1631F79346F2C /* PromiseKit */; + target = 05AABECB91CEE9C8C520680DDD9BA9AB /* PromiseKit */; targetProxy = F4F5C9A84714BE23040A5FB7588DA6BD /* PBXContainerItemProxy */; }; 405120CD9D9120CBBC452E54C91FA485 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PetstoreClient; - target = CD79A5D6FCA04E079B656EC73E0CF0A9 /* PetstoreClient */; + target = BEF02C72A6656158D171985B49ABDD62 /* PetstoreClient */; targetProxy = B173CFF2A1174933D7851E8CE1CA77AB /* PBXContainerItemProxy */; }; - F49B4E5A7446788D16D901B71DE002E8 /* PBXTargetDependency */ = { + 54BB4F0799462BDB807AAD5F3BF68BFD /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = PromiseKit; - target = C7C5ED0DB8AF8EA86EC1631F79346F2C /* PromiseKit */; - targetProxy = D74571BD294009BB075CA105B3BA8274 /* PBXContainerItemProxy */; + target = 05AABECB91CEE9C8C520680DDD9BA9AB /* PromiseKit */; + targetProxy = 2A6F85761AF8DEABF6BBF52FD80B83C1 /* PBXContainerItemProxy */; + }; + 673D77682E593868E01C5FA765287285 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; + targetProxy = 0166D6CEA46A405AF6440470518778BB /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */ = { + 007503D8498115ADB100193B3AD6BACC /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */; + baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1132,16 +982,21 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Alamofire; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1149,43 +1004,46 @@ }; name = Release; }; - 2623EA9399E8F15FA92D7B9FD57C4FC9 /* Debug */ = { + 077C4BB7DBEAA715DED46C057DC8051C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */; + baseConfigurationReference = 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PromiseKit; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 8DFCF8B61E8E87BEC121F13D463ED5A5 /* Release */ = { + 2C23BEE8A5AA6F2B41B70CC48B77C8AF /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1207,6 +1065,8 @@ PRODUCT_NAME = PetstoreClient; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1214,83 +1074,11 @@ }; name = Release; }; - 91B7FF0075884FD652BE3D081577D6B0 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */ = { + 312A65877BADC6B9F09DBA3B46052BC0 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClientTests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - A8D7EB2B9C6028C3CFF700992765BA91 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D6C0428DC253F416C26670E1A755E6C7 /* PromiseKit.xcconfig */; + baseConfigurationReference = 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1312,6 +1100,8 @@ PRODUCT_NAME = PromiseKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1319,47 +1109,12 @@ }; name = Release; }; - AA6E8122A0F8D71757B2807B2041E880 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1367,20 +1122,27 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", "$(inherited)", ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1388,18 +1150,55 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.2; + ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; }; - name = Release; + name = Debug; }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { + 5A07E6EE032BF56741D5477EDC0DB5F0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FE7B50737921DC202987A0E4A1665B90 /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1407,24 +1206,23 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", + "POD_CONFIGURATION_RELEASE=1", "$(inherited)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1432,17 +1230,18 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.2; - ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; }; - name = Debug; + name = Release; }; - B6E0752FFEEE096B03BB77B7B0A0AD3F /* Debug */ = { + 67FE537456A8A54A8081FE9473FB59D8 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; + baseConfigurationReference = 425268D5A6D1CD870A663BBE38B62B46 /* PromiseKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1454,16 +1253,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PetstoreClient/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PetstoreClient; + PRODUCT_NAME = PromiseKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1472,10 +1272,11 @@ }; name = Debug; }; - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */ = { + 8892A82330D242C8CE8BF39F1275BA41 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1487,13 +1288,52 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C66477B6E5656B1F4785FD5D9546905A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -1506,12 +1346,13 @@ VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - F383079BFBF927813EA3613CFB679FDE /* Debug */ = { + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 650FB90BA05FD8D3E51FE82393B780C8 /* Alamofire.xcconfig */; + baseConfigurationReference = 6C68BF2CC332C9D6485B777BA7C063AE /* Alamofire.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -1533,6 +1374,7 @@ PRODUCT_NAME = Alamofire; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1541,59 +1383,96 @@ }; name = Debug; }; + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_SwaggerClientTests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 02482B3666DC12E2ABD164F8C86F2B54 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2623EA9399E8F15FA92D7B9FD57C4FC9 /* Debug */, - A8D7EB2B9C6028C3CFF700992765BA91 /* Release */, + 3F44D50290D52EC3C557274BDDAB4C7A /* Debug */, + 5FD3C308E1FF2B6C127426676CBBBEF9 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { isa = XCConfigurationList; buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, + D60F8C4DE6B0D221A33959774DA3DAFF /* Debug */, + 077C4BB7DBEAA715DED46C057DC8051C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + 607382BCFF2B60BA932C95EC3C22A69F /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - F383079BFBF927813EA3613CFB679FDE /* Debug */, - 0A29B6F510198AF64EFD762EF6FA97A5 /* Release */, + 8892A82330D242C8CE8BF39F1275BA41 /* Debug */, + 007503D8498115ADB100193B3AD6BACC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 607382BCFF2B60BA932C95EC3C22A69F /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + 9EAF730020668F908855C7CE58AD558B /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { isa = XCConfigurationList; buildConfigurations = ( - 91B7FF0075884FD652BE3D081577D6B0 /* Debug */, - AA6E8122A0F8D71757B2807B2041E880 /* Release */, + 5A07E6EE032BF56741D5477EDC0DB5F0 /* Debug */, + 2C23BEE8A5AA6F2B41B70CC48B77C8AF /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B1A4CABC9A5EAB96E49E2FD508880661 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - B6E0752FFEEE096B03BB77B7B0A0AD3F /* Debug */, - 8DFCF8B61E8E87BEC121F13D463ED5A5 /* Release */, + F89C2DC5B4DBA79FB9C8BA8F24E52DF4 /* Debug */, + C66477B6E5656B1F4785FD5D9546905A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { + EF55B259278E6A593DF7F60BDD524C1D /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - EFA70F2EAB610CE73EB4B75FFD679D69 /* Debug */, - A658260C69CC5FE8D2D4A6E6D37E820A /* Release */, + 67FE537456A8A54A8081FE9473FB59D8 /* Debug */, + 312A65877BADC6B9F09DBA3B46052BC0 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h deleted file mode 100644 index 351a93b97ed..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h +++ /dev/null @@ -1,44 +0,0 @@ -#import -#import - - -/** - To import the `NSNotificationCenter` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSNotificationCenter (PromiseKit) -/** - Observe the named notification once. - - [NSNotificationCenter once:UIKeyboardWillShowNotification].then(^(id note, id userInfo){ - UIViewAnimationCurve curve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; - CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; - - return [UIView promiseWithDuration:duration delay:0.0 options:(curve << 16) animations:^{ - - }]; - }); - - @warning *Important* Promises only resolve once. If you need your block to execute more than once then use `-addObserverForName:object:queue:usingBlock:`. - - @param notificationName The name of the notification for which to register the observer. - - @return A promise that fulfills with two parameters: - - 1. The NSNotification object. - 2. The NSNotification’s userInfo property. -*/ -+ (AnyPromise *)once:(NSString *)notificationName NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m deleted file mode 100644 index a3b8baf507d..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m +++ /dev/null @@ -1,16 +0,0 @@ -#import -#import -#import "PMKFoundation.h" - -@implementation NSNotificationCenter (PromiseKit) - -+ (AnyPromise *)once:(NSString *)name { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - __block id identifier = [[NSNotificationCenter defaultCenter] addObserverForName:name object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { - [[NSNotificationCenter defaultCenter] removeObserver:identifier name:name object:nil]; - resolve(PMKManifold(note, note.userInfo)); - }]; - }]; -} - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift deleted file mode 100644 index 6fa08cde3b8..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift +++ /dev/null @@ -1,45 +0,0 @@ -import Foundation.NSNotification -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSNotificationCenter` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension NotificationCenter { - /// Observe the named notification once - public func observe(once name: Notification.Name, object: Any? = nil) -> NotificationPromise { - let (promise, fulfill) = NotificationPromise.go() - let id = addObserver(forName: name, object: object, queue: nil, using: fulfill) - _ = promise.always { self.removeObserver(id) } - return promise - } -} - -/// The promise returned by `NotificationCenter.observe(once:)` -public class NotificationPromise: Promise<[AnyHashable: Any]> { - private let pending = Promise.pending() - - public func asNotification() -> Promise { - return pending.promise - } - - fileprivate class func go() -> (NotificationPromise, (Notification) -> Void) { - let (p, fulfill, _) = NotificationPromise.pending() - let promise = p as! NotificationPromise - _ = promise.pending.promise.then { fulfill($0.userInfo ?? [:]) } - return (promise, promise.pending.fulfill) - } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift deleted file mode 100644 index 48d81333750..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift +++ /dev/null @@ -1,64 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSObject` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSObject` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension NSObject { - /** - - Returns: A promise that resolves when the provided keyPath changes. - - Warning: *Important* The promise must not outlive the object under observation. - - SeeAlso: Apple’s KVO documentation. - */ - public func observe(keyPath: String) -> Promise { - let (promise, fulfill, reject) = Promise.pending() - let proxy = KVOProxy(observee: self, keyPath: keyPath) { obj in - if let obj = obj as? T { - fulfill(obj) - } else { - reject(PMKError.castError(T.self)) - } - } - proxy.retainCycle = proxy - return promise - } -} - -private class KVOProxy: NSObject { - var retainCycle: KVOProxy? - let fulfill: (Any?) -> Void - - init(observee: NSObject, keyPath: String, resolve: @escaping (Any?) -> Void) { - fulfill = resolve - super.init() - observee.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.new, context: pointer) - } - - fileprivate override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { - if let change = change, context == pointer { - defer { retainCycle = nil } - fulfill(change[NSKeyValueChangeKey.newKey]) - if let object = object as? NSObject, let keyPath = keyPath { - object.removeObserver(self, forKeyPath: keyPath) - } - } - } - - private lazy var pointer: UnsafeMutableRawPointer = { - return Unmanaged.passUnretained(self).toOpaque() - }() -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h deleted file mode 100644 index 29c2c0389e1..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h +++ /dev/null @@ -1,53 +0,0 @@ -#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR - -#import -#import - -#define PMKTaskErrorLaunchPathKey @"PMKTaskErrorLaunchPathKey" -#define PMKTaskErrorArgumentsKey @"PMKTaskErrorArgumentsKey" -#define PMKTaskErrorStandardOutputKey @"PMKTaskErrorStandardOutputKey" -#define PMKTaskErrorStandardErrorKey @"PMKTaskErrorStandardErrorKey" -#define PMKTaskErrorExitStatusKey @"PMKTaskErrorExitStatusKey" - -/** - To import the `NSTask` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSTask` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSTask (PromiseKit) - -/** - Launches the receiver and resolves when it exits. - - If the task fails the promise is rejected with code `PMKTaskError`, and - `userInfo` keys: `PMKTaskErrorStandardOutputKey`, - `PMKTaskErrorStandardErrorKey` and `PMKTaskErrorExitStatusKey`. - - NSTask *task = [NSTask new]; - task.launchPath = @"/usr/bin/basename"; - task.arguments = @[@"/usr/bin/sleep"]; - [task promise].then(^(NSString *stdout){ - //… - }); - - @return A promise that fulfills with three parameters: - - 1) The stdout interpreted as a UTF8 string. - 2) The stderr interpreted as a UTF8 string. - 3) The stdout as `NSData`. -*/ -- (AnyPromise *)promise NS_REFINED_FOR_SWIFT; - -@end - -#endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m deleted file mode 100644 index bfabd6157eb..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m +++ /dev/null @@ -1,46 +0,0 @@ -#import -#import -#import -#import -#import - -#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR - -#import "NSTask+AnyPromise.h" - -@implementation NSTask (PromiseKit) - -- (AnyPromise *)promise { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - self.standardOutput = [NSPipe pipe]; - self.standardError = [NSPipe pipe]; - self.terminationHandler = ^(NSTask *task){ - id stdoutData = [[task.standardOutput fileHandleForReading] readDataToEndOfFile]; - id stdoutString = [[NSString alloc] initWithData:stdoutData encoding:NSUTF8StringEncoding]; - id stderrData = [[task.standardError fileHandleForReading] readDataToEndOfFile]; - id stderrString = [[NSString alloc] initWithData:stderrData encoding:NSUTF8StringEncoding]; - - if (task.terminationReason == NSTaskTerminationReasonExit && self.terminationStatus == 0) { - resolve(PMKManifold(stdoutString, stderrString, stdoutData)); - } else { - id cmd = [NSMutableArray arrayWithObject:task.launchPath]; - [cmd addObjectsFromArray:task.arguments]; - cmd = [cmd componentsJoinedByString:@" "]; - - id info = @{ - NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed executing: %@.", cmd], - PMKTaskErrorStandardOutputKey: stdoutString, - PMKTaskErrorStandardErrorKey: stderrString, - PMKTaskErrorExitStatusKey: @(task.terminationStatus), - }; - - resolve([NSError errorWithDomain:PMKErrorDomain code:PMKTaskError userInfo:info]); - } - }; - [self launch]; - }]; -} - -@end - -#endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h deleted file mode 100644 index b71cf7e2797..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h +++ /dev/null @@ -1,66 +0,0 @@ -#import -#import -#import -#import - -#define PMKURLErrorFailingURLResponseKey @"PMKURLErrorFailingURLResponseKey" -#define PMKURLErrorFailingDataKey @"PMKURLErrorFailingDataKey" -#define PMKURLErrorFailingStringKey @"PMKURLErrorFailingStringKey" -#define PMKJSONErrorJSONObjectKey @"PMKJSONErrorJSONObjectKey" - -/** - To import the `NSURLSession` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSURLConnection` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - #import -*/ -@interface NSURLSession (PromiseKit) - -/** - Creates a task that retrieves the contents of a URL based on the - specified URL request object. - - PromiseKit automatically deserializes the raw HTTP data response into the - appropriate rich data type based on the mime type the server provides. - Thus if the response is JSON you will get the deserialized JSON response. - PromiseKit supports decoding into strings, JSON and UIImages. - - However if your server does not provide a rich content-type, you will - just get `NSData`. This is rare, but a good example we came across was - downloading files from Dropbox. - - PromiseKit goes to quite some lengths to provide good `NSError` objects - for error conditions at all stages of the HTTP to rich-data type - pipeline. We provide the following additional `userInfo` keys as - appropriate: - - - `PMKURLErrorFailingDataKey` - - `PMKURLErrorFailingStringKey` - - `PMKURLErrorFailingURLResponseKey` - - [[NSURLConnection sharedSession] promiseDataTaskWithRequest:rq].then(^(id response){ - // response is probably an NSDictionary deserialized from JSON - }); - - @param request The URL request. - - @return A promise that fulfills with three parameters: - - 1) The deserialized data response. - 2) The `NSHTTPURLResponse`. - 3) The raw `NSData` response. - - @see https://github.com/mxcl/OMGHTTPURLRQ -*/ -- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)request NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m deleted file mode 100644 index 91d4a067e25..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m +++ /dev/null @@ -1,113 +0,0 @@ -#import -#import -#import -#import "NSURLSession+AnyPromise.h" -#import -#import -#import -#import -#import -#import -#import -#import - -@implementation NSURLSession (PromiseKit) - -- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)rq { - return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { - [[self dataTaskWithRequest:rq completionHandler:^(NSData *data, id rsp, NSError *urlError){ - assert(![NSThread isMainThread]); - - PMKResolver fulfiller = ^(id responseObject){ - resolve(PMKManifold(responseObject, rsp, data)); - }; - PMKResolver rejecter = ^(NSError *error){ - id userInfo = error.userInfo.mutableCopy ?: [NSMutableDictionary new]; - if (data) userInfo[PMKURLErrorFailingDataKey] = data; - if (rsp) userInfo[PMKURLErrorFailingURLResponseKey] = rsp; - error = [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; - resolve(error); - }; - - NSStringEncoding (^stringEncoding)() = ^NSStringEncoding{ - id encodingName = [rsp textEncodingName]; - if (encodingName) { - CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName); - if (encoding != kCFStringEncodingInvalidId) - return CFStringConvertEncodingToNSStringEncoding(encoding); - } - return NSUTF8StringEncoding; - }; - - if (urlError) { - rejecter(urlError); - } else if (![rsp isKindOfClass:[NSHTTPURLResponse class]]) { - fulfiller(data); - } else if ([rsp statusCode] < 200 || [rsp statusCode] >= 300) { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned a bad HTTP response code", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:info]; - rejecter(err); - } else if (PMKHTTPURLResponseIsJSON(rsp)) { - // work around ever-so-common Rails workaround: https://github.com/rails/rails/issues/1742 - if ([rsp expectedContentLength] == 1 && [data isEqualToData:[NSData dataWithBytes:" " length:1]]) - return fulfiller(nil); - - NSError *err = nil; - id json = [NSJSONSerialization JSONObjectWithData:data options:PMKJSONDeserializationOptions error:&err]; - if (!err) { - fulfiller(json); - } else { - id userInfo = err.userInfo.mutableCopy; - if (data) { - NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding()]; - if (string) - userInfo[PMKURLErrorFailingStringKey] = string; - } - long long length = [rsp expectedContentLength]; - id bytes = length <= 0 ? @"" : [NSString stringWithFormat:@"%lld bytes", length]; - id fmt = @"The server claimed a %@ JSON response, but decoding failed with: %@"; - userInfo[NSLocalizedDescriptionKey] = [NSString stringWithFormat:fmt, bytes, userInfo[NSLocalizedDescriptionKey]]; - err = [NSError errorWithDomain:err.domain code:err.code userInfo:userInfo]; - rejecter(err); - } - #ifdef UIKIT_EXTERN - } else if (PMKHTTPURLResponseIsImage(rsp)) { - UIImage *image = [[UIImage alloc] initWithData:data]; - image = [[UIImage alloc] initWithCGImage:[image CGImage] scale:image.scale orientation:image.imageOrientation]; - if (image) - fulfiller(image); - else { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned invalid image data", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; - rejecter(err); - } - #endif - } else if (PMKHTTPURLResponseIsText(rsp)) { - id str = [[NSString alloc] initWithData:data encoding:stringEncoding()]; - if (str) - fulfiller(str); - else { - id info = @{ - NSLocalizedDescriptionKey: @"The server returned invalid string data", - NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, - NSURLErrorFailingURLErrorKey: rq.URL - }; - id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; - rejecter(err); - } - } else { - fulfiller(data); - } - }] resume]; - }]; -} - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift deleted file mode 100644 index 4789b84e249..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift +++ /dev/null @@ -1,50 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `NSURLSession` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `NSURLSession` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension URLSession { - /** - Makes an HTTP request using the parameters specified by the provided URL - request. - - We recommend the use of [OMGHTTPURLRQ] which allows you to construct correct REST requests. - - let rq = OMGHTTPURLRQ.POST(url, json: parameters) - NSURLSession.shared.dataTask(with: rq).asDictionary().then { json in - //… - } - - [We provide OMG extensions](https://github.com/PromiseKit/OMGHTTPURLRQ) - that allow eg: - - URLSession.shared.POST(url, json: ["a": "b"]) - - - Parameter request: The URL request. - - Returns: A promise that represents the URL request. - - SeeAlso: `URLDataPromise` - - SeeAlso: [OMGHTTPURLRQ] - - [OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ - */ - public func dataTask(with request: URLRequest) -> URLDataPromise { - return URLDataPromise.go(request) { completionHandler in - dataTask(with: request, completionHandler: completionHandler).resume() - } - } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h deleted file mode 100644 index 8796c0d11bb..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h +++ /dev/null @@ -1,3 +0,0 @@ -#import "NSNotificationCenter+AnyPromise.h" -#import "NSURLSession+AnyPromise.h" -#import "NSTask+AnyPromise.h" diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift deleted file mode 100644 index 396b87ff58a..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift +++ /dev/null @@ -1,146 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -#if os(macOS) - -/** - To import the `Process` category: - - use_frameworks! - pod "PromiseKit/Foundation" - - Or `Process` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit - */ -extension Process { - /** - Launches the receiver and resolves when it exits. - - let proc = Process() - proc.launchPath = "/bin/ls" - proc.arguments = ["/bin"] - proc.promise().asStandardOutput(encoding: .utf8).then { str in - print(str) - } - */ - public func promise() -> ProcessPromise { - standardOutput = Pipe() - standardError = Pipe() - - launch() - - let (p, fulfill, reject) = ProcessPromise.pending() - let promise = p as! ProcessPromise - - promise.task = self - - waldo.async { - self.waitUntilExit() - - if self.terminationReason == .exit && self.terminationStatus == 0 { - fulfill() - } else { - reject(Error(.execution, promise, self)) - } - - promise.task = nil - } - - return promise - } - - /** - The error generated by PromiseKit’s `Process` extension - */ - public struct Error: Swift.Error, CustomStringConvertible { - public let exitStatus: Int - public let stdout: Data - public let stderr: Data - public let args: [String] - public let code: Code - public let cmd: String - - init(_ code: Code, _ promise: ProcessPromise, _ task: Process) { - stdout = promise.stdout - stderr = promise.stderr - exitStatus = Int(task.terminationStatus) - cmd = task.launchPath ?? "" - args = task.arguments ?? [] - self.code = code - } - - /// The type of `Process` error - public enum Code { - /// The data could not be converted to a UTF8 String - case encoding - /// The task execution failed - case execution - } - - /// A textual representation of the error - public var description: String { - switch code { - case .encoding: - return "Could not decode command output into string." - case .execution: - let str = ([cmd] + args).joined(separator: " ") - return "Failed executing: `\(str)`." - } - } - } -} - -final public class ProcessPromise: Promise { - fileprivate var task: Process! - - fileprivate var stdout: Data { - return (task.standardOutput! as! Pipe).fileHandleForReading.readDataToEndOfFile() - } - - fileprivate var stderr: Data { - return (task.standardError! as! Pipe).fileHandleForReading.readDataToEndOfFile() - } - - public func asStandardOutput() -> Promise { - return then(on: zalgo) { _ in self.stdout } - } - - public func asStandardError() -> Promise { - return then(on: zalgo) { _ in self.stderr } - } - - public func asStandardPair() -> Promise<(Data, Data)> { - return then(on: zalgo) { _ in (self.stderr, self.stdout) } - } - - private func decode(_ encoding: String.Encoding, _ data: Data) throws -> String { - guard let str = String(bytes: data, encoding: encoding) else { - throw Process.Error(.encoding, self, self.task) - } - return str - } - - public func asStandardPair(encoding: String.Encoding) -> Promise<(String, String)> { - return then(on: zalgo) { _ in - (try self.decode(encoding, self.stdout), try self.decode(encoding, self.stderr)) - } - } - - public func asStandardOutput(encoding: String.Encoding) -> Promise { - return then(on: zalgo) { _ in try self.decode(encoding, self.stdout) } - } - - public func asStandardError(encoding: String.Encoding) -> Promise { - return then(on: zalgo) { _ in try self.decode(encoding, self.stderr) } - } -} - -#endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift deleted file mode 100644 index 2c380a5a92d..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/URLDataPromise.swift +++ /dev/null @@ -1,121 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -public enum Encoding { - /// Decode as JSON - case json(JSONSerialization.ReadingOptions) -} - -/** - A promise capable of decoding common Internet data types. - - Used by: - - - PromiseKit/Foundation - - PromiseKit/Social - - PromiseKit/OMGHTTPURLRQ - - But probably of general use to any promises that receive HTTP `Data`. - */ -public class URLDataPromise: Promise { - /// Convert the promise to a tuple of `(Data, URLResponse)` - public func asDataAndResponse() -> Promise<(Data, Foundation.URLResponse)> { - return then(on: zalgo) { ($0, self.URLResponse) } - } - - /// Decode the HTTP response to a String, the string encoding is read from the response. - public func asString() -> Promise { - return then(on: waldo) { data -> String in - guard let str = String(bytes: data, encoding: self.URLResponse.stringEncoding ?? .utf8) else { - throw PMKURLError.stringEncoding(self.URLRequest, data, self.URLResponse) - } - return str - } - } - - /// Decode the HTTP response as a JSON array - public func asArray(_ encoding: Encoding = .json(.allowFragments)) -> Promise { - return then(on: waldo) { data -> NSArray in - switch encoding { - case .json(let options): - guard !data.b0rkedEmptyRailsResponse else { return NSArray() } - let json = try JSONSerialization.jsonObject(with: data, options: options) - guard let array = json as? NSArray else { throw JSONError.unexpectedRootNode(json) } - return array - } - } - } - - /// Decode the HTTP response as a JSON dictionary - public func asDictionary(_ encoding: Encoding = .json(.allowFragments)) -> Promise { - return then(on: waldo) { data -> NSDictionary in - switch encoding { - case .json(let options): - guard !data.b0rkedEmptyRailsResponse else { return NSDictionary() } - let json = try JSONSerialization.jsonObject(with: data, options: options) - guard let dict = json as? NSDictionary else { throw JSONError.unexpectedRootNode(json) } - return dict - } - } - } - - fileprivate var URLRequest: Foundation.URLRequest! - fileprivate var URLResponse: Foundation.URLResponse! - - /// Internal - public class func go(_ request: URLRequest, body: (@escaping (Data?, URLResponse?, Error?) -> Void) -> Void) -> URLDataPromise { - let (p, fulfill, reject) = URLDataPromise.pending() - let promise = p as! URLDataPromise - - body { data, rsp, error in - promise.URLRequest = request - promise.URLResponse = rsp - - if let error = error { - reject(error) - } else if let data = data, let rsp = rsp as? HTTPURLResponse, (200..<300) ~= rsp.statusCode { - fulfill(data) - } else if let data = data, !(rsp is HTTPURLResponse) { - fulfill(data) - } else { - reject(PMKURLError.badResponse(request, data, rsp)) - } - } - - return promise - } -} - -#if os(iOS) - import UIKit.UIImage - - extension URLDataPromise { - /// Decode the HTTP response as a UIImage - public func asImage() -> Promise { - return then(on: waldo) { data -> UIImage in - guard let img = UIImage(data: data), let cgimg = img.cgImage else { - throw PMKURLError.invalidImageData(self.URLRequest, data) - } - // this way of decoding the image limits main thread impact when displaying the image - return UIImage(cgImage: cgimg, scale: img.scale, orientation: img.imageOrientation) - } - } - } -#endif - -extension URLResponse { - fileprivate var stringEncoding: String.Encoding? { - guard let encodingName = textEncodingName else { return nil } - let encoding = CFStringConvertIANACharSetNameToEncoding(encodingName as CFString) - guard encoding != kCFStringEncodingInvalidId else { return nil } - return String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(encoding)) - } -} - -extension Data { - fileprivate var b0rkedEmptyRailsResponse: Bool { - return count == 1 && withUnsafeBytes{ $0[0] == " " } - } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift deleted file mode 100644 index ecc9edd852f..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/Foundation/Sources/afterlife.swift +++ /dev/null @@ -1,26 +0,0 @@ -import Foundation -#if !COCOAPODS -import PromiseKit -#endif - -/** - - Returns: A promise that resolves when the provided object deallocates - - Important: The promise is not guarenteed to resolve immediately when the provided object is deallocated. So you cannot write code that depends on exact timing. - */ -public func after(life object: NSObject) -> Promise { - var reaper = objc_getAssociatedObject(object, &handle) as? GrimReaper - if reaper == nil { - reaper = GrimReaper() - objc_setAssociatedObject(object, &handle, reaper, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - return reaper!.promise -} - -private var handle: UInt8 = 0 - -private class GrimReaper: NSObject { - deinit { - fulfill() - } - let (promise, fulfill, _) = Promise.pending() -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h deleted file mode 100644 index 0026d378cf5..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// CALayer+AnyPromise.h -// -// Created by María Patricia Montalvo Dzib on 24/11/14. -// Copyright (c) 2014 Aluxoft SCP. All rights reserved. -// - -#import -#import - -/** - To import the `CALayer` category: - - use_frameworks! - pod "PromiseKit/QuartzCore" - - Or `CALayer` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface CALayer (PromiseKit) - -/** - Add the specified animation object to the layer’s render tree. - - @return A promise that thens two parameters: - - 1. `@YES` if the animation progressed entirely to completion. - 2. The `CAAnimation` object. - - @see addAnimation:forKey -*/ -- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key; - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m deleted file mode 100644 index 6ad7e2f13e2..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// CALayer+PromiseKit.m -// -// Created by María Patricia Montalvo Dzib on 24/11/14. -// Copyright (c) 2014 Aluxoft SCP. All rights reserved. -// - -#import -#import "CALayer+AnyPromise.h" - -@interface PMKCAAnimationDelegate : NSObject { -@public - PMKResolver resolve; - CAAnimation *animation; -} -@end - -@implementation PMKCAAnimationDelegate - -- (void)animationDidStop:(CAAnimation *)ignoreOrRetainCycleHappens finished:(BOOL)flag { - resolve(PMKManifold(@(flag), animation)); - animation.delegate = nil; -} - -@end - -@implementation CALayer (PromiseKit) - -- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key { - PMKCAAnimationDelegate *d = animation.delegate = [PMKCAAnimationDelegate new]; - d->animation = animation; - [self addAnimation:animation forKey:key]; - return [[AnyPromise alloc] initWithResolver:&d->resolve]; -} - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h deleted file mode 100644 index 585f7fddb66..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h +++ /dev/null @@ -1 +0,0 @@ -#import "CALayer+AnyPromise.h" diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift deleted file mode 100644 index 3ebc5813a31..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKAlertController.swift +++ /dev/null @@ -1,96 +0,0 @@ -import UIKit -#if !COCOAPODS -import PromiseKit -#endif - -//TODO tests -//TODO NSCoding - -/** - A “promisable” UIAlertController. - - UIAlertController is not a suitable API for an extension; it has closure - handlers on its main API for each button and an extension would have to - either replace all these when the controller is presented or force you to - use an extended addAction method, which would be easy to forget part of - the time. Hence we provide a facade pattern that can be promised. - - let alert = PMKAlertController("OHAI") - let sup = alert.addActionWithTitle("SUP") - let bye = alert.addActionWithTitle("BYE") - promiseViewController(alert).then { action in - switch action { - case is sup: - //… - case is bye: - //… - } - } -*/ -public class PMKAlertController { - /// The title of the alert. - public var title: String? { return UIAlertController.title } - /// Descriptive text that provides more details about the reason for the alert. - public var message: String? { return UIAlertController.message } - /// The style of the alert controller. - public var preferredStyle: UIAlertControllerStyle { return UIAlertController.preferredStyle } - /// The actions that the user can take in response to the alert or action sheet. - public var actions: [UIAlertAction] { return UIAlertController.actions } - /// The array of text fields displayed by the alert. - public var textFields: [UITextField]? { return UIAlertController.textFields } - -#if !os(tvOS) - /// The nearest popover presentation controller that is managing the current view controller. - public var popoverPresentationController: UIPopoverPresentationController? { return UIAlertController.popoverPresentationController } -#endif - - /// Creates and returns a view controller for displaying an alert to the user. - public required init(title: String?, message: String? = nil, preferredStyle: UIAlertControllerStyle = .alert) { - UIAlertController = UIKit.UIAlertController(title: title, message: message, preferredStyle: preferredStyle) - } - - /// Attaches an action title to the alert or action sheet. - public func addActionWithTitle(title: String, style: UIAlertActionStyle = .default) -> UIAlertAction { - let action = UIAlertAction(title: title, style: style) { action in - if style != .cancel { - self.fulfill(action) - } else { - self.reject(Error.cancelled) - } - } - UIAlertController.addAction(action) - return action - } - - /// Adds a text field to an alert. - public func addTextFieldWithConfigurationHandler(configurationHandler: ((UITextField) -> Void)?) { - UIAlertController.addTextField(configurationHandler: configurationHandler) - } - - fileprivate let UIAlertController: UIKit.UIAlertController - fileprivate let (promise, fulfill, reject) = Promise.pending() - fileprivate var retainCycle: PMKAlertController? - - /// Errors that represent PMKAlertController failures - public enum Error: CancellableError { - /// The user cancelled the PMKAlertController. - case cancelled - - /// - Returns: true - public var isCancelled: Bool { - return self == .cancelled - } - } -} - -extension UIViewController { - /// Presents the PMKAlertController, resolving with the user action. - public func promise(_ vc: PMKAlertController, animated: Bool = true, completion: (() -> Void)? = nil) -> Promise { - vc.retainCycle = vc - present(vc.UIAlertController, animated: animated, completion: completion) - _ = vc.promise.always { _ -> Void in - vc.retainCycle = nil - } - return vc.promise - } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h deleted file mode 100644 index 5133264586d..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h +++ /dev/null @@ -1,2 +0,0 @@ -#import "UIView+AnyPromise.h" -#import "UIViewController+AnyPromise.h" diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h deleted file mode 100644 index 0a19cd6fe12..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h +++ /dev/null @@ -1,80 +0,0 @@ -#import -#import - -// Created by Masafumi Yoshida on 2014/07/11. -// Copyright (c) 2014年 DeNA. All rights reserved. - -/** - To import the `UIView` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface UIView (PromiseKit) - -/** - Animate changes to one or more views using the specified duration. - - @param duration The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - @param animations A block object containing the changes to commit to the - views. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Animate changes to one or more views using the specified duration, delay, - options, and completion handler. - - @param duration The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - @param delay The amount of time (measured in seconds) to wait before - beginning the animations. Specify a value of 0 to begin the animations - immediately. - - @param options A mask of options indicating how you want to perform the - animations. For a list of valid constants, see UIViewAnimationOptions. - - @param animations A block object containing the changes to commit to the - views. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Performs a view animation using a timing curve corresponding to the - motion of a physical spring. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -/** - Creates an animation block object that can be used to set up - keyframe-based animations for the current view. - - @return A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. -*/ -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m deleted file mode 100644 index 04ee940358c..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m +++ /dev/null @@ -1,64 +0,0 @@ -// -// UIView+PromiseKit_UIAnimation.m -// YahooDenaStudy -// -// Created by Masafumi Yoshida on 2014/07/11. -// Copyright (c) 2014年 DeNA. All rights reserved. -// - -#import -#import "UIView+AnyPromise.h" - - -#define CopyPasta \ - NSAssert([NSThread isMainThread], @"UIKit animation must be performed on the main thread"); \ - \ - if (![NSThread isMainThread]) { \ - id error = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"Animation was attempted on a background thread"}]; \ - return [AnyPromise promiseWithValue:error]; \ - } \ - \ - PMKResolver resolve = nil; \ - AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; - - -@implementation UIView (PromiseKit) - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations { - return [self promiseWithDuration:duration delay:0 options:0 animations:animations]; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateWithDuration:duration delay:delay usingSpringWithDamping:dampingRatio initialSpringVelocity:velocity options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -+ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void(^)(void))animations -{ - CopyPasta; - - [UIView animateKeyframesWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { - resolve(@(finished)); - }]; - - return promise; -} - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift deleted file mode 100644 index 5575e49077f..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift +++ /dev/null @@ -1,46 +0,0 @@ -import UIKit.UIView -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import the `UIView` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension UIView { - /** - Animate changes to one or more views using the specified duration, delay, - options, and completion handler. - - - Parameter duration: The total duration of the animations, measured in - seconds. If you specify a negative value or 0, the changes are made - without animating them. - - - Parameter delay: The amount of time (measured in seconds) to wait before - beginning the animations. Specify a value of 0 to begin the animations - immediately. - - - Parameter options: A mask of options indicating how you want to perform the - animations. For a list of valid constants, see UIViewAnimationOptions. - - - Parameter animations: A block object containing the changes to commit to the - views. - - - Returns: A promise that fulfills with a boolean NSNumber indicating - whether or not the animations actually finished. - */ - public class func promise(animateWithDuration duration: TimeInterval, delay: TimeInterval = 0, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Promise { - return PromiseKit.wrap { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) } - } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h deleted file mode 100644 index 0e60ca9e7f9..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h +++ /dev/null @@ -1,71 +0,0 @@ -#import -#import - -/** - To import the `UIViewController` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - @import PromiseKit; -*/ -@interface UIViewController (PromiseKit) - -/** - Presents a view controller modally. - - If the view controller is one of the following: - - - MFMailComposeViewController - - MFMessageComposeViewController - - UIImagePickerController - - SLComposeViewController - - Then PromiseKit presents the view controller returning a promise that is - resolved as per the documentation for those classes. Eg. if you present a - `UIImagePickerController` the view controller will be presented for you - and the returned promise will resolve with the media the user selected. - - [self promiseViewController:[MFMailComposeViewController new] animated:YES completion:nil].then(^{ - //… - }); - - Otherwise PromiseKit expects your view controller to implement a - `promise` property. This promise will be returned from this method and - presentation and dismissal of the presented view controller will be - managed for you. - - \@interface MyViewController: UIViewController - @property (readonly) AnyPromise *promise; - @end - - @implementation MyViewController { - PMKResolver resolve; - } - - - (void)viewDidLoad { - _promise = [[AnyPromise alloc] initWithResolver:&resolve]; - } - - - (void)later { - resolve(@"some fulfilled value"); - } - - @end - - [self promiseViewController:[MyViewController new] aniamted:YES completion:nil].then(^(id value){ - // value == @"some fulfilled value" - }); - - @return A promise that can be resolved by the presented view controller. -*/ -- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block NS_REFINED_FOR_SWIFT; - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m deleted file mode 100644 index 93e7e00db6e..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m +++ /dev/null @@ -1,140 +0,0 @@ -#import -#import "UIViewController+AnyPromise.h" -#import - -#if PMKImagePickerController -#import -#endif - -@interface PMKGenericDelegate : NSObject { -@public - PMKResolver resolve; -} -+ (instancetype)delegateWithPromise:(AnyPromise **)promise; -@end - -@interface UIViewController () -- (AnyPromise*) promise; -@end - -@implementation UIViewController (PromiseKit) - -- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block { - __kindof UIViewController *vc2present = vc; - AnyPromise *promise = nil; - - if ([vc isKindOfClass:NSClassFromString(@"MFMailComposeViewController")]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"mailComposeDelegate"]; - } - else if ([vc isKindOfClass:NSClassFromString(@"MFMessageComposeViewController")]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"messageComposeDelegate"]; - } -#ifdef PMKImagePickerController - else if ([vc isKindOfClass:[UIImagePickerController class]]) { - PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; - [vc setValue:delegate forKey:@"delegate"]; - } -#endif - else if ([vc isKindOfClass:NSClassFromString(@"SLComposeViewController")]) { - PMKResolver resolve; - promise = [[AnyPromise alloc] initWithResolver:&resolve]; - [vc setValue:^(NSInteger result){ - if (result == 0) { - resolve([NSError cancelledError]); - } else { - resolve(@(result)); - } - } forKey:@"completionHandler"]; - } - else if ([vc isKindOfClass:[UINavigationController class]]) - vc = [(id)vc viewControllers].firstObject; - - if (!vc) { - id userInfo = @{NSLocalizedDescriptionKey: @"nil or effective nil passed to promiseViewController"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - - if (!promise) { - if (![vc respondsToSelector:@selector(promise)]) { - id userInfo = @{NSLocalizedDescriptionKey: @"ViewController is not promisable"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - - promise = [vc valueForKey:@"promise"]; - - if (![promise isKindOfClass:[AnyPromise class]]) { - id userInfo = @{NSLocalizedDescriptionKey: @"The promise property is nil or not of type AnyPromise"}; - id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; - return [AnyPromise promiseWithValue:err]; - } - } - - if (!promise.pending) - return promise; - - [self presentViewController:vc2present animated:animated completion:block]; - - promise.always(^{ - [vc2present.presentingViewController dismissViewControllerAnimated:animated completion:nil]; - }); - - return promise; -} - -@end - - - -@implementation PMKGenericDelegate { - id retainCycle; -} - -+ (instancetype)delegateWithPromise:(AnyPromise **)promise; { - PMKGenericDelegate *d = [PMKGenericDelegate new]; - d->retainCycle = d; - *promise = [[AnyPromise alloc] initWithResolver:&d->resolve]; - return d; -} - -- (void)mailComposeController:(id)controller didFinishWithResult:(int)result error:(NSError *)error { - if (error != nil) { - resolve(error); - } else if (result == 0) { - resolve([NSError cancelledError]); - } else { - resolve(@(result)); - } - retainCycle = nil; -} - -- (void)messageComposeViewController:(id)controller didFinishWithResult:(int)result { - if (result == 2) { - id userInfo = @{NSLocalizedDescriptionKey: @"The attempt to save or send the message was unsuccessful."}; - id error = [NSError errorWithDomain:PMKErrorDomain code:PMKOperationFailed userInfo:userInfo]; - resolve(error); - } else { - resolve(@(result)); - } - retainCycle = nil; -} - -#ifdef PMKImagePickerController - -- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - id img = info[UIImagePickerControllerEditedImage] ?: info[UIImagePickerControllerOriginalImage]; - resolve(PMKManifold(img, info)); - retainCycle = nil; -} - -- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - resolve([NSError cancelledError]); - retainCycle = nil; -} - -#endif - -@end diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift deleted file mode 100644 index f02b9e64bb0..00000000000 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Extensions/UIKit/Sources/UIViewController+Promise.swift +++ /dev/null @@ -1,111 +0,0 @@ -import Foundation.NSError -import UIKit -#if !COCOAPODS -import PromiseKit -#endif - -/** - To import this `UIViewController` category: - - use_frameworks! - pod "PromiseKit/UIKit" - - Or `UIKit` is one of the categories imported by the umbrella pod: - - use_frameworks! - pod "PromiseKit" - - And then in your sources: - - import PromiseKit -*/ -extension UIViewController { - - public enum PMKError: Error { - case navigationControllerEmpty - case noImageFound - case notPromisable - case notGenericallyPromisable - case nilPromisable - } - - /// Configures when a UIViewController promise resolves - public enum FulfillmentType { - /// The promise resolves just after the view controller has disappeared. - case onceDisappeared - /// The promise resolves before the view controller has disappeared. - case beforeDismissal - } - - /// Presents the UIViewController, resolving with the user action. - public func promise(_ vc: UIViewController, animate animationOptions: PMKAnimationOptions = [.appear, .disappear], fulfills fulfillmentType: FulfillmentType = .onceDisappeared, completion: (() -> Void)? = nil) -> Promise { - let pvc: UIViewController - - switch vc { - case let nc as UINavigationController: - guard let vc = nc.viewControllers.first else { return Promise(error: PMKError.navigationControllerEmpty) } - pvc = vc - default: - pvc = vc - } - - let promise: Promise - - if !(pvc is Promisable) { - promise = Promise(error: PMKError.notPromisable) - } else if let p = pvc.value(forKeyPath: "promise") as? Promise { - promise = p - } else if let _ = pvc.value(forKeyPath: "promise") { - promise = Promise(error: PMKError.notGenericallyPromisable) - } else { - promise = Promise(error: PMKError.nilPromisable) - } - - if !promise.isPending { - return promise - } - - present(vc, animated: animationOptions.contains(.appear), completion: completion) - - let (wrappingPromise, fulfill, reject) = Promise.pending() - - switch fulfillmentType { - case .onceDisappeared: - promise.then { result in - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: { fulfill(result) }) - } - .catch(policy: .allErrors) { error in - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: { reject(error) }) - } - case .beforeDismissal: - promise.then { result -> Void in - fulfill(result) - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: nil) - } - .catch(policy: .allErrors) { error in - reject(error) - vc.presentingViewController?.dismiss(animated: animationOptions.contains(.disappear), completion: nil) - } - } - - return wrappingPromise - } - - @available(*, deprecated: 3.4, renamed: "promise(_:animate:fulfills:completion:)") - public func promiseViewController(_ vc: UIViewController, animated: Bool = true, completion: (() -> Void)? = nil) -> Promise { - return promise(vc, animate: animated ? [.appear, .disappear] : [], completion: completion) - } -} - -/// A protocol for UIViewControllers that can be promised. -@objc(Promisable) public protocol Promisable { - /** - Provide a promise for promiseViewController here. - - The resulting property must be annotated with @objc. - - Obviously return a Promise. There is an issue with generics and Swift and - protocols currently so we couldn't specify that. - */ - var promise: AnyObject! { get } -} diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md index 0e2b93b1393..16f7520a241 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md @@ -2,12 +2,13 @@ ![badge-pod] ![badge-languages] ![badge-pms] ![badge-platforms] ![badge-mit] -[繁體中文](README.zh_Hant.md) [简体中文](README.zh_CN.md) +[繁體中文](README.zh_Hant.md), [简体中文](README.zh_CN.md) --- -Modern development is highly asynchronous: isn’t it about time we had tools that -made programming asynchronously powerful, easy and delightful? +Promises simplify asynchronous programming, freeing you up to focus on the more +important things. They are easy to learn, easy to master and result in clearer, +more readable code. Your co-workers will thank you. ```swift UIApplication.shared.isNetworkActivityIndicatorVisible = true @@ -20,228 +21,112 @@ firstly { }.always { UIApplication.shared.isNetworkActivityIndicatorVisible = false }.catch { error in - UIAlertView(/*…*/).show() + self.show(UIAlertController(for: error), sender: self) } ``` PromiseKit is a thoughtful and complete implementation of promises for any -platform with a `swiftc` (indeed, this includes *Linux*), it has *excellent* Objective-C bridging and +platform with a `swiftc`, it has *excellent* Objective-C bridging and *delightful* specializations for iOS, macOS, tvOS and watchOS. # Quick Start -We recommend [CocoaPods] or [Carthage], however you can just drop `PromiseKit.xcodeproj` into your project and add `PromiseKit.framework` to your app’s embedded frameworks. - -## Xcode 8 / Swift 3 +In your [Podfile]: ```ruby -# CocoaPods >= 1.1.0-rc.2 -swift_version = "3.0" -pod "PromiseKit", "~> 4.0" - -# Carthage -github "mxcl/PromiseKit" ~> 4.0 - -# SwiftPM -let package = Package( - dependencies: [ - .Package(url: "https://github.com/mxcl/PromiseKit", majorVersion: 4) - ] -) +use_frameworks! +swift_version = "3.1" +pod "PromiseKit", "~> 4.3" ``` -## Xcode 8 / Swift 2.3 or Xcode 7 - -```ruby -# CocoaPods -swift_version = "2.3" -pod "PromiseKit", "~> 3.5" +PromiseKit 4 supports Xcode 8 and 9, Swift 3.0, 3.1, 3.2 and Swift 4.0. -# Carthage -github "mxcl/PromiseKit" ~> 3.5 -``` +For Carthage, SwiftPM, etc., or for instructions when using older Swifts or +Xcodes see our [Installation Guide](Documentation/Installation.md). # Documentation -We have thorough and complete documentation at [promisekit.org]. - -## Overview - -Promises are defined by the function `then`: - -```swift -login().then { json in - //… -} -``` - -They are chainable: - -```swift -login().then { json -> Promise in - return fetchAvatar(json["username"]) -}.then { avatarImage in - self.imageView.image = avatarImage -} -``` - -Errors cascade through chains: - -```swift -login().then { - return fetchAvatar() -}.then { avatarImage in - //… -}.catch { error in - UIAlertView(/*…*/).show() -} -``` - -They are composable: +* Handbook + * [Getting Started](Documentation/GettingStarted.md) + * [Promises: Common Patterns](Documentation/CommonPatterns.md) + * [Frequently Asked Questions](Documentation/FAQ.md) +* Manual + * [Installation Guide](Documentation/Installation.md) + * [Objective-C Guide](Documentation/ObjectiveC.md) + * [Troubleshooting](Documentation/Troubleshooting.md) (eg. solutions to common compile errors) + * [Appendix](Documentation/Appendix.md) -```swift -let username = login().then{ $0["username"] } - -when(username, CLLocationManager.promise()).then { user, location in - return fetchAvatar(user, location: location) -}.then { image in - //… -} -``` - -They are trivial to refactor: - -```swift -func avatar() -> Promise { - let username = login().then{ $0["username"] } - - return when(username, CLLocationManager.promise()).then { user, location in - return fetchAvatar(user, location: location) - } -} -``` - -You can easily create a new, pending promise. -```swift -func fetchAvatar(user: String) -> Promise { - return Promise { fulfill, reject in - MyWebHelper.GET("\(user)/avatar") { data, err in - guard let data = data else { return reject(err) } - guard let img = UIImage(data: data) else { return reject(MyError.InvalidImage) } - guard let img.size.width > 0 else { return reject(MyError.ImageTooSmall) } - fulfill(img) - } - } -} -``` - -## Continue Learning… - -Complete and progressive learning guide at [promisekit.org]. - -## PromiseKit vs. Xcode - -PromiseKit contains Swift, so we engage in an unending battle with Xcode: - -| Swift | Xcode | PromiseKit | CI Status | Release Notes | -| ----- | ----- | ---------- | ------------ | ----------------- | -| 3 | 8 | 4 | ![ci-master] | [2016/09][news-4] | -| 2 | 7/8 | 3 | ![ci-swift2] | [2015/10][news-3] | -| 1 | 7 | 3 | – | [2015/10][news-3] | -| *N/A* | * | 1† | ![ci-legacy] | – | - -† PromiseKit 1 is pure Objective-C and thus can be used with any Xcode, it is -also your only choice if you need to support iOS 7 or below. - ---- - -We also maintain some branches to aid migrating between Swift versions: - -| Xcode | Swift | PromiseKit | Branch | CI Status | -| ----- | ----- | -----------| --------------------------- | --------- | -| 8.0 | 2.3 | 2 | [swift-2.3-minimal-changes] | ![ci-23] | -| 7.3 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | -| 7.2 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | -| 7.1 | 2.1 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | -| 7.0 | 2.0 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | - -We do **not** usually backport fixes to these branches, but pull-requests are welcome. +If you are looking for a function’s documentation, then please note +[our sources](Sources/) are thoroughly documented. # Extensions -Promises are only as useful as the asynchronous tasks they represent, thus we -have converted (almost) all of Apple’s APIs to Promises. The default CocoaPod -comes with promises UIKit and Foundation, the rest are accessed by specifying -additional subspecs in your `Podfile`, eg: +Promises are only as useful as the asynchronous tasks they represent, thus we +have converted (almost) all of Apple’s APIs to promises. The default CocoaPod +comes with promises for UIKit and Foundation, the rest can be installed by +specifying additional subspecs in your `Podfile`, eg: ```ruby -pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } -pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } +pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } +pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } ``` -All our extensions are separate repositories at the [PromiseKit org ](https://github.com/PromiseKit). - -For Carthage specify the additional repositories in your `Cartfile`: - -```ruby -github "PromiseKit/MapKit" ~> 1.0 -``` +All our extensions are separate repositories at the [PromiseKit organization]. ## Choose Your Networking Library -`NSURLSession` is typically inadequate; choose from [Alamofire] or [OMGHTTPURLRQ]: +Promise chains are commonly started with networking, thus we offer multiple +options: [Alamofire], [OMGHTTPURLRQ] and of course (vanilla) `NSURLSession`: ```swift -// pod 'PromiseKit/Alamofire' -Alamofire.request("http://example.com", withMethod: .GET).responseJSON().then { json in +// pod 'PromiseKit/Alamofire' +// https://github.com/PromiseKit/Alamofire +Alamofire.request("http://example.com", method: .post).responseJSON().then { json in //… }.catch { error in //… } // pod 'PromiseKit/OMGHTTPURLRQ' -URLSession.GET("http://example.com").asDictionary().then { json in - +// https://github.com/PromiseKit/OMGHTTPURLRQ +URLSession.POST("http://example.com").asDictionary().then { json in + //… +}.catch { error in + //… +} + +// pod 'PromiseKit/Foundation' +// https://github.com/PromiseKit/Foundation +URLSession.shared.dataTask(url).asDictionary().then { json in + // … }.catch { error in //… } ``` -For [AFNetworking] we recommend [csotiriou/AFNetworking]. +Nobody ever got fired for using Alamofire, but at the end of the day, it’s +just a small wrapper around `NSURLSession`. OMGHTTPURLRQ supplements +`NSURLRequest` to make generating REST style requests easier, and the PromiseKit +extensions extend `NSURLSession` to make OMG usage more convenient. But since a +while now most servers accept JSON, so writing a simple API class that uses +vanilla `NSURLSession` and our promises is not hard, and gives you the most +control with the fewest black-boxes. +The choice is yours. -# Need to convert your codebase to Promises? +# Support -From experience it really improves the robustness of your app, feel free to ask us how to go about it. +Ask your question at our [Gitter chat channel] or on [our bug tracker]. -# Support -Ask your question at our [Gitter chat channel](https://gitter.im/mxcl/PromiseKit) or on -[our bug tracker](https://github.com/mxcl/PromiseKit/issues/new). - - -[travis]: https://travis-ci.org/mxcl/PromiseKit -[ci-master]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=master -[ci-legacy]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=legacy-1.x -[ci-swift2]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.x -[ci-23]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.3-minimal-changes -[ci-22]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.2-minimal-changes -[ci-20]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.0-minimal-changes -[news-2]: http://promisekit.org/news/2015/05/PromiseKit-2.0-Released/ -[news-3]: https://github.com/mxcl/PromiseKit/blob/master/CHANGELOG.markdown#300-oct-1st-2015 -[news-4]: http://promisekit.org/news/2016/09/PromiseKit-4.0-Released/ -[swift-2.3-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.3-minimal-changes -[swift-2.2-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.2-minimal-changes -[swift-2.0-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes -[promisekit.org]: http://promisekit.org/docs/ [badge-pod]: https://img.shields.io/cocoapods/v/PromiseKit.svg?label=version -[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg +[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg [badge-languages]: https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg +[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg [badge-mit]: https://img.shields.io/badge/license-MIT-blue.svg -[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg [OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ [Alamofire]: http://alamofire.org -[AFNetworking]: https://github.com/AFNetworking/AFNetworking -[csotiriou/AFNetworking]: https://github.com/csotiriou/AFNetworking-PromiseKit -[CocoaPods]: http://cocoapods.org -[Carthage]: 2016-09-05-PromiseKit-4.0-Released +[PromiseKit organization]: https://github.com/PromiseKit +[Gitter chat channel]: https://gitter.im/mxcl/PromiseKit +[our bug tracker]: https://github.com/mxcl/PromiseKit/issues/new +[Podfile]: https://guides.cocoapods.org/syntax/podfile.html diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h index efc2bcaba27..756ba7b7b4d 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h @@ -27,7 +27,7 @@ @interface AnyPromise (Swift) - (AnyPromise * __nonnull)__thenOn:(__nonnull dispatch_queue_t)q execute:(id __nullable (^ __nonnull)(id __nullable))body; -- (AnyPromise * __nonnull)__catchWithPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__catchOn:(__nonnull dispatch_queue_t)q withPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; - (AnyPromise * __nonnull)__alwaysOn:(__nonnull dispatch_queue_t)q execute:(void (^ __nonnull)(void))body; - (void)__pipe:(void(^ __nonnull)(__nullable id))body; - (AnyPromise * __nonnull)initWithResolverBlock:(void (^ __nonnull)(PMKResolver __nonnull))resolver; diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h index 28806f2755c..6aafad7802d 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h @@ -100,6 +100,35 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { - (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catch NS_REFINED_FOR_SWIFT; #endif +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the global background queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catchInBackground NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on queue provided. + + @warning *Note* Cancellation errors are not caught. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))catchOn NS_REFINED_FOR_SWIFT; + /** The provided block is executed when the receiver is rejected with the specified policy. @@ -109,6 +138,17 @@ typedef NS_ENUM(NSInteger, PMKCatchPolicy) { */ - (AnyPromise * __nonnull(^ __nonnull)(PMKCatchPolicy, id __nonnull))catchWithPolicy NS_REFINED_FOR_SWIFT; +/** + The provided block is executed when the receiver is rejected with the specified policy. + + Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. + + The provided block always runs on queue provided. + + @see catch + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, PMKCatchPolicy, id __nonnull))catchOnWithPolicy NS_REFINED_FOR_SWIFT; + /** The provided block is executed when the receiver is resolved. diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m index 184ac015622..c0f81f4c30b 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m @@ -1,7 +1,7 @@ #import "PMKCallVariadicBlock.m" #import "AnyPromise+Private.h" -extern dispatch_queue_t PMKDefaultDispatchQueue(); +extern dispatch_queue_t PMKDefaultDispatchQueue(void); NSString *const PMKErrorDomain = @"PMKErrorDomain"; @@ -38,9 +38,33 @@ - (instancetype)initWithResolver:(PMKResolver __strong *)resolver { }; } +- (AnyPromise *(^)(dispatch_queue_t, id))catchOn { + return ^(dispatch_queue_t q, id block) { + return [self __catchOn:q withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + - (AnyPromise *(^)(id))catch { return ^(id block) { - return [self __catchWithPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catchInBackground { + return ^(id block) { + return [self __catchOn:dispatch_get_global_queue(0, 0) withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, PMKCatchPolicy, id))catchOnWithPolicy { + return ^(dispatch_queue_t q, PMKCatchPolicy policy, id block) { + return [self __catchOn:q withPolicy:policy execute:^(id obj) { return PMKCallVariadicBlock(block, obj); }]; }; @@ -48,7 +72,7 @@ - (instancetype)initWithResolver:(PMKResolver __strong *)resolver { - (AnyPromise *(^)(PMKCatchPolicy, id))catchWithPolicy { return ^(PMKCatchPolicy policy, id block) { - return [self __catchWithPolicy:policy execute:^(id obj) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:policy execute:^(id obj) { return PMKCallVariadicBlock(block, obj); }]; }; diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift index 7fc7d0217e6..843f2c1facf 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift @@ -206,9 +206,9 @@ import Foundation }) } - @objc func __catchWithPolicy(_ policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { + @objc func __catchOn(_ q: DispatchQueue, withPolicy policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { return AnyPromise(sealant: { resolve in - state.catch(on: .default, policy: policy, else: resolve) { err in + state.catch(on: q, policy: policy, else: resolve) { err in makeHandler(body, resolve)(err as NSError) } }) diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift index a447f293285..40535ad4f51 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift @@ -128,6 +128,7 @@ extension NSError { private var cancelledErrorIdentifiers = Set([ ErrorPair(PMKErrorDomain, PMKOperationCancelled), + ErrorPair(NSCocoaErrorDomain, NSUserCancelledError), ErrorPair(NSURLErrorDomain, NSURLErrorCancelled), ]) diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift index ddbd6064aac..12c85ce4f0d 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift @@ -626,3 +626,12 @@ extension Promise where T: Collection { } } } + + +#if swift(>=3.1) +public extension Promise where T == Void { + convenience init() { + self.init(value: ()) + } +} +#endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift index 049ea74fb50..902dc4264a3 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift @@ -4,9 +4,34 @@ import Dispatch /** - Returns: A new promise that fulfills after the specified duration. */ +@available(*, deprecated: 4.3, message: "Use after(seconds:)") public func after(interval: TimeInterval) -> Promise { + return after(seconds: interval) +} + +/** + after(.seconds(2)).then { + } + +- Returns: A new promise that fulfills after the specified duration. +*/ +public func after(seconds: TimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + seconds + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + } +} + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +public func after(interval: DispatchTimeInterval) -> Promise { return Promise { fulfill, _ in let when = DispatchTime.now() + interval + #if swift(>=4.0) + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + #else DispatchQueue.global().asyncAfter(deadline: when, execute: fulfill) + #endif } } diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h index 78b93f7a4e6..825f47831bb 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h @@ -219,7 +219,7 @@ extern AnyPromise * __nonnull dispatch_promise_on(dispatch_queue_t __nonnull que By default this returns dispatch_get_main_queue() */ -extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue() NS_REFINED_FOR_SWIFT; +extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue(void) NS_REFINED_FOR_SWIFT; /** You may alter the default dispatch queue, but you may only alter it once, and you must alter it before any `then`, etc. calls are made in your app. diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift index 638dfa8e068..41943b88b78 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift @@ -5,7 +5,11 @@ private func _when(_ promises: [Promise]) -> Promise { let root = Promise.pending() var countdown = promises.count guard countdown > 0 else { + #if swift(>=4.0) + root.fulfill(()) + #else root.fulfill() + #endif return root.promise } @@ -34,7 +38,11 @@ private func _when(_ promises: [Promise]) -> Promise { progress.completedUnitCount += 1 countdown -= 1 if countdown == 0 { + #if swift(>=4.0) + root.fulfill(()) + #else root.fulfill() + #endif } } } diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift index 3b715f1e06f..7249df91d3e 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift @@ -61,7 +61,11 @@ public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise if let error = error { reject(error) } else { + #if swift(>=4.0) + fulfill(()) + #else fulfill() + #endif } } } diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h index 02327b85e88..00014e3cd82 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig index 772ef0b2bca..619e5f4acef 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -5,5 +5,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h index 435b682a106..2a366623a36 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig index 59a957e4d4d..7a567144865 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -6,5 +6,6 @@ OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh index bbccf288336..0fbbf6892e0 100755 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -84,12 +102,15 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/PromiseKit/PromiseKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" - install_framework "$BUILT_PRODUCTS_DIR/PetstoreClient/PetstoreClient.framework" - install_framework "$BUILT_PRODUCTS_DIR/PromiseKit/PromiseKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h index 2bdb03cd939..b7da51aaf25 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig index 609a649dd14..e6e847883ae 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig index 609a649dd14..e6e847883ae 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -1,5 +1,4 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' @@ -8,4 +7,5 @@ OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh index 893c16a6313..88dd5379907 100755 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -6,6 +6,10 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -23,9 +27,9 @@ install_framework() source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" @@ -54,13 +58,27 @@ install_framework() fi } +# Copies the dSYM of a vendored framework +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } @@ -71,7 +89,7 @@ strip_invalid_archs() { archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" stripped="" for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place lipo -remove "$arch" -output "$binary" "$binary" || exit 1 stripped="$stripped $arch" @@ -82,3 +100,6 @@ strip_invalid_archs() { fi } +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh index 25e9d37757f..a7df4405b65 100755 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -8,6 +8,10 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + case "${TARGETED_DEVICE_FAMILY}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" @@ -18,6 +22,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +48,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +78,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h index 950bb19ca7a..b2e4925a9e4 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig index a8557117751..ccac9379a86 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig index a8557117751..ccac9379a86 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -1,8 +1,8 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist index b04e694ee51..df276491a16 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.2.2 + 4.4.0 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch index aa992a4adb2..beb2a244183 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h index 3a06b7bd323..d90df9dacd4 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h @@ -1,19 +1,18 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif #import "AnyPromise.h" #import "fwd.h" #import "PromiseKit.h" -#import "NSNotificationCenter+AnyPromise.h" -#import "NSTask+AnyPromise.h" -#import "NSURLSession+AnyPromise.h" -#import "PMKFoundation.h" -#import "CALayer+AnyPromise.h" -#import "PMKQuartzCore.h" -#import "PMKUIKit.h" -#import "UIView+AnyPromise.h" -#import "UIViewController+AnyPromise.h" FOUNDATION_EXPORT double PromiseKitVersionNumber; FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig index dcb583d56a9..657ad7b3dfb 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig @@ -1,10 +1,11 @@ CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/PromiseKit GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" +OTHER_LDFLAGS = -framework "Foundation" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromiseKit PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index 67337de03e5..a0cf7c49cf3 100644 --- a/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -262,13 +262,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { @@ -277,9 +280,16 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -307,13 +317,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */ = { From 29a3a4b3364cce18bd0f9f23cad2b4b437a33856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1rio=20Tavares=20Antunes?= Date: Wed, 6 Sep 2017 19:19:19 +0100 Subject: [PATCH 003/197] [Java] Handle Long in enum correctly (#6342) Resolves #6338 --- .../io/swagger/codegen/languages/AbstractJavaCodegen.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index e510994a74a..13310ecc5c3 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -1000,9 +1000,11 @@ public String toEnumVarName(String value, String datatype) { @Override public String toEnumValue(String value, String datatype) { - if ("Integer".equals(datatype) || "Long".equals(datatype) || - "Double".equals(datatype)) { + if ("Integer".equals(datatype) || "Double".equals(datatype)) { return value; + } else if ("Long".equals(datatype)) { + // add l to number, e.g. 2048 => 2048l + return value + "l"; } else if ("Float".equals(datatype)) { // add f to number, e.g. 3.14 => 3.14f return value + "f"; From 0cf82d7ae36a244266241a9055f87bc4b9ea7106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 7 Sep 2017 01:14:22 -0400 Subject: [PATCH 004/197] [All generators] Supports of hyphen-case to camelCase (#6399) * Supports of hyphen-case to camelCase * Add unit tests for the new section in the camelize function. --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 10 +++++++++- .../src/test/java/io/swagger/codegen/CodegenTest.java | 2 ++ 2 files changed, 11 insertions(+), 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 3be5473c050..79d98451d51 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 @@ -3251,7 +3251,7 @@ public static String camelize(String word, boolean lowercaseFirstLetter) { word = m.replaceAll(rep); } - // Remove all underscores + // Remove all underscores (underscore_case to camelCase) p = Pattern.compile("(_)(.)"); m = p.matcher(word); while (m.find()) { @@ -3259,6 +3259,14 @@ public static String camelize(String word, boolean lowercaseFirstLetter) { m = p.matcher(word); } + // Remove all hyphens (hyphen-case to camelCase) + p = Pattern.compile("(-)(.)"); + m = p.matcher(word); + while (m.find()) { + word = m.replaceFirst(m.group(2).toUpperCase()); + m = p.matcher(word); + } + if (lowercaseFirstLetter && word.length() > 0) { word = word.substring(0, 1).toLowerCase() + word.substring(1); } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index 91fa6ffc7ff..e899e1800dd 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -36,6 +36,8 @@ public void camelizeNamesTest() { Assert.assertEquals(codegen.camelize("foo_bar_baz"), "FooBarBaz"); Assert.assertEquals(codegen.camelize("foo/bar.baz"), "FooBarBaz"); Assert.assertEquals(codegen.camelize("/foo/bar/baz.qux/corge"), "FooBarBazQuxCorge"); + Assert.assertEquals(codegen.camelize("foo-bar"), "FooBar"); + Assert.assertEquals(codegen.camelize("foo-bar-xyzzy"), "FooBarXyzzy"); } @Test(description = "read a file upload param from a 2.0 spec") From 3cd3b907f6e09ed0697bcc8f3c574f9224dd33d4 Mon Sep 17 00:00:00 2001 From: ecolleu Date: Thu, 7 Sep 2017 12:12:09 +0200 Subject: [PATCH 005/197] [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (#6436) * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][volley] Handle UnsupportedEncodingException in invokeAPI (Issue #6432) The constructor of StringEntity can throw UnsupportedEncodingException, which is not catch nor thrown by createRequest method. Therefore the build of android client fails with: ApiInvoker.java:448: error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown This commit adds a try ... catch on UnsupportedEncodingException in invokeAPI methods and declare this exception to be thrown in createRequest * [ANDROID][Volley] Handle UnsupportedEncodingException (Issue #6432) Throw more precise ApiException --- .../libraries/volley/apiInvoker.mustache | 30 ++++++++++++------- .../petstore/android/volley/docs/StoreApi.md | 2 +- .../java/io/swagger/client/ApiInvoker.java | 30 ++++++++++++------- .../java/io/swagger/client/api/StoreApi.java | 4 +-- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiInvoker.mustache index 09e2b177fab..bf3a586dfcc 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/apiInvoker.mustache @@ -363,24 +363,32 @@ public class ApiInvoker { } public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { - RequestFuture future = RequestFuture.newFuture(); - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); - if(request != null) { - mRequestQueue.add(request); - return future.get(connectionTimeout, TimeUnit.SECONDS); - } else { - return "no data"; + try { + RequestFuture future = RequestFuture.newFuture(); + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); + if(request != null) { + mRequestQueue.add(request); + return future.get(connectionTimeout, TimeUnit.SECONDS); + } else { + return "no data"; + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); } } public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); - if (request != null) { - mRequestQueue.add(request); + try { + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); + if (request != null) { + mRequestQueue.add(request); + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); } } - public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException, UnsupportedEncodingException { StringBuilder b = new StringBuilder(); b.append("?"); diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index 1741116be6f..470432ea257 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -80,7 +80,7 @@ This endpoint does not need any parameter. ### Return type -[**Map<String, Integer>**](Map.md) +**Map<String, Integer>** ### Authorization diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java index 7a3d7e1ac24..4ffbaf546fb 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiInvoker.java @@ -365,24 +365,32 @@ private void updateParamsForAuth(String[] authNames, List queryParams, Map } public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames) throws ApiException, InterruptedException, ExecutionException, TimeoutException { - RequestFuture future = RequestFuture.newFuture(); - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); - if(request != null) { - mRequestQueue.add(request); - return future.get(connectionTimeout, TimeUnit.SECONDS); - } else { - return "no data"; + try { + RequestFuture future = RequestFuture.newFuture(); + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, future, future); + if(request != null) { + mRequestQueue.add(request); + return future.get(connectionTimeout, TimeUnit.SECONDS); + } else { + return "no data"; + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); } } public void invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { - Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); - if (request != null) { - mRequestQueue.add(request); + try { + Request request = createRequest(host, path, method, queryParams, body, headerParams, formParams, contentType, authNames, stringRequest, errorListener); + if (request != null) { + mRequestQueue.add(request); + } + } catch (UnsupportedEncodingException ex) { + throw new ApiException(0, "UnsupportedEncodingException"); } } - public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException { + public Request createRequest(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType, String[] authNames, Response.Listener stringRequest, Response.ErrorListener errorListener) throws ApiException, UnsupportedEncodingException { StringBuilder b = new StringBuilder(); b.append("?"); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java index 86b2b7e1c79..8837f433e5b 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/api/StoreApi.java @@ -214,7 +214,7 @@ public Map getInventory () throws TimeoutException, ExecutionEx try { String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames); if (localVarResponse != null) { - return (Map) ApiInvoker.deserialize(localVarResponse, "map", Map.class); + return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); } else { return null; } @@ -280,7 +280,7 @@ public void getInventory (final Response.Listener> response @Override public void onResponse(String localVarResponse) { try { - responseListener.onResponse((Map) ApiInvoker.deserialize(localVarResponse, "map", Map.class)); + responseListener.onResponse((Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class)); } catch (ApiException exception) { errorListener.onErrorResponse(new VolleyError(exception)); } From 4310ea326c182e03ff66fdae5bed09e05132c0c5 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Thu, 7 Sep 2017 10:17:49 -0500 Subject: [PATCH 006/197] [haskell-http-client] update readme; improve lens generation; fix dateFormat (#6448) * point readme links to canonical locations * use lenses for non-required model fields, instead of traversals * fix .gitignore generation * fix dateFormat cli option bug --- .../languages/HaskellHttpClientCodegen.java | 4 +- .../haskell-http-client/Lens.mustache | 21 +- .../haskell-http-client/README.mustache | 35 +- .../{.gitignore => gitignore.mustache} | 0 .../petstore/haskell-http-client/README.md | 21 +- .../petstore/haskell-http-client/docs.sh | 31 -- .../docs/SwaggerPetstore-Lens.html | 2 +- .../docs/SwaggerPetstore-Model.html | 2 +- .../docs/doc-index-95.html | 2 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.html | 2 +- .../haskell-http-client/docs/doc-index-C.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-T.html | 2 +- .../haskell-http-client/docs/doc-index-U.html | 2 +- .../docs/mini_SwaggerPetstore-Lens.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 8 +- .../docs/src/SwaggerPetstore.API.html | 336 +++++++++--------- .../docs/src/SwaggerPetstore.Client.html | 212 +++++------ .../docs/src/SwaggerPetstore.Lens.html | 313 ++++++++-------- .../docs/src/SwaggerPetstore.Model.html | 8 +- .../haskell-http-client/example-app/Main.hs | 4 +- .../lib/SwaggerPetstore/Lens.hs | 213 ++++++----- .../lib/SwaggerPetstore/Model.hs | 8 +- .../swagger-petstore.cabal | 3 +- .../tests-integration/package.yaml | 5 +- .../swagger-petstore-tests-integration.cabal | 5 +- .../tests-integration/tests/Test.hs | 6 +- 29 files changed, 601 insertions(+), 654 deletions(-) rename modules/swagger-codegen/src/main/resources/haskell-http-client/{.gitignore => gitignore.mustache} (100%) delete mode 100755 samples/client/petstore/haskell-http-client/docs.sh 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 cd60a221aec..5f57e100c50 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 @@ -128,7 +128,7 @@ public HaskellHttpClientCodegen() { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("stack.mustache", "", "stack.yaml")); supportingFiles.add(new SupportingFile("Setup.mustache", "", "Setup.hs")); - supportingFiles.add(new SupportingFile(".gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); @@ -241,7 +241,7 @@ public void setDateTimeFormat(String value) { public void setDateFormat(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.remove(DATE_FORMAT); + additionalProperties.put(DATE_FORMAT, defaultDateFormat); } else { additionalProperties.put(DATE_FORMAT, value); } diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache index 4df5c4a8cdd..3ac0727fe49 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache @@ -29,8 +29,6 @@ import {{title}}.Model -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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 @@ -40,27 +38,12 @@ type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t -- * {{classname}} {{#vars}} -{{#required}} -- | '{{name}}' Lens -{{name}}L :: Lens_' {{classname}} {{datatype}} +{{name}}L :: Lens_' {{classname}} ({{^required}}Maybe {{/required}}{{datatype}}) {{name}}L f {{classname}}{..} = (\{{name}} -> {{classname}} { {{name}}, ..} ) <$> f {{name}} {-# INLINE {{name}}L #-} -{{/required}} -{{^required}} --- | '{{name}}' Traversal -{{name}}T :: Traversal_' {{classname}} {{datatype}} -{{name}}T f s = _mtraversal {{name}} (\b -> s { {{name}} = Just b}) f s -{-# INLINE {{name}}T #-} -{{/required}} {{/vars}} {{/model}} -{{/models}} - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} +{{/models}} \ 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 39c9c6d457d..4a32daa917c 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 @@ -62,16 +62,16 @@ These options allow some customization of the code generation process. **haskell-http-client specific options:** -| OPTION | DESCRIPTION | DEFAULT | ACTUAL | -| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------- | -| 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}} | -| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | {{dateTimeFormat}} | -| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | {{generateFormUrlEncodedInstances}} | -| generateLenses | Generate Lens optics for Models | true | {{generateLenses}} | -| generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{generateModelConstructors}} | -| modelDeriving | Additional classes to include in the deriving() clause of Models | | {{modelDeriving}} | +| OPTION | DESCRIPTION | DEFAULT | ACTUAL | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | +| 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}}} | +| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | {{{dateTimeFormat}}} | +| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | {{{generateFormUrlEncodedInstances}}} | +| generateLenses | Generate Lens optics for Models | true | {{{generateLenses}}} | +| generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{{generateModelConstructors}}} | +| modelDeriving | Additional classes to include in the deriving() clause of Models | | {{{modelDeriving}}} | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -85,13 +85,13 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] -[2]: https://jonschoning.github.io/swaggerpetstore-haskell-http-client/ +[2]: https://hackage.haskell.org/package/swagger-petstore ### Example SwaggerPetstore App An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/jonschoning/swagger-codegen/tree/haskell-http-client/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app ### Usage Notes @@ -103,22 +103,23 @@ This library is intended to be imported qualified. | {{title}}.API | construct requetss | | {{title}}.Model | describes models | | {{title}}.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| {{title}}.Lens | lenses & traversals for model fields | +| {{title}}.Lens | lenses for model fields | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). For example, if there is an Operation named _addFoo_, there will be a -data type generated named _AddFoo_ (note the capitalization) which -describes additional constraints and actions on the _addFoo_ -operation, which can be viewed in GHCi or via the Haddocks. +data type generated named _AddFoo_ (note the capitalization), which +describes additional constraints and actions on the _addFoo_ operation +via its typeclass instances. These typeclass instances can be viewed +in GHCi or via the Haddocks. * requried parameters are included as function arguments to _addFoo_ * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell data AddFoo diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/.gitignore b/modules/swagger-codegen/src/main/resources/haskell-http-client/gitignore.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/haskell-http-client/.gitignore rename to modules/swagger-codegen/src/main/resources/haskell-http-client/gitignore.mustache diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index d1ee4f9c200..817c834271d 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -62,11 +62,11 @@ These options allow some customization of the code generation process. **haskell-http-client specific options:** -| OPTION | DESCRIPTION | DEFAULT | ACTUAL | -| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------- | +| OPTION | DESCRIPTION | DEFAULT | ACTUAL | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | | 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 | | +| dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d | | dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | | | generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true | | generateLenses | Generate Lens optics for Models | true | true | @@ -85,13 +85,13 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] -[2]: https://jonschoning.github.io/swaggerpetstore-haskell-http-client/ +[2]: https://hackage.haskell.org/package/swagger-petstore ### Example SwaggerPetstore App An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/jonschoning/swagger-codegen/tree/haskell-http-client/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app ### Usage Notes @@ -103,22 +103,23 @@ This library is intended to be imported qualified. | SwaggerPetstore.API | construct requetss | | SwaggerPetstore.Model | describes models | | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| SwaggerPetstore.Lens | lenses & traversals for model fields | +| SwaggerPetstore.Lens | lenses for model fields | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). For example, if there is an Operation named _addFoo_, there will be a -data type generated named _AddFoo_ (note the capitalization) which -describes additional constraints and actions on the _addFoo_ -operation, which can be viewed in GHCi or via the Haddocks. +data type generated named _AddFoo_ (note the capitalization), which +describes additional constraints and actions on the _addFoo_ operation +via its typeclass instances. These typeclass instances can be viewed +in GHCi or via the Haddocks. * requried parameters are included as function arguments to _addFoo_ * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell data AddFoo diff --git a/samples/client/petstore/haskell-http-client/docs.sh b/samples/client/petstore/haskell-http-client/docs.sh deleted file mode 100755 index 5db07846482..00000000000 --- a/samples/client/petstore/haskell-http-client/docs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e - -cabal_file=$(find . -maxdepth 1 -name "*.cabal" -print -quit) - -if [ ! -f "$cabal_file" ]; then - echo "Run this script in the top-level package directory" - exit 1 -fi - -pkg=$(awk -F ":[[:space:]]*" 'tolower($1)=="name" { print $2 }' < "$cabal_file") -ver=$(awk -F ":[[:space:]]*" 'tolower($1)=="version" { print $2 }' < "$cabal_file") - -if [ -z "$pkg" ]; then - echo "Unable to determine package name" - exit 1 -fi - -if [ -z "$ver" ]; then - echo "Unable to determine package version" - exit 1 -fi - -echo "Detected package: $pkg-$ver" - -cabal haddock --hyperlink-source --html-location='https://www.stackage.org/haddock/nightly-2017-08-25/$pkg-$version' --contents-location='https://www.stackage.org/nightly-2017-08-25/package/$pkg-$version' - -dir="build-docs" -trap 'rm -r "$dir"' EXIT -mkdir -p $dir -cp -R dist/doc/html/$pkg/ $dir/$pkg-$ver-docs diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html index 483f5a824b7..ccc05213f5d 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html @@ -1,4 +1,4 @@ SwaggerPetstore.Lens

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

Type Aliases

type Traversal_' s a = Traversal_ s s a a Source #

type Traversal_ s t a b = forall f. Applicative f => (a -> f b) -> s -> f t Source #

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 #

ApiResponse

Category

Order

Pet

Tag

User

Helpers

_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b Source #

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

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 #

ApiResponse

Category

Order

Pet

Tag

User

\ 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 2a177e5595d..dc94e0e3b1d 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

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

TI.parseTimeM True TI.defaultTimeLocale ""

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

TI.formatTime TI.defaultTimeLocale ""
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index 33974e19019..f05689deb6e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.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 - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_mtraversalSwaggerPetstore.Lens, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ 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 8787e590900..b27a47d654f 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

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeTSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - A

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, 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 cce57dec8d6..a0148f93dd7 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.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageTSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeTSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdTSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameTSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, 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
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, 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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteTSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdTSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdTSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityTSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateTSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusTSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryTSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdTSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusTSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsTSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdTSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameTSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
Traversal_SwaggerPetstore.Lens, SwaggerPetstore
Traversal_'SwaggerPetstore.Lens, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailTSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameTSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdTSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameTSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordTSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneTSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameTSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusTSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_mtraversalSwaggerPetstore.Lens, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, 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
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, 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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, 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 e9a866aaaba..863fdeaafeb 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

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdTSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameTSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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 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 3376ab88ac7..cef8bb7a96d 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
orderCompleteTSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdTSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdTSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityTSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateTSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusTSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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 5b53cdf63d2..39fc9910d83 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryTSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdTSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusTSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsTSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, 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 87f05f58042..a918a451f03 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdTSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameTSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
Traversal_SwaggerPetstore.Lens, SwaggerPetstore
Traversal_'SwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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 0bb882935f4..916d307b244 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailTSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameTSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdTSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameTSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordTSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneTSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameTSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusTSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html index 32e4b2770c4..930ee673c3e 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html @@ -1,4 +1,4 @@ SwaggerPetstore.Lens

SwaggerPetstore.Lens

\ No newline at end of file +

SwaggerPetstore.Lens

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 3cd3b9c5cca..d6c2472e097 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 e7113e60a2f..bd48b3f7366 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 @@ -79,13 +79,13 @@ -- Note: Has 'Produces' instances, but no response schema -- addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = _mkRequest "POST" ["/pet"] - `setBodyParam` body + `setBodyParam` body data AddPet @@ -117,15 +117,15 @@ -- deletePet :: Integer -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = - _mkRequest "DELETE" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +deletePet petId = + _mkRequest "DELETE" ["/pet/",toPath petId] data DeletePet instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey xs) = - req `setHeader` toHeader ("api_key", xs) + applyOptionalParam req (ApiUnderscorekey xs) = + req `setHeader` toHeader ("api_key", xs) -- | @application/xml@ instance Produces DeletePet MimeXML -- | @application/json@ @@ -145,9 +145,9 @@ findPetsByStatus :: [Text] -- ^ "status" - Status values that need to be considered for filter -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = +findPetsByStatus status = _mkRequest "GET" ["/pet/findByStatus"] - `_setQuery` toQueryColl CommaSeparated ("status", Just status) + `_setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -169,9 +169,9 @@ findPetsByTags :: [Text] -- ^ "tags" - Tags to filter by -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = +findPetsByTags tags = _mkRequest "GET" ["/pet/findByTags"] - `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -195,8 +195,8 @@ getPetById :: Integer -- ^ "petId" - ID of pet to return -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = - _mkRequest "GET" ["/pet/",toPath petId] +getPetById petId = + _mkRequest "GET" ["/pet/",toPath petId] data GetPetById @@ -219,13 +219,13 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = + -> SwaggerPetstoreRequest UpdatePet contentType res +updatePet _ body = _mkRequest "PUT" ["/pet"] - `setBodyParam` body + `setBodyParam` body data UpdatePet @@ -256,25 +256,25 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = - _mkRequest "POST" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ petId = + _mkRequest "POST" ["/pet/",toPath petId] data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = - req `_addForm` toForm ("name", xs) + applyOptionalParam req (Name xs) = + req `_addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status xs) = - req `_addForm` toForm ("status", xs) + applyOptionalParam req (Status xs) = + req `_addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -296,25 +296,25 @@ -- AuthMethod: petstore_auth -- uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +uploadFile _ petId = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] 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) + 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 + applyOptionalParam req (File xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ instance Consumes UploadFile MimeMultipartFormData @@ -337,9 +337,9 @@ -- deleteOrder :: Text -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder orderId = - _mkRequest "DELETE" ["/store/order/",toPath orderId] + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +deleteOrder orderId = + _mkRequest "DELETE" ["/store/order/",toPath orderId] data DeleteOrder @@ -380,8 +380,8 @@ getOrderById :: Integer -- ^ "orderId" - ID of pet that needs to be fetched -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById orderId = - _mkRequest "GET" ["/store/order/",toPath orderId] +getOrderById orderId = + _mkRequest "GET" ["/store/order/",toPath orderId] data GetOrderById @@ -400,13 +400,13 @@ -- -- placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => contentType -- ^ request content-type ('MimeType') -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -placeOrder _ body = + -> SwaggerPetstoreRequest PlaceOrder contentType Order +placeOrder _ body = _mkRequest "POST" ["/store/order"] - `setBodyParam` body + `setBodyParam` body data PlaceOrder @@ -431,13 +431,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -createUser _ body = + -> SwaggerPetstoreRequest CreateUser contentType res +createUser _ body = _mkRequest "POST" ["/user"] - `setBodyParam` body + `setBodyParam` body data CreateUser @@ -460,13 +460,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +createUsersWithArrayInput _ body = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithArrayInput @@ -489,13 +489,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +createUsersWithListInput _ body = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithListInput @@ -519,9 +519,9 @@ -- deleteUser :: Text -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser username = - _mkRequest "DELETE" ["/user/",toPath username] + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser username = + _mkRequest "DELETE" ["/user/",toPath username] data DeleteUser @@ -542,8 +542,8 @@ getUserByName :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName username = - _mkRequest "GET" ["/user/",toPath username] +getUserByName username = + _mkRequest "GET" ["/user/",toPath username] data GetUserByName @@ -565,10 +565,10 @@ :: Text -- ^ "username" - The user name for login -> Text -- ^ "password" - The password for login in clear text -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username password = +loginUser username password = _mkRequest "GET" ["/user/login"] - `_setQuery` toQuery ("username", Just username) - `_setQuery` toQuery ("password", Just password) + `_setQuery` toQuery ("username", Just username) + `_setQuery` toQuery ("password", Just password) data LoginUser -- | @application/xml@ @@ -588,7 +588,7 @@ -- Note: Has 'Produces' instances, but no response schema -- logoutUser - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res logoutUser = _mkRequest "GET" ["/user/logout"] @@ -610,15 +610,15 @@ -- Note: Has 'Produces' instances, but no response schema -- updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> Text -- ^ "username" - name that need to be deleted -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ username body = - _mkRequest "PUT" ["/user/",toPath username] + -> SwaggerPetstoreRequest UpdateUser contentType res +updateUser _ username body = + _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body + `setBodyParam` body data UpdateUser @@ -634,25 +634,25 @@ -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + 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 -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -674,7 +674,7 @@ -- * SwaggerPetstoreRequest -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest , urlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , params :: Params -- ^ params of SwaggerPetstoreRequest @@ -702,85 +702,85 @@ _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - let _params = params (req `removeHeader` P.fmap P.fst header) - in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + let _params = params (req `removeHeader` P.fmap P.fst header) + in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - let _params = params req - in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } - where cifst = CI.mk . P.fst +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + let _params = params req + in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } + where cifst = CI.mk . P.fst -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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 -_setAcceptHeader req accept = - case mimeType' 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 +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = - let _params = params req - in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } - where cifst = CI.mk . P.fst +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_setQuery req query = + let _params = params req + in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } + where cifst = CI.mk . P.fst -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let _params = params req - form = case paramsBody _params of - ParamBodyFormUrlEncoded _form -> _form +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_addForm req newform = + let _params = params req + form = case paramsBody _params of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } + in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let _params = params req - parts = case paramsBody _params of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let _params = params req + parts = case paramsBody _params of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } + in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyB body } } +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + let _params = params req + in req { params = _params { paramsBody = ParamBodyB body } } -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyBL body } } +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + let _params = params req + in req { params = _params { paramsBody = ParamBodyBL body } } -- ** 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 @@ -792,38 +792,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 #-} 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 22411c07f3b..27f9b2475b0 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 @@ -63,11 +63,11 @@ -- | display the config instance 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 -- @@ -93,15 +93,15 @@ -- | updates the config to use a MonadLogger instance which prints to stdout. withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} +withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} -- | updates the config to use a MonadLogger instance which prints to stderr. withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} -- | updates the config to disable logging withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configExecLoggingT = runNullLoggingT} -- * Dispatch @@ -109,21 +109,21 @@ -- | 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + 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) @@ -137,124 +137,124 @@ -- | send a request returning the 'MimeResult' 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runExceptionLoggingT "Client" config $ - do case mimeUnrender' accept (NH.responseBody httpResponse) of - Left s -> do - logNST LG.LevelError "Client" (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runExceptionLoggingT "Client" config $ + do case mimeUnrender' accept (NH.responseBody httpResponse) of + Left s -> do + logNST LG.LevelError "Client" (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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - return parsedResult + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + 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 - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) - return res +dispatchInitUnsafe manager config (InitRequest req) = do + runExceptionLoggingT logSrc config $ + do logNST LG.LevelInfo logSrc requestLogMsg + logNST LG.LevelDebug logSrc requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + logNST LG.LevelInfo logSrc (responseLogMsg res) + logNST LG.LevelDebug logSrc ((T.pack . show) res) + return res where - logSrc = "Client" - endpoint = + logSrc = "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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (urlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) - reqQuery = NH.renderQuery True (paramsQuery (params req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (urlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) + reqQuery = NH.renderQuery True (paramsQuery (params req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (params req1) 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 (params req1) 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 -- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a +type ExecLoggingT = forall m. P.MonadIO m => + forall a. LG.LoggingT m a -> m a -- ** Null Logger @@ -263,7 +263,7 @@ nullLogger _ _ _ _ = return () -- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a +runNullLoggingT :: LG.LoggingT m a -> m a runNullLoggingT = (`LG.runLoggingT` nullLogger) -- ** Logging Filters @@ -281,38 +281,38 @@ debugLevelFilter = minLevelFilter LG.LevelDebug minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l +minLevelFilter l _ l' = l' >= l -- ** Logging -- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) +logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () +logNST level src msg = do + now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) + LG.logOtherNS sourceLog level (now <> " " <> msg) where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = + sourceLog = "SwaggerPetstore/" <> src + formatTimeLog = T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" -- | re-throws exceptions after logging them logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = + :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) + => Text -> m a -> m a +logExceptions src = E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) + (\(e :: E.SomeException) -> do + logNST LG.LevelError src ((T.pack . show) e) + E.throw e) -- | Run a block using the configured MonadLogger instance runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) +runLoggingT config = + configExecLoggingT config . LG.filterLogger (configLoggingFilter config) -- | Run a block using the configured MonadLogger instance (logs exceptions) runExceptionLoggingT - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a +runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 80eecd30a60..83e9ff79157 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -29,175 +29,166 @@ -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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 - +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 + + +-- * ApiResponse --- * ApiResponse - --- | 'apiResponseCode' Traversal -apiResponseCodeT :: Traversal_' ApiResponse Int -apiResponseCodeT f s = _mtraversal apiResponseCode (\b -> s { apiResponseCode = Just b}) f s -{-# INLINE apiResponseCodeT #-} - --- | 'apiResponseType' Traversal -apiResponseTypeT :: Traversal_' ApiResponse Text -apiResponseTypeT f s = _mtraversal apiResponseType (\b -> s { apiResponseType = Just b}) f s -{-# INLINE apiResponseTypeT #-} - --- | 'apiResponseMessage' Traversal -apiResponseMessageT :: Traversal_' ApiResponse Text -apiResponseMessageT f s = _mtraversal apiResponseMessage (\b -> s { apiResponseMessage = Just b}) f s -{-# INLINE apiResponseMessageT #-} +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +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 +{-# INLINE apiResponseTypeL #-} + +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} + + - +-- * Category --- * Category - --- | 'categoryId' Traversal -categoryIdT :: Traversal_' Category Integer -categoryIdT f s = _mtraversal categoryId (\b -> s { categoryId = Just b}) f s -{-# INLINE categoryIdT #-} - --- | 'categoryName' Traversal -categoryNameT :: Traversal_' Category Text -categoryNameT f s = _mtraversal categoryName (\b -> s { categoryName = Just b}) f s -{-# INLINE categoryNameT #-} +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +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 +{-# INLINE categoryNameL #-} + + - +-- * Order --- * Order - --- | 'orderId' Traversal -orderIdT :: Traversal_' Order Integer -orderIdT f s = _mtraversal orderId (\b -> s { orderId = Just b}) f s -{-# INLINE orderIdT #-} - --- | 'orderPetId' Traversal -orderPetIdT :: Traversal_' Order Integer -orderPetIdT f s = _mtraversal orderPetId (\b -> s { orderPetId = Just b}) f s -{-# INLINE orderPetIdT #-} - --- | 'orderQuantity' Traversal -orderQuantityT :: Traversal_' Order Int -orderQuantityT f s = _mtraversal orderQuantity (\b -> s { orderQuantity = Just b}) f s -{-# INLINE orderQuantityT #-} - --- | 'orderShipDate' Traversal -orderShipDateT :: Traversal_' Order UTCTime -orderShipDateT f s = _mtraversal orderShipDate (\b -> s { orderShipDate = Just b}) f s -{-# INLINE orderShipDateT #-} - --- | 'orderStatus' Traversal -orderStatusT :: Traversal_' Order Text -orderStatusT f s = _mtraversal orderStatus (\b -> s { orderStatus = Just b}) f s -{-# INLINE orderStatusT #-} - --- | 'orderComplete' Traversal -orderCompleteT :: Traversal_' Order Bool -orderCompleteT f s = _mtraversal orderComplete (\b -> s { orderComplete = Just b}) f s -{-# INLINE orderCompleteT #-} +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +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 +{-# INLINE orderPetIdL #-} + +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +{-# INLINE orderQuantityL #-} + +-- | 'orderShipDate' Lens +orderShipDateL :: Lens_' Order (Maybe UTCTime) +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +{-# INLINE orderShipDateL #-} + +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +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 +{-# INLINE orderCompleteL #-} + + - +-- * Pet --- * Pet - --- | 'petId' Traversal -petIdT :: Traversal_' Pet Integer -petIdT f s = _mtraversal petId (\b -> s { petId = Just b}) f s -{-# INLINE petIdT #-} - --- | 'petCategory' Traversal -petCategoryT :: Traversal_' Pet Category -petCategoryT f s = _mtraversal petCategory (\b -> s { petCategory = Just b}) f s -{-# INLINE petCategoryT #-} - --- | 'petName' Lens -petNameL :: Lens_' Pet Text -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName -{-# INLINE petNameL #-} - --- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet [Text] -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls -{-# INLINE petPhotoUrlsL #-} - --- | 'petTags' Traversal -petTagsT :: Traversal_' Pet [Tag] -petTagsT f s = _mtraversal petTags (\b -> s { petTags = Just b}) f s -{-# INLINE petTagsT #-} - --- | 'petStatus' Traversal -petStatusT :: Traversal_' Pet Text -petStatusT f s = _mtraversal petStatus (\b -> s { petStatus = Just b}) f s -{-# INLINE petStatusT #-} +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +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 +{-# INLINE petCategoryL #-} + +-- | 'petName' Lens +petNameL :: Lens_' Pet (Text) +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +{-# INLINE petNameL #-} + +-- | 'petPhotoUrls' Lens +petPhotoUrlsL :: Lens_' Pet ([Text]) +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 +{-# INLINE petTagsL #-} + +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} + + - +-- * Tag --- * Tag - --- | 'tagId' Traversal -tagIdT :: Traversal_' Tag Integer -tagIdT f s = _mtraversal tagId (\b -> s { tagId = Just b}) f s -{-# INLINE tagIdT #-} - --- | 'tagName' Traversal -tagNameT :: Traversal_' Tag Text -tagNameT f s = _mtraversal tagName (\b -> s { tagName = Just b}) f s -{-# INLINE tagNameT #-} +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +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 +{-# INLINE tagNameL #-} + + - +-- * User --- * User - --- | 'userId' Traversal -userIdT :: Traversal_' User Integer -userIdT f s = _mtraversal userId (\b -> s { userId = Just b}) f s -{-# INLINE userIdT #-} - --- | 'userUsername' Traversal -userUsernameT :: Traversal_' User Text -userUsernameT f s = _mtraversal userUsername (\b -> s { userUsername = Just b}) f s -{-# INLINE userUsernameT #-} - --- | 'userFirstName' Traversal -userFirstNameT :: Traversal_' User Text -userFirstNameT f s = _mtraversal userFirstName (\b -> s { userFirstName = Just b}) f s -{-# INLINE userFirstNameT #-} - --- | 'userLastName' Traversal -userLastNameT :: Traversal_' User Text -userLastNameT f s = _mtraversal userLastName (\b -> s { userLastName = Just b}) f s -{-# INLINE userLastNameT #-} - --- | 'userEmail' Traversal -userEmailT :: Traversal_' User Text -userEmailT f s = _mtraversal userEmail (\b -> s { userEmail = Just b}) f s -{-# INLINE userEmailT #-} - --- | 'userPassword' Traversal -userPasswordT :: Traversal_' User Text -userPasswordT f s = _mtraversal userPassword (\b -> s { userPassword = Just b}) f s -{-# INLINE userPasswordT #-} - --- | 'userPhone' Traversal -userPhoneT :: Traversal_' User Text -userPhoneT f s = _mtraversal userPhone (\b -> s { userPhone = Just b}) f s -{-# INLINE userPhoneT #-} - --- | 'userUserStatus' Traversal -userUserStatusT :: Traversal_' User Int -userUserStatusT f s = _mtraversal userUserStatus (\b -> s { userUserStatus = Just b}) f s -{-# INLINE userUserStatusT #-} - - - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} - \ No newline at end of file +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +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 +{-# INLINE userUsernameL #-} + +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +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 +{-# INLINE userLastNameL #-} + +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +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 +{-# INLINE userPasswordL #-} + +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +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 +{-# INLINE userUserStatusL #-} + + + \ 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 3d644d6fe5c..1dd3fd817c3 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 @@ -365,14 +365,14 @@ -- * Date Formatting --- | @TI.parseTimeM True TI.defaultTimeLocale ""@ +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = - TI.parseTimeM True TI.defaultTimeLocale "" + TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} --- | @TI.formatTime TI.defaultTimeLocale ""@ +-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ _showDate :: TI.FormatTime t => t -> String _showDate = - TI.formatTime TI.defaultTimeLocale "" + TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index ff9900c31ce..50432703ab5 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -200,8 +200,8 @@ runUser mgr config = do let createUserRequest = S.createUser S.MimeJSON user _ <- S.dispatchLbs mgr config createUserRequest S.MimeJSON - -- can use traversals or lenses (model record names are appended with T or L) to view or modify records - let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameT (<> "*") . L.over S.userIdT (+1)) user + -- can use lenses (model record names are appended L) to view or modify records + let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameL (fmap (<> "*")) . L.over S.userIdL (fmap (+ 1))) user let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON users _ <- S.dispatchLbs mgr config createUsersWithArrayInputRequest S.MimeNoContent diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs index 19c6ea3415a..db36f380fbe 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs @@ -29,174 +29,165 @@ import SwaggerPetstore.Model -- * Type Aliases -type Traversal_' s a = Traversal_ s s a a -type Traversal_ s t a b = forall (f :: * -> *). Applicative 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 -- * ApiResponse --- | 'apiResponseCode' Traversal -apiResponseCodeT :: Traversal_' ApiResponse Int -apiResponseCodeT f s = _mtraversal apiResponseCode (\b -> s { apiResponseCode = Just b}) f s -{-# INLINE apiResponseCodeT #-} +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +{-# INLINE apiResponseCodeL #-} --- | 'apiResponseType' Traversal -apiResponseTypeT :: Traversal_' ApiResponse Text -apiResponseTypeT f s = _mtraversal apiResponseType (\b -> s { apiResponseType = Just b}) f s -{-# INLINE apiResponseTypeT #-} +-- | 'apiResponseType' Lens +apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +{-# INLINE apiResponseTypeL #-} --- | 'apiResponseMessage' Traversal -apiResponseMessageT :: Traversal_' ApiResponse Text -apiResponseMessageT f s = _mtraversal apiResponseMessage (\b -> s { apiResponseMessage = Just b}) f s -{-# INLINE apiResponseMessageT #-} +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} -- * Category --- | 'categoryId' Traversal -categoryIdT :: Traversal_' Category Integer -categoryIdT f s = _mtraversal categoryId (\b -> s { categoryId = Just b}) f s -{-# INLINE categoryIdT #-} +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +{-# INLINE categoryIdL #-} --- | 'categoryName' Traversal -categoryNameT :: Traversal_' Category Text -categoryNameT f s = _mtraversal categoryName (\b -> s { categoryName = Just b}) f s -{-# INLINE categoryNameT #-} +-- | 'categoryName' Lens +categoryNameL :: Lens_' Category (Maybe Text) +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +{-# INLINE categoryNameL #-} -- * Order --- | 'orderId' Traversal -orderIdT :: Traversal_' Order Integer -orderIdT f s = _mtraversal orderId (\b -> s { orderId = Just b}) f s -{-# INLINE orderIdT #-} +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +{-# INLINE orderIdL #-} --- | 'orderPetId' Traversal -orderPetIdT :: Traversal_' Order Integer -orderPetIdT f s = _mtraversal orderPetId (\b -> s { orderPetId = Just b}) f s -{-# INLINE orderPetIdT #-} +-- | 'orderPetId' Lens +orderPetIdL :: Lens_' Order (Maybe Integer) +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +{-# INLINE orderPetIdL #-} --- | 'orderQuantity' Traversal -orderQuantityT :: Traversal_' Order Int -orderQuantityT f s = _mtraversal orderQuantity (\b -> s { orderQuantity = Just b}) f s -{-# INLINE orderQuantityT #-} +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +{-# INLINE orderQuantityL #-} --- | 'orderShipDate' Traversal -orderShipDateT :: Traversal_' Order UTCTime -orderShipDateT f s = _mtraversal orderShipDate (\b -> s { orderShipDate = Just b}) f s -{-# INLINE orderShipDateT #-} +-- | 'orderShipDate' Lens +orderShipDateL :: Lens_' Order (Maybe UTCTime) +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +{-# INLINE orderShipDateL #-} --- | 'orderStatus' Traversal -orderStatusT :: Traversal_' Order Text -orderStatusT f s = _mtraversal orderStatus (\b -> s { orderStatus = Just b}) f s -{-# INLINE orderStatusT #-} +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +{-# INLINE orderStatusL #-} --- | 'orderComplete' Traversal -orderCompleteT :: Traversal_' Order Bool -orderCompleteT f s = _mtraversal orderComplete (\b -> s { orderComplete = Just b}) f s -{-# INLINE orderCompleteT #-} +-- | 'orderComplete' Lens +orderCompleteL :: Lens_' Order (Maybe Bool) +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +{-# INLINE orderCompleteL #-} -- * Pet --- | 'petId' Traversal -petIdT :: Traversal_' Pet Integer -petIdT f s = _mtraversal petId (\b -> s { petId = Just b}) f s -{-# INLINE petIdT #-} +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +{-# INLINE petIdL #-} --- | 'petCategory' Traversal -petCategoryT :: Traversal_' Pet Category -petCategoryT f s = _mtraversal petCategory (\b -> s { petCategory = Just b}) f s -{-# INLINE petCategoryT #-} +-- | 'petCategory' Lens +petCategoryL :: Lens_' Pet (Maybe Category) +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +{-# INLINE petCategoryL #-} -- | 'petName' Lens -petNameL :: Lens_' Pet Text +petNameL :: Lens_' Pet (Text) petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName {-# INLINE petNameL #-} -- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet [Text] +petPhotoUrlsL :: Lens_' Pet ([Text]) petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls {-# INLINE petPhotoUrlsL #-} --- | 'petTags' Traversal -petTagsT :: Traversal_' Pet [Tag] -petTagsT f s = _mtraversal petTags (\b -> s { petTags = Just b}) f s -{-# INLINE petTagsT #-} +-- | 'petTags' Lens +petTagsL :: Lens_' Pet (Maybe [Tag]) +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +{-# INLINE petTagsL #-} --- | 'petStatus' Traversal -petStatusT :: Traversal_' Pet Text -petStatusT f s = _mtraversal petStatus (\b -> s { petStatus = Just b}) f s -{-# INLINE petStatusT #-} +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} -- * Tag --- | 'tagId' Traversal -tagIdT :: Traversal_' Tag Integer -tagIdT f s = _mtraversal tagId (\b -> s { tagId = Just b}) f s -{-# INLINE tagIdT #-} +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +{-# INLINE tagIdL #-} --- | 'tagName' Traversal -tagNameT :: Traversal_' Tag Text -tagNameT f s = _mtraversal tagName (\b -> s { tagName = Just b}) f s -{-# INLINE tagNameT #-} +-- | 'tagName' Lens +tagNameL :: Lens_' Tag (Maybe Text) +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +{-# INLINE tagNameL #-} -- * User --- | 'userId' Traversal -userIdT :: Traversal_' User Integer -userIdT f s = _mtraversal userId (\b -> s { userId = Just b}) f s -{-# INLINE userIdT #-} +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +{-# INLINE userIdL #-} --- | 'userUsername' Traversal -userUsernameT :: Traversal_' User Text -userUsernameT f s = _mtraversal userUsername (\b -> s { userUsername = Just b}) f s -{-# INLINE userUsernameT #-} +-- | 'userUsername' Lens +userUsernameL :: Lens_' User (Maybe Text) +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +{-# INLINE userUsernameL #-} --- | 'userFirstName' Traversal -userFirstNameT :: Traversal_' User Text -userFirstNameT f s = _mtraversal userFirstName (\b -> s { userFirstName = Just b}) f s -{-# INLINE userFirstNameT #-} +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +{-# INLINE userFirstNameL #-} --- | 'userLastName' Traversal -userLastNameT :: Traversal_' User Text -userLastNameT f s = _mtraversal userLastName (\b -> s { userLastName = Just b}) f s -{-# INLINE userLastNameT #-} +-- | 'userLastName' Lens +userLastNameL :: Lens_' User (Maybe Text) +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +{-# INLINE userLastNameL #-} --- | 'userEmail' Traversal -userEmailT :: Traversal_' User Text -userEmailT f s = _mtraversal userEmail (\b -> s { userEmail = Just b}) f s -{-# INLINE userEmailT #-} +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +{-# INLINE userEmailL #-} --- | 'userPassword' Traversal -userPasswordT :: Traversal_' User Text -userPasswordT f s = _mtraversal userPassword (\b -> s { userPassword = Just b}) f s -{-# INLINE userPasswordT #-} +-- | 'userPassword' Lens +userPasswordL :: Lens_' User (Maybe Text) +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +{-# INLINE userPasswordL #-} --- | 'userPhone' Traversal -userPhoneT :: Traversal_' User Text -userPhoneT f s = _mtraversal userPhone (\b -> s { userPhone = Just b}) f s -{-# INLINE userPhoneT #-} +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +{-# INLINE userPhoneL #-} --- | 'userUserStatus' Traversal -userUserStatusT :: Traversal_' User Int -userUserStatusT f s = _mtraversal userUserStatus (\b -> s { userUserStatus = Just b}) f s -{-# INLINE userUserStatusT #-} +-- | 'userUserStatus' Lens +userUserStatusL :: Lens_' User (Maybe Int) +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +{-# INLINE userUserStatusL #-} - - --- * Helpers - -_mtraversal :: Applicative f => (b -> Maybe t) -> (a -> b) -> (t -> f a) -> b -> f b -_mtraversal x fsb f s = maybe (pure s) (\a -> fsb <$> f a) (x s) -{-# INLINE _mtraversal #-} 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 a9faf092395..b2df5ab575c 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -365,14 +365,14 @@ _parseISO8601 t = -- * Date Formatting --- | @TI.parseTimeM True TI.defaultTimeLocale ""@ +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = - TI.parseTimeM True TI.defaultTimeLocale "" + TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} --- | @TI.formatTime TI.defaultTimeLocale ""@ +-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ _showDate :: TI.FormatTime t => t -> String _showDate = - TI.formatTime TI.defaultTimeLocale "" + TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index fd7d16c7f93..3d96cf923d8 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -7,6 +7,7 @@ version: 0.1.0.0 synopsis: Auto-generated swagger-petstore API Client description: . Client library for calling the swagger-petstore API based on http-client. + host: petstore.swagger.io . base path: http://petstore.swagger.io/v2 . @@ -14,7 +15,7 @@ description: . . swagger version: 2.0 . - OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md + OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md category: Web homepage: https://github.com/swagger-api/swagger-codegen#readme author: Author Name Here diff --git a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml index 2fb6db94d74..dec56e307b3 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -29,9 +29,12 @@ dependencies: - text >=0.11 && <1.3 - time >=1.5 && <1.9 - vector >=0.10.9 && <0.13 +- monad-logger >=0.3 && <0.4 +- exceptions >= 0.4 - case-insensitive -- swagger-petstore +- safe-exceptions <0.2 - microlens +- swagger-petstore tests: tests: main: Test.hs diff --git a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal index 5fb889006a5..7255abfa1f6 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal @@ -40,10 +40,13 @@ test-suite tests , text >=0.11 && <1.3 , time >=1.5 && <1.9 , vector >=0.10.9 && <0.13 + , monad-logger >=0.3 && <0.4 + , exceptions >= 0.4 , case-insensitive - , swagger-petstore + , safe-exceptions <0.2 , microlens , swagger-petstore + , swagger-petstore , bytestring >=0.10.0 && <0.11 , containers , hspec >=1.8 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index 85c530af3e1..b1fe57c0793 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -237,7 +237,11 @@ testUserOps mgr config = do } _users = take 8 $ - drop 1 $ iterate (L.over S.userUsernameT (<> "*") . L.over S.userIdT (+ 1)) _user + drop 1 $ + iterate + (L.over (S.userUsernameL . L._Just) (<> "*") . + L.over (S.userIdL . L._Just) (+ 1)) + _user before (pure _user) $ it "createUser" $ \user -> do From 5c547d5f4d4ef3140a651e8ec67aba118301c279 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 8 Sep 2017 08:41:01 +0800 Subject: [PATCH 007/197] add jfastnacht to php tech comm --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a700ffbaba7..0d00cbb9323 100644 --- a/README.md +++ b/README.md @@ -1042,7 +1042,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | Perl | @wing328 (2017/07) | -| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) | +| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) | | R | | | Ruby | @cliffano (2017/07) | From dcca1156913c9b5fc81337b16c6b88e90e7c2c4b Mon Sep 17 00:00:00 2001 From: Carlton Whitehead Date: Thu, 7 Sep 2017 20:47:56 -0400 Subject: [PATCH 008/197] Genesys acquired Interactive Intelligence (#6453) See http://www.genesys.com/about/newsroom/news/genesys-completes-acquisition-of-interactive-intelligence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d00cbb9323..4d3ca5b5b27 100644 --- a/README.md +++ b/README.md @@ -758,6 +758,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [General Electric](https://www.ge.com/) +- [Genesys - PureCloud](http://developer.mypurecloud.com/) - [Germin8](http://www.germin8.com) - [GigaSpaces](http://www.gigaspaces.com) - [goTransverse](http://www.gotransverse.com/api) @@ -770,7 +771,6 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) - [Intent HQ](http://www.intenthq.com) -- [Interactive Intelligence](http://developer.mypurecloud.com/) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) From 4fb612c2e8bb8860568f6da59b61bd0c8bb5d923 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Sat, 9 Sep 2017 04:11:46 -0500 Subject: [PATCH 009/197] [haskell-http-client] update documentation; refactoring; add 'strictFields' cli option (#6458) * update readme; remove unused DeriveAnyClass extension * refactor request/param utility functions * add strictFields cli option * add CONTRIBUTING.md --- bin/haskell-http-client-petstore.sh | 1 + .../languages/HaskellHttpClientCodegen.java | 41 +- .../haskell-http-client/API.mustache | 82 +- .../haskell-http-client/Client.mustache | 8 +- .../haskell-http-client/Model.mustache | 3 +- .../haskell-http-client/README.mustache | 17 +- .../haskell-http-client/TopLevel.mustache | 4 +- .../haskell-http-client.cabal.mustache | 3 +- .../haskell-http-client/package.mustache | 7 +- .../tests/Instances.mustache | 2 + .../tests/PropMime.mustache | 1 + .../HaskellHttpClientOptionsTest.java | 2 + .../HaskellHttpClientOptionsProvider.java | 2 + .../haskell-http-client/CONTRIBUTING.md | 28 + .../petstore/haskell-http-client/README.md | 17 +- .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 2 +- .../docs/doc-index-All.html | 2 +- .../haskell-http-client/docs/doc-index-P.html | 2 +- .../haskell-http-client/docs/doc-index-R.html | 2 +- .../haskell-http-client/docs/doc-index-U.html | 2 +- .../docs/mini_SwaggerPetstore-API.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 10 +- .../docs/src/SwaggerPetstore.API.html | 1552 +++++++++-------- .../docs/src/SwaggerPetstore.Client.html | 212 +-- .../docs/src/SwaggerPetstore.Lens.html | 58 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 102 +- .../docs/src/SwaggerPetstore.Model.html | 717 ++++---- .../example-app/package.yaml | 2 +- .../example-app/swagger-petstore-app.cabal | 2 +- .../lib/SwaggerPetstore/API.hs | 82 +- .../lib/SwaggerPetstore/Client.hs | 8 +- .../lib/SwaggerPetstore/Model.hs | 1 - .../petstore/haskell-http-client/package.yaml | 5 +- .../swagger-petstore.cabal | 3 +- .../tests-integration/package.yaml | 2 +- .../swagger-petstore-tests-integration.cabal | 2 +- .../haskell-http-client/tests/Instances.hs | 2 + .../haskell-http-client/tests/PropMime.hs | 1 + 40 files changed, 1590 insertions(+), 1405 deletions(-) create mode 100644 samples/client/petstore/haskell-http-client/CONTRIBUTING.md diff --git a/bin/haskell-http-client-petstore.sh b/bin/haskell-http-client-petstore.sh index ac21b66a745..f128afe3f60 100755 --- a/bin/haskell-http-client-petstore.sh +++ b/bin/haskell-http-client-petstore.sh @@ -28,4 +28,5 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="$@ generate -t modules/swagger-codegen/src/main/resources/haskell-http-client -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l haskell-http-client -o samples/client/petstore/haskell-http-client" +echo "java ${JAVA_OPTS} -jar ${executable} ${ags}" java $JAVA_OPTS -jar $executable $ags 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 5f57e100c50..a7cc41fd230 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 @@ -42,7 +42,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected String artifactId = "swagger-haskell-http-client"; protected String artifactVersion = "1.0.0"; - protected String defaultDateTimeFormat = "%Y-%m-%dT%H:%M:%S%Q%z"; protected String defaultDateFormat = "%Y-%m-%d"; // CLI @@ -54,6 +53,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC public static final String GENERATE_LENSES = "generateLenses"; public static final String GENERATE_MODEL_CONSTRUCTORS = "generateModelConstructors"; public static final String MODEL_DERIVING = "modelDeriving"; + public static final String STRICT_FIELDS = "strictFields"; // protected String MODEL_IMPORTS = "modelImports"; // protected String MODEL_EXTENSIONS = "modelExtensions"; @@ -182,21 +182,22 @@ public HaskellHttpClientCodegen() { importMapping.clear(); importMapping.put("Map", "qualified Data.Map as Map"); - cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); - cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); + cliOptions.add(CliOption.newString(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); + cliOptions.add(CliOption.newString(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); - cliOptions.add(new CliOption(ALLOW_FROMJSON_NULLS, "allow JSON Null during model decoding from JSON").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(ALLOW_TOJSON_NULLS, "allow emitting JSON Null during model encoding to JSON").defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(GENERATE_LENSES, "Generate Lens optics for Models").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(GENERATE_MODEL_CONSTRUCTORS, "Generate smart constructors (only supply required fields) for models").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(GENERATE_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(ALLOW_FROMJSON_NULLS, "allow JSON Null during model decoding from JSON").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(ALLOW_TOJSON_NULLS, "allow emitting JSON Null during model encoding to JSON").defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(GENERATE_LENSES, "Generate Lens optics for Models").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(GENERATE_MODEL_CONSTRUCTORS, "Generate smart constructors (only supply required fields) for models").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(GENERATE_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); + cliOptions.add(CliOption.newString(MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); + cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.FALSE.toString()))); - cliOptions.add(new CliOption(DATETIME_FORMAT, "format string used to parse/render a datetime").defaultValue(defaultDateTimeFormat)); - cliOptions.add(new CliOption(DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); + cliOptions.add(CliOption.newString(DATETIME_FORMAT, "format string used to parse/render a datetime")); + cliOptions.add(CliOption.newString(DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated").defaultValue(Boolean.TRUE.toString())); // cliOptions.add(new CliOption(MODEL_IMPORTS, "Additional imports in the Models file")); // cliOptions.add(new CliOption(MODEL_EXTENSIONS, "Additional extensions in the Models file")); @@ -241,12 +242,16 @@ public void setDateTimeFormat(String value) { public void setDateFormat(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.put(DATE_FORMAT, defaultDateFormat); + additionalProperties.remove(DATE_FORMAT); } else { additionalProperties.put(DATE_FORMAT, value); } } + public void setStrictFields(Boolean value) { + additionalProperties.put("x-strictFields", value); + } + @Override public void processOpts() { super.processOpts(); @@ -296,13 +301,19 @@ public void processOpts() { if (additionalProperties.containsKey(DATETIME_FORMAT)) { setDateTimeFormat(additionalProperties.get(DATETIME_FORMAT).toString()); } else { - setDateTimeFormat(null); + setDateTimeFormat(null); // default should be null } if (additionalProperties.containsKey(DATE_FORMAT)) { setDateFormat(additionalProperties.get(DATE_FORMAT).toString()); } else { - setDateFormat(null); + setDateFormat(defaultDateFormat); + } + + if (additionalProperties.containsKey(STRICT_FIELDS)) { + setStrictFields(convertPropertyToBoolean(STRICT_FIELDS)); + } else { + setStrictFields(false); } } 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 7b9745acb06..30c23fc0c37 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 @@ -11,13 +11,15 @@ Module : {{title}}.API {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE InstanceSigs #-} -{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module {{title}}.API where import {{title}}.Model as M import {{title}}.MimeTypes +import {{title}}.Lens import qualified Data.Aeson as A import Data.Aeson (Value) @@ -52,6 +54,8 @@ import qualified Data.Text.Lazy.Encoding as TL import qualified GHC.Base as P (Alternative) import qualified Control.Arrow as P (left) +import qualified Lens.Micro as L + import Data.Monoid ((<>)) import Data.Function ((&)) import Data.Set (Set) @@ -144,11 +148,26 @@ newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramName -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. data {{requestType}} req contentType res = {{requestType}} { rMethod :: NH.Method -- ^ Method of {{requestType}} - , urlPath :: [BCL.ByteString] -- ^ Endpoint of {{requestType}} - , params :: Params -- ^ params of {{requestType}} + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of {{requestType}} + , rParams :: Params -- ^ params of {{requestType}} } deriving (P.Show) +-- | 'rMethod' Lens +rMethodL :: Lens_' ({{requestType}} req contentType res) NH.Method +rMethodL f {{requestType}}{..} = (\rMethod -> {{requestType}} { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' ({{requestType}} req contentType res) [BCL.ByteString] +rUrlPathL f {{requestType}}{..} = (\rUrlPath -> {{requestType}} { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' ({{requestType}} req contentType res) Params +rParamsL f {{requestType}}{..} = (\rParams -> {{requestType}} { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + -- | Request Params data Params = Params { paramsQuery :: NH.Query @@ -157,6 +176,21 @@ data Params = Params } deriving (P.Show) +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + -- | Request Body data ParamBody = ParamBodyNone @@ -177,15 +211,18 @@ _mkParams :: Params _mkParams = Params [] [] ParamBodyNone setHeader :: {{requestType}} req contentType res -> [NH.Header] -> {{requestType}} req contentType res -setHeader req header = - let _params = params (req `removeHeader` P.fmap P.fst header) - in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) removeHeader :: {{requestType}} req contentType res -> [NH.HeaderName] -> {{requestType}} req contentType res -removeHeader req header = - let _params = params req - in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } - where cifst = CI.mk . P.fst +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst _setContentTypeHeader :: forall req contentType res. MimeType contentType => {{requestType}} req contentType res -> {{requestType}} req contentType res @@ -202,35 +239,34 @@ _setAcceptHeader req accept = _setQuery :: {{requestType}} req contentType res -> [NH.QueryItem] -> {{requestType}} req contentType res _setQuery req query = - let _params = params req - in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } - where cifst = CI.mk . P.fst + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst _addForm :: {{requestType}} req contentType res -> WH.Form -> {{requestType}} req contentType res _addForm req newform = - let _params = params req - form = case paramsBody _params of + let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) _addMultiFormPart :: {{requestType}} req contentType res -> NH.Part -> {{requestType}} req contentType res _addMultiFormPart req newpart = - let _params = params req - parts = case paramsBody _params of + let parts = case paramsBody (rParams req) of ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) _setBodyBS :: {{requestType}} req contentType res -> B.ByteString -> {{requestType}} req contentType res _setBodyBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyB body } } + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) _setBodyLBS :: {{requestType}} req contentType res -> BL.ByteString -> {{requestType}} req contentType res _setBodyLBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyBL body } } + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -- ** Params Utils diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index d044001284e..f23f0ebf1dd 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -225,15 +225,15 @@ _toInitRequest -> accept -- ^ "accept" 'MimeType' -> IO (InitRequest req contentType res accept) -- ^ initialized request _toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (urlPath req0)) + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) - reqQuery = NH.renderQuery True (paramsQuery (params req1)) + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) pReq = parsedReq { NH.method = (rMethod req1) , NH.requestHeaders = reqHeaders , NH.queryString = reqQuery } - outReq <- case paramsBody (params req1) of + outReq <- case paramsBody (rParams req1) 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 }) 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 8bac6084805..17b1b55827f 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 @@ -2,7 +2,6 @@ Module : {{title}}.Model -} -{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveGeneric #-} @@ -58,7 +57,7 @@ import qualified Prelude as P -- {{{.}}}{{/description}} {{^vendorExtensions.x-customNewtype}} data {{classname}} = {{classname}} - { {{#vars}}{{name}} :: {{^required}}Maybe {{/required}}{{datatype}} -- ^ {{#required}}/Required/ {{/required}}{{#readOnly}}/ReadOnly/ {{/readOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{#hasMore}} + { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{datatype}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#readOnly}}/ReadOnly/ {{/readOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{#hasMore}} , {{/hasMore}}{{/vars}} } deriving (P.Show,P.Eq,P.Typeable{{#modelDeriving}},{{modelDeriving}}{{/modelDeriving}}) 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 4a32daa917c..028941e3ae7 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 @@ -50,17 +50,20 @@ haskell-http-client - use `setHeader` to add any required headers to requests +* Model Inheritance + * Default Parameter Values * Enum Parameters + This is beta software; other cases may not be supported. -### Codegen "config option" parameters +### Codegen "additional properties" parameters These options allow some customization of the code generation process. -**haskell-http-client specific options:** +**haskell-http-client additional properties:** | OPTION | DESCRIPTION | DEFAULT | ACTUAL | | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | @@ -72,15 +75,23 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | {{{generateLenses}}} | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{{generateModelConstructors}}} | | modelDeriving | Additional classes to include in the deriving() clause of Models | | {{{modelDeriving}}} | +| strictFields | Add strictness annotations to all model fields | false | {{{x-strictFields}}} | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis +An example setting _strictFields_ and _dateTimeFormat_: + +``` +java -jar swagger-codegen-cli.jar generate -i petstore.yaml -l haskell-http-client -o output/haskell-http-client -DstrictFields=true -DdateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" +``` + View the full list of Codegen "config option" parameters with the command: ``` -java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l haskell-http-client +java -jar swagger-codegen-cli.jar config-help -l haskell-http-client ``` + ### Example SwaggerPetstore Haddock documentation An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] 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 91e97ff9cd9..3cbf6cd3630 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 @@ -7,11 +7,11 @@ module {{title}} , module {{title}}.API , module {{title}}.Model , module {{title}}.MimeTypes - , {{#generateLenses}}module {{title}}.Lens{{/generateLenses}} + , module {{title}}.Lens ) where import {{title}}.API import {{title}}.Client import {{title}}.Model import {{title}}.MimeTypes -{{#generateLenses}}import {{title}}.Lens{{/generateLenses}} +import {{title}}.Lens 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 5e5a6223507..0f1f9f28a6a 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 @@ -57,13 +57,14 @@ library , monad-logger >=0.3 && <0.4 , safe-exceptions <0.2 , case-insensitive + , microlens >= 0.4.3 && <0.5 exposed-modules: {{title}} {{title}}.API {{title}}.Client {{title}}.Model {{title}}.MimeTypes - {{#generateLenses}}{{title}}.Lens{{/generateLenses}} + {{title}}.Lens other-modules: Paths_{{pathsName}} default-language: Haskell2010 diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache index c0747d40afd..23b18b7c6ce 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache @@ -36,16 +36,18 @@ dependencies: - transformers >=0.4.0.0 - mtl >=2.2.1 - unordered-containers +ghc-options: -Wall library: source-dirs: lib - ghc-options: -Wall + ghc-options: + {{#x-strictFields}}- -funbox-strict-fields{{/x-strictFields}} exposed-modules: - {{title}} - {{title}}.API - {{title}}.Client - {{title}}.Model - {{title}}.MimeTypes - {{#generateLenses}}- {{title}}.Lens{{/generateLenses}} + - {{title}}.Lens dependencies: - aeson >=1.0 && <2.0 - bytestring >=0.10.0 && <0.11 @@ -65,6 +67,7 @@ library: - monad-logger >=0.3 && <0.4 - safe-exceptions <0.2 - case-insensitive + - microlens >= 0.4.3 && <0.5 tests: tests: main: Test.hs diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache index 51de32c1727..5057ecb312a 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + module Instances where import Data.Text (Text, pack) diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/PropMime.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/PropMime.mustache index 763ceed8935..f672a4d3adf 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/PropMime.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/PropMime.mustache @@ -1,6 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} module PropMime where 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 b63a4bf4888..98d583fbd11 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 @@ -47,6 +47,8 @@ protected void setExpectations() { times = 1; clientCodegen.setDateFormat(HaskellHttpClientOptionsProvider.DATE_FORMAT); times = 1; + clientCodegen.setStrictFields(Boolean.valueOf(HaskellHttpClientOptionsProvider.STRICT_FIELDS)); + times = 1; }}; } 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 8e589ac13a4..d124c66ff54 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 @@ -19,6 +19,7 @@ public class HaskellHttpClientOptionsProvider implements OptionsProvider { public static final String DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S%Q%z"; public static final String DATE_FORMAT = "%Y-%m-%d"; public static final String MODEL_DERIVING = ""; + public static final String STRICT_FIELDS = "false"; public static final String GENERATE_FORM_URLENCODED_INSTANCES = "true"; public static final String GENERATE_LENSES = "true"; public static final String GENERATE_MODEL_CONSTRUCTORS = "true"; @@ -46,6 +47,7 @@ public Map createOptions() { .put(HaskellHttpClientCodegen.GENERATE_FORM_URLENCODED_INSTANCES, GENERATE_FORM_URLENCODED_INSTANCES) .put(HaskellHttpClientCodegen.GENERATE_LENSES, GENERATE_LENSES) .put(HaskellHttpClientCodegen.GENERATE_MODEL_CONSTRUCTORS, GENERATE_MODEL_CONSTRUCTORS) + .put(HaskellHttpClientCodegen.STRICT_FIELDS, STRICT_FIELDS) .build(); } diff --git a/samples/client/petstore/haskell-http-client/CONTRIBUTING.md b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md new file mode 100644 index 00000000000..91fbe58305b --- /dev/null +++ b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md @@ -0,0 +1,28 @@ +### Rebuild jar + +``` + (cd ../../../..; mvn package); +``` + +### Regenerate Template + +1. Run the shell script `haskell-http-client-petstore.sh` to update the Petstore sample + +```bash + (cd ../../../..; ./bin/haskell-http-client-petstore.sh); +``` + +### Typecheck, Build and run Unit tests + +2. Check that the following commands complete build without any errors + +```bash + (stack clean && stack haddock && stack test); + (cd ./example-app; stack clean && stack build); + (cd ./tests-integration; stack clean && stack build --no-run-tests); +``` + +### Integration Tests + +3. run the integration tests as described in `./tests-integration/README.md` + diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 817c834271d..35ac99a323a 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -50,17 +50,20 @@ haskell-http-client - use `setHeader` to add any required headers to requests +* Model Inheritance + * Default Parameter Values * Enum Parameters + This is beta software; other cases may not be supported. -### Codegen "config option" parameters +### Codegen "additional properties" parameters These options allow some customization of the code generation process. -**haskell-http-client specific options:** +**haskell-http-client additional properties:** | OPTION | DESCRIPTION | DEFAULT | ACTUAL | | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | @@ -72,15 +75,23 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | true | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true | | modelDeriving | Additional classes to include in the deriving() clause of Models | | | +| strictFields | Add strictness annotations to all model fields | false | false | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis +An example setting _strictFields_ and _dateTimeFormat_: + +``` +java -jar swagger-codegen-cli.jar generate -i petstore.yaml -l haskell-http-client -o output/haskell-http-client -DstrictFields=true -DdateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" +``` + View the full list of Codegen "config option" parameters with the command: ``` -java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l haskell-http-client +java -jar swagger-codegen-cli.jar config-help -l haskell-http-client ``` + ### Example SwaggerPetstore Haddock documentation An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2] 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 2dab043222b..c19843f7d57 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

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
POST /pet

Add a new pet to the store

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: Integer

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: [Text]

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: petstore_auth

findPetsByTags

findPetsByTags Source #

Arguments

:: [Text]

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

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

AuthMethod: petstore_auth

getPetById

getPetById Source #

Arguments

:: Integer

"petId" - ID of pet to return

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

Find pet by ID

Returns a single pet

AuthMethod: api_key

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
PUT /pet

Update an existing pet

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> Integer

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

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

Updates a pet in the store with form data

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> Integer

"petId" - ID of pet to update

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

uploads an image

AuthMethod: petstore_auth

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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: Text

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

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

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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: api_key

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Integer

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

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

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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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 [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Text

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Text

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Text

"username" - The user name for login

-> Text

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Text

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Status Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiUnderscorekey Source # 

Optional Request Parameter Types

newtype Name Source #

Constructors

Name 

Fields

Instances

newtype Status Source #

Constructors

Status 

Fields

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #

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

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

_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res 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 #

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API

Description

 

Synopsis

Operations

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
POST /pet

Add a new pet to the store

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: Integer

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: [Text]

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: petstore_auth

findPetsByTags

findPetsByTags Source #

Arguments

:: [Text]

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

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

AuthMethod: petstore_auth

getPetById

getPetById Source #

Arguments

:: Integer

"petId" - ID of pet to return

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

Find pet by ID

Returns a single pet

AuthMethod: api_key

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
PUT /pet

Update an existing pet

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> Integer

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

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

Updates a pet in the store with form data

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> Integer

"petId" - ID of pet to update

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

uploads an image

AuthMethod: petstore_auth

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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: Text

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

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

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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: api_key

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Integer

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

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

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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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 [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Text

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Text

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Text

"username" - The user name for login

-> Text

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Text

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Status Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiUnderscorekey Source # 

Optional Request Parameter Types

newtype Name Source #

Constructors

Name 

Fields

Instances

newtype Status Source #

Constructors

Status 

Fields

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #

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

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

_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res 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 #

\ 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 d34081fce73..58030dc136a 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

 

Synopsis

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json
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
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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 MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source # 
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 MimeNoContent Source # 
MimeType MimeOctetStream Source # 
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
MimeType MimeJSON Source #
application/json

MimeType Instances

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 ByteString Source #
P.id
MimeRender MimeMultipartFormData String Source #
BCL.pack
MimeRender MimeMultipartFormData Text Source #
BL.fromStrict . T.encodeUtf8
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

class MimeType mtype => Consumes req mtype Source #

Instances

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Consumes UpdatePet MimeXML Source #
application/xml
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeXML Source #
application/xml
Consumes AddPet MimeJSON Source #
application/json

Request Produces

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
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

Synopsis

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json
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
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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 MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source # 
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 MimeNoContent Source # 
MimeType MimeOctetStream Source # 
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
MimeType MimeJSON Source #
application/json

MimeType Instances

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 ByteString Source #
P.id
MimeRender MimeMultipartFormData String Source #
BCL.pack
MimeRender MimeMultipartFormData Text Source #
BL.fromStrict . T.encodeUtf8
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

class MimeType mtype => Consumes req mtype Source #

Instances

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Consumes UpdatePet MimeXML Source #
application/xml
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeXML Source #
application/xml
Consumes AddPet MimeJSON Source #
application/json

Request Produces

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
\ 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 dc94e0e3b1d..e54d8c2a3d3 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ 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 a0148f93dd7..32f2de0df2e 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.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, 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
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, 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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, 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
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, 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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, 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 39fc9910d83..49fe76696ca 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsSwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 68b8401467b..37efd6d0758 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

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

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, 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 916d307b244..dd47647ad7d 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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
urlPathSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ 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 index a18ac070a29..53a2e86e806 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

SwaggerPetstore.API

Operations

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Optional Request Parameter Types

data Name

data Status

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

\ No newline at end of file +

SwaggerPetstore.API

Operations

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Optional Request Parameter Types

data Name

data Status

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index d6c2472e097..9f192a77a35 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -30,7 +30,7 @@ bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/bin" -libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-FhAGC7YzWguJAT2YJ3ggeI" +libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-CY2qj9sV8yi3N5R3aev4xa" dynlibdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2" datadir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/share/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0" libexecdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/libexec" @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 bd48b3f7366..2f8e8d83d05 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 @@ -11,821 +11,857 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE InstanceSigs #-} -{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.API where - +{-# LANGUAGE NamedFieldPuns #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API where -import SwaggerPetstore.Model as M -import SwaggerPetstore.MimeTypes - -import qualified Data.Aeson as A -import Data.Aeson (Value) - -import qualified Data.Time as TI -import Data.Time (UTCTime) - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import Data.ByteString.Lazy (ByteString) -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL - -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.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI -import qualified Data.Data as P (Typeable) -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.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 GHC.Base as P (Alternative) -import qualified Control.Arrow as P (left) - -import Data.Monoid ((<>)) -import Data.Function ((&)) -import Data.Set (Set) -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 + +import SwaggerPetstore.Model as M +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens + +import qualified Data.Aeson as A +import Data.Aeson (Value) + +import qualified Data.Time as TI +import Data.Time (UTCTime) + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import Data.ByteString.Lazy (ByteString) +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL + +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.HttpApiData as WH +import qualified Web.FormUrlEncoded as WH + +import qualified Data.CaseInsensitive as CI +import qualified Data.Data as P (Typeable) +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.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 GHC.Base as P (Alternative) +import qualified Control.Arrow as P (left) + +import qualified Lens.Micro as L + +import Data.Monoid ((<>)) +import Data.Function ((&)) +import Data.Set (Set) +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 + --- | @POST \/pet@ --- --- Add a new pet to the store --- --- +-- ** Pet + +-- *** addPet + +-- | @POST \/pet@ -- --- AuthMethod: petstore_auth +-- Add a new pet to the store -- --- Note: Has 'Produces' instances, but no response schema +-- -- -addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = - _mkRequest "POST" ["/pet"] - `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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +addPet + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = + _mkRequest "POST" ["/pet"] + `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}@ -- --- AuthMethod: petstore_auth +-- Deletes a pet -- --- Note: Has 'Produces' instances, but no response schema +-- -- -deletePet - :: Integer -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = - _mkRequest "DELETE" ["/pet/",toPath petId] - - -data DeletePet -instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey 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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deletePet + :: Integer -- ^ "petId" - Pet id to delete + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +deletePet petId = + _mkRequest "DELETE" ["/pet/",toPath petId] + + +data DeletePet +instance HasOptionalParam DeletePet ApiUnderscorekey where + applyOptionalParam req (ApiUnderscorekey xs) = + req `setHeader` toHeader ("api_key", xs) +-- | @application/xml@ +instance Produces DeletePet MimeXML +-- | @application/json@ +instance Produces DeletePet MimeJSON + + +-- *** findPetsByStatus + +-- | @GET \/pet\/findByStatus@ -- --- AuthMethod: petstore_auth +-- Finds Pets by status -- -findPetsByStatus - :: [Text] -- ^ "status" - Status values that need to be considered for filter - -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = - _mkRequest "GET" ["/pet/findByStatus"] - `_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. +-- Multiple status values can be provided with comma separated strings +-- +-- AuthMethod: petstore_auth +-- +findPetsByStatus + :: [Text] -- ^ "status" - Status values that need to be considered for filter + -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] +findPetsByStatus status = + _mkRequest "GET" ["/pet/findByStatus"] + `_setQuery` toQueryColl CommaSeparated ("status", Just status) + +data FindPetsByStatus +-- | @application/xml@ +instance Produces FindPetsByStatus MimeXML +-- | @application/json@ +instance Produces FindPetsByStatus MimeJSON + + +-- *** findPetsByTags + +-- | @GET \/pet\/findByTags@ -- --- AuthMethod: petstore_auth +-- Finds Pets by tags -- -findPetsByTags - :: [Text] -- ^ "tags" - Tags to filter by - -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = - _mkRequest "GET" ["/pet/findByTags"] - `_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 +-- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +-- +-- AuthMethod: petstore_auth +-- +findPetsByTags + :: [Text] -- ^ "tags" - Tags to filter by + -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] +findPetsByTags tags = + _mkRequest "GET" ["/pet/findByTags"] + `_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}@ -- --- AuthMethod: api_key +-- Find pet by ID -- -getPetById - :: Integer -- ^ "petId" - ID of pet to return - -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = - _mkRequest "GET" ["/pet/",toPath petId] - - -data GetPetById --- | @application/xml@ -instance Produces GetPetById MimeXML --- | @application/json@ -instance Produces GetPetById MimeJSON - - --- *** updatePet - --- | @PUT \/pet@ --- --- Update an existing pet --- --- +-- Returns a single pet +-- +-- AuthMethod: api_key +-- +getPetById + :: Integer -- ^ "petId" - ID of pet to return + -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet +getPetById petId = + _mkRequest "GET" ["/pet/",toPath petId] + + +data GetPetById +-- | @application/xml@ +instance Produces GetPetById MimeXML +-- | @application/json@ +instance Produces GetPetById MimeJSON + + +-- *** updatePet + +-- | @PUT \/pet@ -- --- AuthMethod: petstore_auth +-- Update an existing pet -- --- Note: Has 'Produces' instances, but no response schema +-- -- -updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = - _mkRequest "PUT" ["/pet"] - `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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePet + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest UpdatePet contentType res +updatePet _ body = + _mkRequest "PUT" ["/pet"] + `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}@ -- --- AuthMethod: petstore_auth +-- Updates a pet in the store with form data -- --- Note: Has 'Produces' instances, but no response schema +-- -- -updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = - _mkRequest "POST" ["/pet/",toPath petId] - - -data UpdatePetWithForm - --- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = - req `_addForm` toForm ("name", xs) - --- | /Optional Param/ "status" - Updated status of the pet -instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status 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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePetWithForm + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') + -> Integer -- ^ "petId" - ID of pet that needs to be updated + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ petId = + _mkRequest "POST" ["/pet/",toPath petId] + + +data UpdatePetWithForm + +-- | /Optional Param/ "name" - Updated name of the pet +instance HasOptionalParam UpdatePetWithForm Name where + applyOptionalParam req (Name xs) = + req `_addForm` toForm ("name", xs) + +-- | /Optional Param/ "status" - Updated status of the pet +instance HasOptionalParam UpdatePetWithForm Status where + applyOptionalParam req (Status 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@ -- --- AuthMethod: petstore_auth +-- uploads an image -- -uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - - -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 - +-- +-- +-- AuthMethod: petstore_auth +-- +uploadFile + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') + -> Integer -- ^ "petId" - ID of pet to update + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +uploadFile _ petId = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + + +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 --- ** Store - --- *** deleteOrder +-- | @application/json@ +instance Produces UploadFile MimeJSON + --- | @DELETE \/store\/order\/{orderId}@ --- --- Delete purchase order by ID --- --- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +-- ** Store + +-- *** deleteOrder + +-- | @DELETE \/store\/order\/{orderId}@ -- --- Note: Has 'Produces' instances, but no response schema +-- Delete purchase order by ID -- -deleteOrder - :: Text -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder 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 +-- 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 + :: Text -- ^ "orderId" - ID of the order that needs to be deleted + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +deleteOrder 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@ -- --- AuthMethod: api_key +-- Returns pet inventories by status -- -getInventory - :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map.Map String Int) -getInventory = - _mkRequest "GET" ["/store/inventory"] - -data GetInventory --- | @application/json@ -instance Produces GetInventory MimeJSON +-- Returns a map of status codes to quantities +-- +-- AuthMethod: api_key +-- +getInventory + :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map.Map String Int) +getInventory = + _mkRequest "GET" ["/store/inventory"] - --- *** getOrderById - --- | @GET \/store\/order\/{orderId}@ --- --- Find purchase order by ID --- --- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +data GetInventory +-- | @application/json@ +instance Produces GetInventory MimeJSON + + +-- *** getOrderById + +-- | @GET \/store\/order\/{orderId}@ -- -getOrderById - :: Integer -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById 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 --- --- +-- Find purchase order by ID +-- +-- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +-- +getOrderById + :: Integer -- ^ "orderId" - ID of pet that needs to be fetched + -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order +getOrderById 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@ -- -placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => contentType -- ^ request content-type ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -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 +-- Place an order for a pet +-- +-- +-- +placeOrder + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => contentType -- ^ request content-type ('MimeType') + -> Order -- ^ "body" - order placed for purchasing the pet + -> SwaggerPetstoreRequest PlaceOrder contentType Order +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 + --- | @POST \/user@ --- --- Create user --- --- This can only be done by the logged in user. +-- ** User + +-- *** createUser + +-- | @POST \/user@ -- --- Note: Has 'Produces' instances, but no response schema +-- Create user -- -createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -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 --- --- +-- 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 -- ^ request content-type ('MimeType') + -> User -- ^ "body" - Created user object + -> SwaggerPetstoreRequest CreateUser contentType res +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@ -- --- Note: Has 'Produces' instances, but no response schema +-- Creates list of users with given input array -- -createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = - _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body - -data CreateUsersWithArrayInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput [User] --- | @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 +-- +createUsersWithArrayInput + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') + -> [User] -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +createUsersWithArrayInput _ body = + _mkRequest "POST" ["/user/createWithArray"] + `setBodyParam` body + +data CreateUsersWithArrayInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithArrayInput [User] +-- | @application/xml@ +instance Produces CreateUsersWithArrayInput MimeXML +-- | @application/json@ +instance Produces CreateUsersWithArrayInput MimeJSON + + +-- *** createUsersWithListInput + +-- | @POST \/user\/createWithList@ -- --- Note: Has 'Produces' instances, but no response schema +-- Creates list of users with given input array -- -createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = - _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body - -data CreateUsersWithListInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput [User] --- | @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 +-- +createUsersWithListInput + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') + -> [User] -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +createUsersWithListInput _ body = + _mkRequest "POST" ["/user/createWithList"] + `setBodyParam` body + +data CreateUsersWithListInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithListInput [User] +-- | @application/xml@ +instance Produces CreateUsersWithListInput MimeXML +-- | @application/json@ +instance Produces CreateUsersWithListInput MimeJSON + + +-- *** deleteUser + +-- | @DELETE \/user\/{username}@ -- --- Note: Has 'Produces' instances, but no response schema +-- Delete user -- -deleteUser - :: Text -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser 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 --- --- +-- This can only be done by the logged in user. +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deleteUser + :: Text -- ^ "username" - The name that needs to be deleted + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser username = + _mkRequest "DELETE" ["/user/",toPath username] + + +data DeleteUser +-- | @application/xml@ +instance Produces DeleteUser MimeXML +-- | @application/json@ +instance Produces DeleteUser MimeJSON + + +-- *** getUserByName + +-- | @GET \/user\/{username}@ -- -getUserByName - :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName 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 --- --- +-- Get user by user name +-- +-- +-- +getUserByName + :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + -> SwaggerPetstoreRequest GetUserByName MimeNoContent User +getUserByName username = + _mkRequest "GET" ["/user/",toPath username] + + +data GetUserByName +-- | @application/xml@ +instance Produces GetUserByName MimeXML +-- | @application/json@ +instance Produces GetUserByName MimeJSON + + +-- *** loginUser + +-- | @GET \/user\/login@ -- -loginUser - :: Text -- ^ "username" - The user name for login - -> Text -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username 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 --- --- +-- Logs user into the system +-- +-- +-- +loginUser + :: Text -- ^ "username" - The user name for login + -> Text -- ^ "password" - The password for login in clear text + -> SwaggerPetstoreRequest LoginUser MimeNoContent Text +loginUser username 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@ -- --- Note: Has 'Produces' instances, but no response schema +-- Logs out current logged in user session -- -logoutUser - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res -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 +-- +logoutUser + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res +logoutUser = + _mkRequest "GET" ["/user/logout"] + +data LogoutUser +-- | @application/xml@ +instance Produces LogoutUser MimeXML +-- | @application/json@ +instance Produces LogoutUser MimeJSON + + +-- *** updateUser + +-- | @PUT \/user\/{username}@ -- --- Note: Has 'Produces' instances, but no response schema +-- Updated user -- -updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') - -> Text -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ 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 - - - --- * HasBodyParam +-- 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 -- ^ request content-type ('MimeType') + -> Text -- ^ "username" - name that need to be deleted + -> User -- ^ "body" - Updated user object + -> SwaggerPetstoreRequest UpdateUser contentType res +updateUser _ 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 --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} + + +-- * HasBodyParam + +-- | Designates the body parameter of a request +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader + +-- * HasOptionalParam - -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * Optional Request Parameter Types +-- | Designates the optional parameters of a request +class HasOptionalParam req param where + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} - -newtype ApiUnderscorekey = ApiUnderscorekey { unApiUnderscorekey :: Text } deriving (P.Eq, P.Show) - -newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) +infixl 2 -&- + +-- * Optional Request Parameter Types + -newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) +newtype ApiUnderscorekey = ApiUnderscorekey { unApiUnderscorekey :: Text } deriving (P.Eq, P.Show) -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) +newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) +newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) - --- * SwaggerPetstoreRequest - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest - { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , urlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , params :: Params -- ^ params of SwaggerPetstoreRequest - } - deriving (P.Show) - --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** SwaggerPetstoreRequest Utils +newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) + +newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) + + +-- * SwaggerPetstoreRequest + +-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest + { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest + , rParams :: Params -- ^ params of SwaggerPetstoreRequest + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - let _params = params (req `removeHeader` P.fmap P.fst header) - in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +{-# INLINE paramsQueryL #-} -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - let _params = params req - in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } - where cifst = CI.mk . P.fst - - -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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 -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +-- | 'paramsHeaders' Lens +paramsHeadersL :: Lens_' Params NH.RequestHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = - let _params = params req - in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } - where cifst = CI.mk . P.fst - -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let _params = params req - form = case paramsBody _params of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } - -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let _params = params req - parts = case paramsBody _params of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } - -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyB body } } - -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyBL body } } - - --- ** Params Utils - -toPath - :: 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] - -toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form -toForm (k,v) = WH.toForm [(BC.unpack k,v)] +-- ** SwaggerPetstoreRequest Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) + +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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 +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst -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 - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) -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 - where - pack (k,v) = (CI.mk k, v) - unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + -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 - {-# 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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - - \ No newline at end of file +-- ** Params Utils + +toPath + :: 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] + +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 + +-- *** Swagger `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 + where + 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 + +_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.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 + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + + \ 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 27f9b2475b0..e8979eb697f 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 @@ -63,11 +63,11 @@ -- | display the config instance 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 -- @@ -93,15 +93,15 @@ -- | updates the config to use a MonadLogger instance which prints to stdout. withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} +withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} -- | updates the config to use a MonadLogger instance which prints to stderr. withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} -- | updates the config to disable logging withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configExecLoggingT = runNullLoggingT} -- * Dispatch @@ -109,21 +109,21 @@ -- | 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + 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) @@ -137,124 +137,124 @@ -- | send a request returning the 'MimeResult' 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runExceptionLoggingT "Client" config $ - do case mimeUnrender' accept (NH.responseBody httpResponse) of - Left s -> do - logNST LG.LevelError "Client" (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runExceptionLoggingT "Client" config $ + do case mimeUnrender' accept (NH.responseBody httpResponse) of + Left s -> do + logNST LG.LevelError "Client" (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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - return parsedResult + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + 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 - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) - return res +dispatchInitUnsafe manager config (InitRequest req) = do + runExceptionLoggingT logSrc config $ + do logNST LG.LevelInfo logSrc requestLogMsg + logNST LG.LevelDebug logSrc requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + logNST LG.LevelInfo logSrc (responseLogMsg res) + logNST LG.LevelDebug logSrc ((T.pack . show) res) + return res where - logSrc = "Client" - endpoint = + logSrc = "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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (urlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) - reqQuery = NH.renderQuery True (paramsQuery (params req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (params req1) 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 req1) 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 -- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a +type ExecLoggingT = forall m. P.MonadIO m => + forall a. LG.LoggingT m a -> m a -- ** Null Logger @@ -263,7 +263,7 @@ nullLogger _ _ _ _ = return () -- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a +runNullLoggingT :: LG.LoggingT m a -> m a runNullLoggingT = (`LG.runLoggingT` nullLogger) -- ** Logging Filters @@ -281,38 +281,38 @@ debugLevelFilter = minLevelFilter LG.LevelDebug minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l +minLevelFilter l _ l' = l' >= l -- ** Logging -- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) +logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () +logNST level src msg = do + now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) + LG.logOtherNS sourceLog level (now <> " " <> msg) where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = + sourceLog = "SwaggerPetstore/" <> src + formatTimeLog = T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" -- | re-throws exceptions after logging them logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = + :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) + => Text -> m a -> m a +logExceptions src = E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) + (\(e :: E.SomeException) -> do + logNST LG.LevelError src ((T.pack . show) e) + E.throw e) -- | Run a block using the configured MonadLogger instance runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) +runLoggingT config = + configExecLoggingT config . LG.filterLogger (configLoggingFilter config) -- | Run a block using the configured MonadLogger instance (logs exceptions) runExceptionLoggingT - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a +runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 83e9ff79157..72210d62f14 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -29,25 +29,25 @@ -- * 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 -- * ApiResponse -- | '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 #-} @@ -56,12 +56,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 #-} @@ -70,32 +70,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 UTCTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} -- | 'orderStatus' Lens orderStatusL :: Lens_' Order (Maybe Text) -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 #-} @@ -104,32 +104,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 Text) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus {-# INLINE petStatusL #-} @@ -138,12 +138,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 #-} @@ -152,42 +152,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 #-} 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 fa8a6de4131..cec9866dffa 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 @@ -54,94 +54,94 @@ -- ** 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) -- ** MimeType Instances -- | @application/json@ instance MimeType MimeJSON where - mimeTypes _ = + mimeTypes _ = [ "application" ME.// "json" ME./: ("charset", "utf-8") , "application" ME.// "json" ] -- | @application/xml@ instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" + mimeType _ = Just $ "application" ME.// "xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" + mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" + mimeType _ = Just $ "multipart" ME.// "form-data" -- | @text/plain;charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") + mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" + mimeType _ = Just $ "application" ME.// "octet-stream" 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 -- ** 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 -- | @P.id@ -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack -- | @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 -- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec -- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec @@ -151,41 +151,41 @@ -- ** 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 -- ** 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 +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent -- ** Request Consumes -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- ** Request Produces -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where \ 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 1dd3fd817c3..ebdc681521a 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 @@ -2,377 +2,376 @@ Module : SwaggerPetstore.Model -} -{-# LANGUAGE DeriveAnyClass #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveFoldable #-} -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE TypeFamilies #-} -{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.Model where - -import Data.Aeson ((.:),(.:!),(.:?),(.=)) -import Data.Text (Text) - -import Data.Aeson (Value) -import Data.ByteString.Lazy (ByteString) - -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.Data as P (Data, Typeable) -import qualified Data.HashMap.Lazy as HM -import qualified Data.Map as Map -import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import qualified Data.Time as TI -import qualified Data.Time.ISO8601 as TI -import Data.Time (UTCTime) - -import Control.Applicative ((<|>)) -import Control.Applicative (Alternative) -import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.Model where + +import Data.Aeson ((.:),(.:!),(.:?),(.=)) +import Data.Text (Text) + +import Data.Aeson (Value) +import Data.ByteString.Lazy (ByteString) + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.Data as P (Data, Typeable) +import qualified Data.HashMap.Lazy as HM +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Foldable as P +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 as TI +import Data.Time (UTCTime) + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +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 +-- * Models + - --- ** ApiResponse --- | --- An uploaded response --- --- Describes the result of uploading an image resource -data ApiResponse = ApiResponse - { apiResponseCode :: Maybe Int -- ^ "code" - , apiResponseType :: Maybe Text -- ^ "type" - , apiResponseMessage :: Maybe Text -- ^ "message" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> - ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") - -instance A.ToJSON ApiResponse where - toJSON ApiResponse {..} = - _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage - ] +-- ** ApiResponse +-- | +-- An uploaded response +-- +-- Describes the result of uploading an image resource +data ApiResponse = ApiResponse + { apiResponseCode :: Maybe Int -- ^ "code" + , apiResponseType :: Maybe Text -- ^ "type" + , apiResponseMessage :: Maybe Text -- ^ "message" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ApiResponse where + parseJSON = A.withObject "ApiResponse" $ \o -> + ApiResponse + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") + +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 - } - +-- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any) +mkApiResponse + :: ApiResponse +mkApiResponse = + ApiResponse + { apiResponseCode = Nothing + , apiResponseType = Nothing + , apiResponseMessage = Nothing + } + + - --- ** Category --- | --- Pet catehgry --- --- A category for a pet -data Category = Category - { categoryId :: Maybe Integer -- ^ "id" - , categoryName :: Maybe Text -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> - Category - <$> (o .:? "id") - <*> (o .:? "name") - -instance A.ToJSON Category where - toJSON Category {..} = - _omitNulls - [ "id" .= categoryId - , "name" .= categoryName - ] +-- ** Category +-- | +-- Pet catehgry +-- +-- A category for a pet +data Category = Category + { categoryId :: Maybe Integer -- ^ "id" + , categoryName :: Maybe Text -- ^ "name" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Category where + parseJSON = A.withObject "Category" $ \o -> + Category + <$> (o .:? "id") + <*> (o .:? "name") + +instance A.ToJSON Category where + toJSON Category {..} = + _omitNulls + [ "id" .= categoryId + , "name" .= categoryName + ] + - --- | 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 'Category' (by applying it's required fields, if any) +mkCategory + :: Category +mkCategory = + Category + { categoryId = Nothing + , categoryName = Nothing + } + + - --- ** Order --- | --- Pet Order --- --- An order for a pets from the pet store -data Order = Order - { orderId :: Maybe Integer -- ^ "id" - , orderPetId :: Maybe Integer -- ^ "petId" - , orderQuantity :: Maybe Int -- ^ "quantity" - , orderShipDate :: Maybe UTCTime -- ^ "shipDate" - , orderStatus :: Maybe Text -- ^ "status" - Order Status - , orderComplete :: Maybe Bool -- ^ "complete" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> - Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate" >>= P.mapM _readDateTime) - <*> (o .:? "status") - <*> (o .:? "complete") - -instance A.ToJSON Order where - toJSON Order {..} = - _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= P.fmap _showDateTime orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete - ] +-- ** Order +-- | +-- Pet Order +-- +-- An order for a pets from the pet store +data Order = Order + { orderId :: Maybe Integer -- ^ "id" + , orderPetId :: Maybe Integer -- ^ "petId" + , orderQuantity :: Maybe Int -- ^ "quantity" + , orderShipDate :: Maybe UTCTime -- ^ "shipDate" + , orderStatus :: Maybe Text -- ^ "status" - Order Status + , orderComplete :: Maybe Bool -- ^ "complete" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Order where + parseJSON = A.withObject "Order" $ \o -> + Order + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate" >>= P.mapM _readDateTime) + <*> (o .:? "status") + <*> (o .:? "complete") + +instance A.ToJSON Order where + toJSON Order {..} = + _omitNulls + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= P.fmap _showDateTime 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 - } - +-- | 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 + } + + - --- ** Pet --- | --- a Pet --- --- A pet for sale in the pet store -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 Text -- ^ "status" - pet status in the store - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> - Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") - -instance A.ToJSON Pet where - toJSON Pet {..} = - _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus - ] +-- ** Pet +-- | +-- a Pet +-- +-- A pet for sale in the pet store +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 Text -- ^ "status" - pet status in the store + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Pet where + parseJSON = A.withObject "Pet" $ \o -> + Pet + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") + +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 - } - +-- | 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 + } + + - --- ** Tag --- | --- Pet Tag --- --- A tag for a pet -data Tag = Tag - { tagId :: Maybe Integer -- ^ "id" - , tagName :: Maybe Text -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> - Tag - <$> (o .:? "id") - <*> (o .:? "name") - -instance A.ToJSON Tag where - toJSON Tag {..} = - _omitNulls - [ "id" .= tagId - , "name" .= tagName - ] +-- ** Tag +-- | +-- Pet Tag +-- +-- A tag for a pet +data Tag = Tag + { tagId :: Maybe Integer -- ^ "id" + , tagName :: Maybe Text -- ^ "name" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Tag where + parseJSON = A.withObject "Tag" $ \o -> + Tag + <$> (o .:? "id") + <*> (o .:? "name") + +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 - } - +-- | Construct a value of type 'Tag' (by applying it's required fields, if any) +mkTag + :: Tag +mkTag = + Tag + { tagId = Nothing + , tagName = Nothing + } + + - --- ** User --- | --- a User --- --- A User who is purchasing from the pet store -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) - -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 User where - toJSON User {..} = - _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus - ] +-- ** User +-- | +-- a User +-- +-- A User who is purchasing from the pet store +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) + +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 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 - } - +-- | 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 + } + + - --- * 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 - where - notNull (_, A.Null) = False - notNull _ = True - -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x - -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_emptyToNothing x = x -{-# INLINE _emptyToNothing #-} - -_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 - --- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_readDateTime = - _parseISO8601 -{-# INLINE _readDateTime #-} - --- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String -_showDateTime = - TI.formatISO8601Millis -{-# INLINE _showDateTime #-} - -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - --- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_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 TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} \ No newline at end of file +-- * 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 + where + notNull (_, A.Null) = False + notNull _ = True + +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x + +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_emptyToNothing x = x +{-# INLINE _emptyToNothing #-} + +_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 + +-- | @_parseISO8601@ +_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_readDateTime = + _parseISO8601 +{-# INLINE _readDateTime #-} + +-- | @TI.formatISO8601Millis@ +_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String +_showDateTime = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_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 TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} \ No newline at end of file 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 072f0a2d323..d77a45b3178 100644 --- a/samples/client/petstore/haskell-http-client/example-app/package.yaml +++ b/samples/client/petstore/haskell-http-client/example-app/package.yaml @@ -31,7 +31,7 @@ dependencies: - vector >=0.10.9 && <0.13 - case-insensitive - swagger-petstore -- microlens +- microlens >= 0.4.3 && <0.5 executables: swagger-petstore-app: main: Main.hs 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 c62609490b1..4c81fc4f6aa 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 @@ -39,5 +39,5 @@ executable swagger-petstore-app , vector >=0.10.9 && <0.13 , case-insensitive , swagger-petstore - , microlens + , microlens >= 0.4.3 && <0.5 default-language: Haskell2010 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 0d2f2ee8b20..bd49d5fd629 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -11,13 +11,15 @@ Module : SwaggerPetstore.API {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE InstanceSigs #-} -{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module SwaggerPetstore.API where import SwaggerPetstore.Model as M import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens import qualified Data.Aeson as A import Data.Aeson (Value) @@ -52,6 +54,8 @@ import qualified Data.Text.Lazy.Encoding as TL import qualified GHC.Base as P (Alternative) import qualified Control.Arrow as P (left) +import qualified Lens.Micro as L + import Data.Monoid ((<>)) import Data.Function ((&)) import Data.Set (Set) @@ -676,11 +680,26 @@ newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , urlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , params :: Params -- ^ params of SwaggerPetstoreRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest + , rParams :: Params -- ^ params of SwaggerPetstoreRequest } deriving (P.Show) +-- | 'rMethod' Lens +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + -- | Request Params data Params = Params { paramsQuery :: NH.Query @@ -689,6 +708,21 @@ data Params = Params } deriving (P.Show) +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + -- | Request Body data ParamBody = ParamBodyNone @@ -709,15 +743,18 @@ _mkParams :: Params _mkParams = Params [] [] ParamBodyNone setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - let _params = params (req `removeHeader` P.fmap P.fst header) - in req { params = _params { paramsHeaders = header P.++ paramsHeaders _params } } +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - let _params = params req - in req { params = _params { paramsHeaders = [h | h <- paramsHeaders _params, cifst h `P.notElem` P.fmap CI.mk header] } } - where cifst = CI.mk . P.fst +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst _setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res @@ -734,35 +771,34 @@ _setAcceptHeader req accept = _setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res _setQuery req query = - let _params = params req - in req { params = _params { paramsQuery = query P.++ [q | q <- paramsQuery _params, cifst q `P.notElem` P.fmap cifst query] } } - where cifst = CI.mk . P.fst + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst _addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res _addForm req newform = - let _params = params req - form = case paramsBody _params of + let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req { params = _params { paramsBody = ParamBodyFormUrlEncoded (newform <> form) } } + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) _addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res _addMultiFormPart req newpart = - let _params = params req - parts = case paramsBody _params of + let parts = case paramsBody (rParams req) of ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req { params = _params { paramsBody = ParamBodyMultipartFormData (newpart : parts) } } + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) _setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res _setBodyBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyB body } } + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) _setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res _setBodyLBS req body = - let _params = params req - in req { params = _params { paramsBody = ParamBodyBL body } } + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -- ** Params Utils diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index 8d9d6b53f7b..681ecb28607 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -225,15 +225,15 @@ _toInitRequest -> accept -- ^ "accept" 'MimeType' -> IO (InitRequest req contentType res accept) -- ^ initialized request _toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (urlPath req0)) + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (params req1) - reqQuery = NH.renderQuery True (paramsQuery (params req1)) + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) pReq = parsedReq { NH.method = (rMethod req1) , NH.requestHeaders = reqHeaders , NH.queryString = reqQuery } - outReq <- case paramsBody (params req1) of + outReq <- case paramsBody (rParams req1) 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 }) 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 b2df5ab575c..d14764e85a8 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -2,7 +2,6 @@ Module : SwaggerPetstore.Model -} -{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveGeneric #-} diff --git a/samples/client/petstore/haskell-http-client/package.yaml b/samples/client/petstore/haskell-http-client/package.yaml index 19711dee476..4ec0778ce1a 100644 --- a/samples/client/petstore/haskell-http-client/package.yaml +++ b/samples/client/petstore/haskell-http-client/package.yaml @@ -33,9 +33,11 @@ dependencies: - transformers >=0.4.0.0 - mtl >=2.2.1 - unordered-containers +ghc-options: -Wall library: source-dirs: lib - ghc-options: -Wall + ghc-options: + exposed-modules: - SwaggerPetstore - SwaggerPetstore.API @@ -62,6 +64,7 @@ library: - monad-logger >=0.3 && <0.4 - safe-exceptions <0.2 - case-insensitive + - microlens >= 0.4.3 && <0.5 tests: tests: main: Test.hs diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index 3d96cf923d8..e8e4b538161 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -56,6 +56,7 @@ library , monad-logger >=0.3 && <0.4 , safe-exceptions <0.2 , case-insensitive + , microlens >= 0.4.3 && <0.5 exposed-modules: SwaggerPetstore SwaggerPetstore.API @@ -72,7 +73,7 @@ test-suite tests main-is: Test.hs hs-source-dirs: tests - ghc-options: -fno-warn-orphans + ghc-options: -Wall -fno-warn-orphans build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml index dec56e307b3..44bc8174414 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -33,7 +33,7 @@ dependencies: - exceptions >= 0.4 - case-insensitive - safe-exceptions <0.2 -- microlens +- microlens >= 0.4.3 && <0.5 - swagger-petstore tests: tests: diff --git a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal index 7255abfa1f6..98c3670066a 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal @@ -44,7 +44,7 @@ test-suite tests , exceptions >= 0.4 , case-insensitive , safe-exceptions <0.2 - , microlens + , microlens >= 0.4.3 && <0.5 , swagger-petstore , swagger-petstore , bytestring >=0.10.0 && <0.11 diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 6f995219f7c..850a838576f 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + module Instances where import Data.Text (Text, pack) diff --git a/samples/client/petstore/haskell-http-client/tests/PropMime.hs b/samples/client/petstore/haskell-http-client/tests/PropMime.hs index c7f66604461..ed3cbebb2d7 100644 --- a/samples/client/petstore/haskell-http-client/tests/PropMime.hs +++ b/samples/client/petstore/haskell-http-client/tests/PropMime.hs @@ -1,6 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} module PropMime where From 35cf42996a363befa0b06ea8c1f2eb0906d195c3 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 9 Sep 2017 17:16:04 +0800 Subject: [PATCH 010/197] add note to deprecate swift generator --- .../swagger/codegen/languages/AbstractCSharpCodegen.java | 2 ++ .../java/io/swagger/codegen/languages/SwiftCodegen.java | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index 31f98f6a2a6..d45153dd521 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -47,6 +47,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co public AbstractCSharpCodegen() { super(); + supportsInheritance = true; + // C# does not use import mapping importMapping.clear(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java index 55565fb0fb3..902302833de 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java @@ -23,6 +23,11 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * Swift (2.x) generator is no longer actively maintained. Please use + * 'swift3' or 'swift4' generator instead. + */ + public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; public static final String RESPONSE_AS = "responseAs"; @@ -61,7 +66,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a swift client library."; + return "Generates a Swift (2.x) client library. IMPORTANT NOTE: this generator (swfit 2.x) is no longer actively maintained so please use 'swift3' or 'swift4' generator instead."; } public SwiftCodegen() { From bbb901549fe744abef05821b73c7051b7f6960ae Mon Sep 17 00:00:00 2001 From: IvanovJohn Date: Sat, 9 Sep 2017 17:19:57 +0700 Subject: [PATCH 011/197] [C#] Enabled inheritance to prevent property duplication (#6335) * Issue#3829. [CSharp] Enabled inheritance to prevent property duplication when using allOf and discriminator * tabs removed * Petstore sample updated --- samples/client/petstore/csharp/SwaggerClient/docs/Cat.md | 2 -- samples/client/petstore/csharp/SwaggerClient/docs/Dog.md | 2 -- .../petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md b/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md index a88425f4307..67d2745297c 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md @@ -3,8 +3,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to "red"] **Declawed** | **bool?** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md b/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md index c3ee6d927b4..f0d44baa3c6 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md @@ -3,8 +3,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs index b012af5de70..f58a2a69503 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs @@ -58,6 +58,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Cat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append("}\n"); From e733bfa67d9daffbed7f8f373221cd1c0c4a61e6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 9 Sep 2017 21:19:21 +0800 Subject: [PATCH 012/197] update c# petstore samples --- samples/client/petstore/csharp/SwaggerClient/docs/Cat.md | 2 ++ samples/client/petstore/csharp/SwaggerClient/docs/Dog.md | 2 ++ .../petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md b/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md index 67d2745297c..a88425f4307 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Cat.md @@ -3,6 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] **Declawed** | **bool?** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md b/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md index f0d44baa3c6..c3ee6d927b4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Dog.md @@ -3,6 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs index f58a2a69503..b012af5de70 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Cat.cs @@ -58,7 +58,6 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Cat {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append("}\n"); From 94f5250e71850ffc9428d02def94a3e2d2a4ad63 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 10 Sep 2017 00:12:58 +0800 Subject: [PATCH 013/197] add presentation by Jesse Collis --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4d3ca5b5b27..0f747a1ca1d 100644 --- a/README.md +++ b/README.md @@ -861,6 +861,7 @@ Presentations/Videos/Tutorials/Books - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) +- 2017/04/13 - [Automatically Generating your API Client with Swagger and Swagger Codegen](https://www.youtube.com/watch?v=EzKwi-u9jQo) by [Jesse Collis](https://github.com/jessedc) @ Melbourne Cocoaheads - 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew) - 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/) - 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71) From 29bd1d92f27cdac8d2b6b959f3a070db555c35af Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 10 Sep 2017 00:31:57 +0800 Subject: [PATCH 014/197] add square blog post by roykachouh, retrofit post --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0f747a1ca1d..4169197dcf7 100644 --- a/README.md +++ b/README.md @@ -871,6 +871,8 @@ Presentations/Videos/Tutorials/Books - 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [Takuro Wada](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) - 2017/07/29 - [How Square makes its SDKs](https://medium.com/square-corner-blog/how-square-makes-its-sdks-6a0fd7ea4b2d) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna +- 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) +- 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) # Swagger Codegen Core Team From afb75d64d02c17c461f00f878826a8babe68c79a Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 10 Sep 2017 02:16:08 +0800 Subject: [PATCH 015/197] fix NPE in get swagger type (#6462) --- .../io/swagger/codegen/languages/AbstractCSharpCodegen.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index d45153dd521..bbd06e02421 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -555,6 +555,12 @@ public String toDefaultValue(Property p) { public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); String type; + + if (swaggerType == null) { + swaggerType = ""; // set swagger type to empty string if null + } + + // TODO avoid using toLowerCase as typeMapping should be case-sensitive if (typeMapping.containsKey(swaggerType.toLowerCase())) { type = typeMapping.get(swaggerType.toLowerCase()); if (languageSpecificPrimitives.contains(type)) { From 5b004de20da5394b5a1478304a13d2db5c5970aa Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Sep 2017 02:44:59 +0800 Subject: [PATCH 016/197] add R to the list of supported languages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4169197dcf7..e47d2480030 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ## Overview 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**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **Ruby**, **Rust**, **Scala**, **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) +- **API clients**: **ActionScript**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **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**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) From 665545a2b42410c7e476b14f1dbe3e2a1bdab694 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Sep 2017 03:08:00 +0800 Subject: [PATCH 017/197] add more links to presentations, blog posts, etc --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e47d2480030..cb90457c3d2 100644 --- a/README.md +++ b/README.md @@ -859,6 +859,9 @@ Presentations/Videos/Tutorials/Books - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from Shine Solutions @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) +- 2016/12/08 - [Generate client side code using Swagger Codegen](https://carra-lucia-ltd.co.uk/2016/12/08/generate-client-side-code-using-swagger-codegen/) by [theFerkel](https://carra-lucia-ltd.co.uk/author/theferkel/) +- 2017/01/16 - [Zero to API in 4 minutes](https://cidrblock.github.io/zero-to-api-in-4-minutes.html) by [Bradley A. Thornton](https://github.com/cidrblock) +- 2017/02/09 - [「Swaggerを利用した新規サービス開発」というタイトルで登壇して来ました](https://techblog.recochoku.jp/1055) by [recotech](https://www.slideshare.net/recotech) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) - 2017/04/13 - [Automatically Generating your API Client with Swagger and Swagger Codegen](https://www.youtube.com/watch?v=EzKwi-u9jQo) by [Jesse Collis](https://github.com/jessedc) @ Melbourne Cocoaheads From 753ba935f1af4656c3e5dcbf1c4cbf97e4256bad Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Sep 2017 03:15:12 +0800 Subject: [PATCH 018/197] add https://pycon.jp/2017/ja/ presentation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb90457c3d2..5728ff8b3ae 100644 --- a/README.md +++ b/README.md @@ -876,6 +876,7 @@ Presentations/Videos/Tutorials/Books - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) +- 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) # Swagger Codegen Core Team From f6787539c0169cccf1e50be90b3cbb201d8f42b2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Sep 2017 10:09:16 +0800 Subject: [PATCH 019/197] add more blog posts --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5728ff8b3ae..15d3cbd2556 100644 --- a/README.md +++ b/README.md @@ -855,6 +855,9 @@ Presentations/Videos/Tutorials/Books - 2016/01/15 - [How to end manual REST-API client coding](https://www.youtube.com/watch?v=RzZRdqZp6Oo) by [Johannes Fiala](https://github.com/jfiala) @ dotJS 2015 - 2016/04/27 - [Automated REST API Development](https://yos.io/2016/04/27/automated-api-development/) by [Yos Riady](https://www.linkedin.com/in/yosriady) - 2016/05/29 - [Generating Java Spring-MVC code from Swagger Spec](https://www.clianz.com/2016/05/29/java-mvc-swagger-gen/) by [@icha024](https://github.com/icha024) +- 2016/09/28 - [1 UNBELIEVABLE TRICK TO CREATE AN EASY TO CONSUME API IN .NET](https://stapp.space/1-simple-trick-to-create-a-good-api-in-net/) by [Piotr Stapp](https://stapp.space/author/piotr-stapp/) +- 2016/10/10 - [Using swagger-codegen with Marketo](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) by [Kenny Elkington](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) +- 2016/10/12 - [Designing a Swagger API](https://sookocheff.com/post/api/swagger/) by [Kevin Sookocheff](https://sookocheff.com/) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from Shine Solutions @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 From a6d6432e6da01e12167775d4d1c5945d88cc9a54 Mon Sep 17 00:00:00 2001 From: Lance Hannestad Date: Sun, 10 Sep 2017 19:23:38 -0700 Subject: [PATCH 020/197] [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) (#6463) * [Python][Flask] Upgraded connxion to 1.1.15 (now supports multi collection format arrays) * Was modified by ./bin/python-petstore.sh --- .../src/main/resources/flaskConnexion/requirements.mustache | 2 +- samples/client/petstore/python/petstore_api/rest.py | 2 +- samples/server/petstore/flaskConnexion/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache index 30ec45ba153..04042d4b1d4 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache @@ -1,4 +1,4 @@ -connexion == 1.1.9 +connexion == 1.1.15 python_dateutil == 2.6.0 {{#supportPython2}} typing == 3.5.2.2 diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 727c9424114..e7e38352886 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -141,7 +141,7 @@ def request(self, method, url, query_params=None, headers=None, url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): request_body = None - if body: + if body is not None: request_body = json.dumps(body) r = self.pool_manager.request(method, url, body=request_body, diff --git a/samples/server/petstore/flaskConnexion/requirements.txt b/samples/server/petstore/flaskConnexion/requirements.txt index 80359d3357e..1cf2462510b 100644 --- a/samples/server/petstore/flaskConnexion/requirements.txt +++ b/samples/server/petstore/flaskConnexion/requirements.txt @@ -1,3 +1,3 @@ -connexion == 1.1.9 +connexion == 1.1.15 python_dateutil == 2.6.0 setuptools >= 21.0.0 From 9e0911b3765f59719e7b4838986631af6a251842 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Sep 2017 17:39:12 +0800 Subject: [PATCH 021/197] [ObjC] fix NPE when getting swagger type (#6465) * fix npe in swagger type (objc) * remove trailing spaces --- .../codegen/languages/ObjcClientCodegen.java | 24 ++++++++++++------- .../core-data/SwaggerClient/Api/SWGPetApi.h | 10 ++++---- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 2 +- .../core-data/SwaggerClient/Api/SWGUserApi.h | 12 +++++----- .../default/SwaggerClient/Api/SWGPetApi.h | 10 ++++---- .../default/SwaggerClient/Api/SWGStoreApi.h | 2 +- .../default/SwaggerClient/Api/SWGUserApi.h | 12 +++++----- .../petstore/objc/default/docs/SWGStoreApi.md | 2 +- 8 files changed, 40 insertions(+), 34 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java index 2378489bc06..e13208951d1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ObjcClientCodegen.java @@ -24,7 +24,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String GIT_REPO_URL = "gitRepoURL"; public static final String DEFAULT_LICENSE = "Proprietary"; public static final String CORE_DATA = "coreData"; - + protected Set foundationClasses = new HashSet(); protected String podName = "SwaggerClient"; protected String podVersion = "1.0.0"; @@ -41,7 +41,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { protected String apiFilesPath = "Api/"; protected boolean generateCoreData = false; - + protected Set advancedMapingTypes = new HashSet(); public ObjcClientCodegen() { @@ -255,7 +255,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("Object-body.mustache", coreFileFolder(), classPrefix + "Object.m")); supportingFiles.add(new SupportingFile("QueryParamCollection-header.mustache", coreFileFolder(), classPrefix + "QueryParamCollection.h")); supportingFiles.add(new SupportingFile("QueryParamCollection-body.mustache", coreFileFolder(), classPrefix + "QueryParamCollection.m")); - supportingFiles.add(new SupportingFile("ApiClient-header.mustache", coreFileFolder(), classPrefix + "ApiClient.h")); + supportingFiles.add(new SupportingFile("ApiClient-header.mustache", coreFileFolder(), classPrefix + "ApiClient.h")); supportingFiles.add(new SupportingFile("ApiClient-body.mustache", coreFileFolder(), classPrefix + "ApiClient.m")); supportingFiles.add(new SupportingFile("JSONRequestSerializer-body.mustache", coreFileFolder(), classPrefix + "JSONRequestSerializer.m")); supportingFiles.add(new SupportingFile("JSONRequestSerializer-header.mustache", coreFileFolder(), classPrefix + "JSONRequestSerializer.h")); @@ -308,6 +308,12 @@ public String getTypeDeclaration(String name) { public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); String type = null; + + if (swaggerType == null) { + swaggerType = ""; // set swagger type to empty string if null + } + + // TODO avoid using toLowerCase as typeMapping should be case-sensitive if (typeMapping.containsKey(swaggerType.toLowerCase())) { type = typeMapping.get(swaggerType.toLowerCase()); if (languageSpecificPrimitives.contains(type) && !foundationClasses.contains(type)) { @@ -348,7 +354,7 @@ public String getTypeDeclaration(Property p) { Property inner = mp.getAdditionalProperties(); String innerTypeDeclaration = getTypeDeclaration(inner); - + if (innerTypeDeclaration.endsWith("*")) { innerTypeDeclaration = innerTypeDeclaration.substring(0, innerTypeDeclaration.length() - 1); } @@ -464,17 +470,17 @@ public String toModelImport(String name) { public String apiDocFileFolder() { return (outputFolder + "/" + apiDocPath).replace("/", File.separator); } - + @Override public String modelDocFileFolder() { return (outputFolder + "/" + modelDocPath).replace("/", File.separator); } - + @Override public String toModelDocFilename(String name) { return toModelName(name); } - + @Override public String toApiDocFilename(String name) { return toApiName(name); @@ -544,9 +550,9 @@ public String toParamName(String name) { * those terms here. This logic is only called if a variable matches the reserved words * * @return the escaped term - */ + */ @Override - public String escapeReservedWord(String name) { + public String escapeReservedWord(String name) { if(this.reservedWordsMappings().containsKey(name)) { return this.reservedWordsMappings().get(name); } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 74ba6e6b482..2764ca12956 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -30,7 +30,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:405 message:"Invalid input" /// -/// @return +/// @return void -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -43,7 +43,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:400 message:"Invalid pet value" /// -/// @return +/// @return void -(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; @@ -98,7 +98,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// -/// @return +/// @return void -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -112,7 +112,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:405 message:"Invalid input" /// -/// @return +/// @return void -(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status @@ -128,7 +128,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index 6cfc765cd0b..b7289e68f14 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -31,7 +31,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" /// -/// @return +/// @return void -(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 9695c16918b..02ef99a19a6 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -30,7 +30,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; @@ -42,7 +42,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -67,7 +67,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" /// -/// @return +/// @return void -(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; @@ -107,7 +107,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; @@ -121,7 +121,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// -/// @return +/// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 74ba6e6b482..2764ca12956 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -30,7 +30,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:405 message:"Invalid input" /// -/// @return +/// @return void -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -43,7 +43,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:400 message:"Invalid pet value" /// -/// @return +/// @return void -(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId apiKey: (NSString*) apiKey completionHandler: (void (^)(NSError* error)) handler; @@ -98,7 +98,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// -/// @return +/// @return void -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -112,7 +112,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:405 message:"Invalid input" /// -/// @return +/// @return void -(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId name: (NSString*) name status: (NSString*) status @@ -128,7 +128,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index 6cfc765cd0b..b7289e68f14 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -31,7 +31,7 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:400 message:"Invalid ID supplied", /// code:404 message:"Order not found" /// -/// @return +/// @return void -(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 9695c16918b..02ef99a19a6 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -30,7 +30,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; @@ -42,7 +42,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -54,7 +54,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -67,7 +67,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid username supplied", /// code:404 message:"User not found" /// -/// @return +/// @return void -(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username completionHandler: (void (^)(NSError* error)) handler; @@ -107,7 +107,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// /// code:0 message:"successful operation" /// -/// @return +/// @return void -(NSURLSessionTask*) logoutUserWithCompletionHandler: (void (^)(NSError* error)) handler; @@ -121,7 +121,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// -/// @return +/// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 2fc6c81ec75..83e22f3b42e 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -97,7 +97,7 @@ This endpoint does not need any parameter. ### Return type -[**NSDictionary***](NSDictionary.md) +**NSDictionary*** ### Authorization From 591149bcb7553d9163d1b60813062e8c7f9e3dd8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 12 Sep 2017 11:41:14 +0800 Subject: [PATCH 022/197] Better logic to handle tags with special characters (#6466) * better logic to handle tag with special characters * update test cases * comment out swift test cases * restore the swift tests --- .../io/swagger/codegen/DefaultCodegen.java | 20 +- .../java/io/swagger/codegen/CodegenTest.java | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 23 ++ .../petstore/php/SwaggerClient-php/README.md | 11 +- .../docs/Api/AnotherFakeApi.md | 54 +++ ...gs123Api.md => FakeClassnameTags123Api.md} | 8 +- .../lib/Api/AnotherFakeApi.php | 309 ++++++++++++++++++ ...123Api.php => FakeClassnameTags123Api.php} | 6 +- .../test/Api/AnotherFakeApiTest.php | 83 +++++ ...st.php => FakeClassnameTags123ApiTest.php} | 13 +- samples/client/petstore/python/README.md | 10 +- .../petstore/python/docs/AnotherFakeApi.md | 57 ++++ .../petstore/python/petstore_api/__init__.py | 1 + .../python/petstore_api/apis/__init__.py | 1 + .../petstore_api/apis/another_fake_api.py | 134 ++++++++ .../python/test/test_another_fake_api.py | 44 +++ 16 files changed, 736 insertions(+), 40 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md rename samples/client/petstore/php/SwaggerClient-php/docs/Api/{Fake_classname_tags123Api.md => FakeClassnameTags123Api.md} (79%) create mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php rename samples/client/petstore/php/SwaggerClient-php/lib/Api/{Fake_classname_tags123Api.php => FakeClassnameTags123Api.php} (98%) create mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Api/AnotherFakeApiTest.php rename samples/client/petstore/php/SwaggerClient-php/test/Api/{Fake_classname_tags123ApiTest.php => FakeClassnameTags123ApiTest.php} (89%) create mode 100644 samples/client/petstore/python/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/python/petstore_api/apis/another_fake_api.py create mode 100644 samples/client/petstore/python/test/test_another_fake_api.py 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 79d98451d51..61a4dc1ba61 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 @@ -3498,20 +3498,14 @@ public String sanitizeName(String name) { * @return Sanitized tag */ public String sanitizeTag(String tag) { - // remove spaces and make strong case - String[] parts = tag.split(" "); - StringBuilder buf = new StringBuilder(); - for (String part : parts) { - if (StringUtils.isNotEmpty(part)) { - buf.append(StringUtils.capitalize(part)); - } - } - String returnTag = buf.toString().replaceAll("[^a-zA-Z0-9_]", ""); - if (returnTag.matches("\\d.*")) { - return "_" + returnTag; - } else { - return returnTag; + tag = camelize(sanitizeName(tag)); + + // tag starts with numbers + if (tag.matches("^\\d.*")) { + tag = "_" + tag; } + + return tag; } /** diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index e899e1800dd..ef54ec0fc79 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -18,7 +18,7 @@ public void sanitizeTagTest() { final DefaultCodegen codegen = new DefaultCodegen(); Assert.assertEquals(codegen.sanitizeTag("foo"), "Foo"); Assert.assertEquals(codegen.sanitizeTag("foo bar"), "FooBar"); - Assert.assertEquals(codegen.sanitizeTag("foo_bar"), "Foo_bar"); + Assert.assertEquals(codegen.sanitizeTag("foo_bar"), "FooBar"); Assert.assertEquals(codegen.sanitizeTag("foo1 bar2"), "Foo1Bar2"); Assert.assertEquals(codegen.sanitizeTag("foo bar 1"), "FooBar1"); Assert.assertEquals(codegen.sanitizeTag("1foo"), "_1foo"); diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 3aeec9ea4ad..19db9dcbf51 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -898,6 +898,29 @@ paths: responses: '200': description: successful operation + /another-fake/dummy: + patch: + tags: + - "$another-fake?" + summary: To test special tags + description: To test special tags + operationId: test_special_tags + consumes: + - application/json + produces: + - application/json + parameters: + - in: body + name: body + description: client model + required: true + schema: + $ref: '#/definitions/Client' + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Client' securityDefinitions: petstore_auth: type: oauth2 diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index c033e2bc601..83b6d6e01a1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -56,14 +56,14 @@ Please follow the [installation procedure](#installation--usage) and then run th fakeOuterBooleanSerialize($body); + $result = $api_instance->testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -75,6 +75,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -83,7 +84,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*Fake_classname_tags123Api* | [**testClassname**](docs/Api/Fake_classname_tags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md new file mode 100644 index 00000000000..5b443618999 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# Swagger\Client\AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + +# **testSpecialTags** +> \Swagger\Client\Model\Client testSpecialTags($body) + +To test special tags + +To test special tags + +### Example +```php +testSpecialTags($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model | + +### Return type + +[**\Swagger\Client\Model\Client**](../Model/Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md similarity index 79% rename from samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md rename to samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md index d5fe15b46fc..8f826708f0c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md @@ -1,10 +1,10 @@ -# Swagger\Client\Fake_classname_tags123Api +# Swagger\Client\FakeClassnameTags123Api All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case # **testClassname** @@ -22,14 +22,14 @@ Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key_quer // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key_query', 'Bearer'); -$api_instance = new Swagger\Client\Api\Fake_classname_tags123Api(new \Http\Adapter\Guzzle6\Client()); +$api_instance = new Swagger\Client\Api\FakeClassnameTags123Api(new \Http\Adapter\Guzzle6\Client()); $body = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model try { $result = $api_instance->testClassname($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling Fake_classname_tags123Api->testClassname: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FakeClassnameTags123Api->testClassname: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php new file mode 100644 index 00000000000..f50a1730338 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -0,0 +1,309 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation testSpecialTags + * + * To test special tags + * + * @param \Swagger\Client\Model\Client $body client model (required) + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Client + */ + public function testSpecialTags($body) + { + list($response) = $this->testSpecialTagsWithHttpInfo($body); + return $response; + } + + /** + * Operation testSpecialTagsWithHttpInfo + * + * To test special tags + * + * @param \Swagger\Client\Model\Client $body client model (required) + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) + */ + public function testSpecialTagsWithHttpInfo($body) + { + $returnType = '\Swagger\Client\Model\Client'; + $request = $this->testSpecialTagsRequest($body); + + try { + + try { + $response = $this->client->send($request); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + "[$statusCode] Error connecting to the API ({$request->getUri()})", + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation testSpecialTagsAsync + * + * To test special tags + * + * @param \Swagger\Client\Model\Client $body client model (required) + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testSpecialTagsAsync($body) + { + return $this->testSpecialTagsAsyncWithHttpInfo($body)->then(function ($response) { + return $response[0]; + }); + } + + /** + * Operation testSpecialTagsAsyncWithHttpInfo + * + * To test special tags + * + * @param \Swagger\Client\Model\Client $body client model (required) + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testSpecialTagsAsyncWithHttpInfo($body) + { + $returnType = '\Swagger\Client\Model\Client'; + $request = $this->testSpecialTagsRequest($body); + + return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + }); + } + + /** + * Create request for operation 'testSpecialTags' + * + * @param \Swagger\Client\Model\Client $body client model (required) + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testSpecialTagsRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException('Missing the required parameter $body when calling testSpecialTags'); + } + + $resourcePath = '/another-fake/dummy'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + } + } + + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + return new Request( + 'PATCH', + $url, + $headers, + $httpBody + ); + } + +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php similarity index 98% rename from samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php rename to samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index a6f2f939ecc..8ebf5fd83f3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -1,6 +1,6 @@ fake_outer_boolean_serialize: %s\n" % e) + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) ``` @@ -68,6 +69,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..b78fcf86f43 --- /dev/null +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **test_special_tags** +> Client test_special_tags(body) + +To test special tags + +To test special tags + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py index f045195c888..cad09e2691c 100644 --- a/samples/client/petstore/python/petstore_api/__init__.py +++ b/samples/client/petstore/python/petstore_api/__init__.py @@ -52,6 +52,7 @@ from .models.dog import Dog # import apis into sdk package +from .apis.another_fake_api import AnotherFakeApi from .apis.fake_api import FakeApi from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api from .apis.pet_api import PetApi diff --git a/samples/client/petstore/python/petstore_api/apis/__init__.py b/samples/client/petstore/python/petstore_api/apis/__init__.py index af71d636229..b4b975ca8e0 100644 --- a/samples/client/petstore/python/petstore_api/apis/__init__.py +++ b/samples/client/petstore/python/petstore_api/apis/__init__.py @@ -1,6 +1,7 @@ from __future__ import absolute_import # import apis into api package +from .another_fake_api import AnotherFakeApi from .fake_api import FakeApi from .fake_classname_tags_123_api import FakeClassnameTags123Api from .pet_api import PetApi diff --git a/samples/client/petstore/python/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python/petstore_api/apis/another_fake_api.py new file mode 100644 index 00000000000..8fb991ff3df --- /dev/null +++ b/samples/client/petstore/python/petstore_api/apis/another_fake_api.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class AnotherFakeApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_special_tags(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_special_tags_with_http_info(body, **kwargs) + else: + (data) = self.test_special_tags_with_http_info(body, **kwargs) + return data + + def test_special_tags_with_http_info(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_special_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/test/test_another_fake_api.py b/samples/client/petstore/python/test/test_another_fake_api.py new file mode 100644 index 00000000000..9f562fe1134 --- /dev/null +++ b/samples/client/petstore/python/test/test_another_fake_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.another_fake_api import AnotherFakeApi + + +class TestAnotherFakeApi(unittest.TestCase): + """ AnotherFakeApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.another_fake_api.AnotherFakeApi() + + def tearDown(self): + pass + + def test_test_special_tags(self): + """ + Test case for test_special_tags + + To test special tags + """ + pass + + +if __name__ == '__main__': + unittest.main() From d639b38d0ddcaeb17cc8bdaf446ebfb9c4597876 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 12 Sep 2017 14:17:29 +0800 Subject: [PATCH 023/197] fix link to fehguy twitter account --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15d3cbd2556..bce55d9819d 100644 --- a/README.md +++ b/README.md @@ -846,8 +846,8 @@ Here are some companies/projects using Swagger Codegen in production. To add you Presentations/Videos/Tutorials/Books ---------------------------------------- -- 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](twitter.com/fehguy) -- 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](twitter.com/fehguy) at [Gluecon](http://gluecon.com/) +- 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](https://twitter.com/fehguy) +- 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](https://twitter.com/fehguy) at [Gluecon](http://gluecon.com/) - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) From 8067612e06172942c5d661f0988bb866492d1cab Mon Sep 17 00:00:00 2001 From: ehyche Date: Mon, 11 Sep 2017 23:37:39 -0700 Subject: [PATCH 024/197] Handle when response is a file URL. (#6469) This is the equivalent change in the swift4 module which was made in the swift3 module in this PR: https://github.com/swagger-api/swagger-codegen/pull/6274 This updates AlamofireImplementations.mustache to handle when the response is an URL. It also makes changes in the generated sample code for: * default configuration (no promisekit or rxswift) * promisekit * rxswift Also, in order to build, the generated code needed to be updated with the change in CodableHelper which changes dataDecodingStrategy to ".base64" from its previous definition in earlier Xcode 9 betas. * --- .../swift4/AlamofireImplementations.mustache | 110 ++++++++++++++++++ .../Swaggers/AlamofireImplementations.swift | 110 ++++++++++++++++++ .../Classes/Swaggers/CodableHelper.swift | 4 +- .../Swaggers/AlamofireImplementations.swift | 110 ++++++++++++++++++ .../Classes/Swaggers/CodableHelper.swift | 4 +- .../Swaggers/AlamofireImplementations.swift | 110 ++++++++++++++++++ .../Classes/Swaggers/CodableHelper.swift | 4 +- 7 files changed, 446 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swift4/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift4/AlamofireImplementations.mustache index b9d2a2727de..0d294aee4ce 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/AlamofireImplementations.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/AlamofireImplementations.mustache @@ -142,6 +142,56 @@ open class AlamofireRequestBuilder: RequestBuilder { nil ) }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) case is Void.Type: validatedRequest.responseData(completionHandler: { (voidResponse) in cleanupRequest() @@ -191,6 +241,66 @@ open class AlamofireRequestBuilder: RequestBuilder { } return httpHeaders } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL } public enum AlamofireDecodableRequestBuilderError: Error { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index b9d2a2727de..0d294aee4ce 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -142,6 +142,56 @@ open class AlamofireRequestBuilder: RequestBuilder { nil ) }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) case is Void.Type: validatedRequest.responseData(completionHandler: { (voidResponse) in cleanupRequest() @@ -191,6 +241,66 @@ open class AlamofireRequestBuilder: RequestBuilder { } return httpHeaders } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL } public enum AlamofireDecodableRequestBuilderError: Error { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift index 4ae4ca267ac..d56cb0e7348 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/CodableHelper.swift @@ -16,7 +16,7 @@ open class CodableHelper { var returnedError: Error? = nil let decoder = JSONDecoder() - decoder.dataDecodingStrategy = .base64Decode + decoder.dataDecodingStrategy = .base64 if #available(iOS 10.0, *) { decoder.dateDecodingStrategy = .iso8601 } @@ -38,7 +38,7 @@ open class CodableHelper { if prettyPrint { encoder.outputFormatting = .prettyPrinted } - encoder.dataEncodingStrategy = .base64Encode + encoder.dataEncodingStrategy = .base64 if #available(iOS 10.0, *) { encoder.dateEncodingStrategy = .iso8601 } diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index b9d2a2727de..0d294aee4ce 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -142,6 +142,56 @@ open class AlamofireRequestBuilder: RequestBuilder { nil ) }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) case is Void.Type: validatedRequest.responseData(completionHandler: { (voidResponse) in cleanupRequest() @@ -191,6 +241,66 @@ open class AlamofireRequestBuilder: RequestBuilder { } return httpHeaders } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL } public enum AlamofireDecodableRequestBuilderError: Error { diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/CodableHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/CodableHelper.swift index 4ae4ca267ac..d56cb0e7348 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/CodableHelper.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/CodableHelper.swift @@ -16,7 +16,7 @@ open class CodableHelper { var returnedError: Error? = nil let decoder = JSONDecoder() - decoder.dataDecodingStrategy = .base64Decode + decoder.dataDecodingStrategy = .base64 if #available(iOS 10.0, *) { decoder.dateDecodingStrategy = .iso8601 } @@ -38,7 +38,7 @@ open class CodableHelper { if prettyPrint { encoder.outputFormatting = .prettyPrinted } - encoder.dataEncodingStrategy = .base64Encode + encoder.dataEncodingStrategy = .base64 if #available(iOS 10.0, *) { encoder.dateEncodingStrategy = .iso8601 } diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index b9d2a2727de..0d294aee4ce 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -142,6 +142,56 @@ open class AlamofireRequestBuilder: RequestBuilder { nil ) }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) case is Void.Type: validatedRequest.responseData(completionHandler: { (voidResponse) in cleanupRequest() @@ -191,6 +241,66 @@ open class AlamofireRequestBuilder: RequestBuilder { } return httpHeaders } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL } public enum AlamofireDecodableRequestBuilderError: Error { diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/CodableHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/CodableHelper.swift index 4ae4ca267ac..d56cb0e7348 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/CodableHelper.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/CodableHelper.swift @@ -16,7 +16,7 @@ open class CodableHelper { var returnedError: Error? = nil let decoder = JSONDecoder() - decoder.dataDecodingStrategy = .base64Decode + decoder.dataDecodingStrategy = .base64 if #available(iOS 10.0, *) { decoder.dateDecodingStrategy = .iso8601 } @@ -38,7 +38,7 @@ open class CodableHelper { if prettyPrint { encoder.outputFormatting = .prettyPrinted } - encoder.dataEncodingStrategy = .base64Encode + encoder.dataEncodingStrategy = .base64 if #available(iOS 10.0, *) { encoder.dateEncodingStrategy = .iso8601 } From b807f6ff968085b78ffb5ded1dd9a174c9abc68c Mon Sep 17 00:00:00 2001 From: ehyche Date: Mon, 18 Sep 2017 13:04:50 -0400 Subject: [PATCH 025/197] Support object schemas with only additionalProperties. (#6492) Previously, we had implemented the Codable protocol by simply claiming conformance, and making sure that each of our internal classes also implemented the Codable protocol. So our model classes looked like: class MyModel: Codable { var propInt: Int var propString: String } class MyOtherModel: Codable { var propModel: MyModel } Previously, our additionalProperties implementation would have meant an object schema with an additionalProperties of Int type would have looked like: class MyModelWithAdditionalProperties: Codable { var additionalProperties: [String: Int] } But the default implementation of Codable would have serialized MyModelWithAdditionalProperties like this: { "additionalProperties": { "myInt1": 1, "myInt2": 2, "myInt3": 3 } } The default implementation would put the additionalProperties in its own dictionary (which would be incorrect), as opposed to the desired serialization of: { "myInt1": 1, "myInt2": 2, "myInt3": 3 } So therefore, the only way to support this was to do our own implementation of the Codable protocol. The Codable protocol is actually two protocols: Encodable and Decodable. So therefore, this change generates implementations of Encodable and Decodable for each generated model class. So the new generated classes look like: class MyModel: Codable { var propInt: Int var propString: String // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propInt, forKey: "propInt") try container.encode(propString, forKey: "propString") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propInt = try container.decode(Int.self, forKey: "propInt") propString = try container.decode(String.self, forKey: "propString") } } class MyOtherModel: Codable { var propModel: MyModel // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(propModel, forKey: "propModel") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) propModel = try container.decode(MyModel.self, forKey: "propModel") } } --- .../main/resources/swift4/Extensions.mustache | 86 ++++++++ .../src/main/resources/swift4/model.mustache | 55 +++-- .../src/test/resources/2_0/swift4Test.json | 66 ++++++ .../test/swift4/default/TestClient.podspec | 4 +- .../Classes/Swaggers/APIs/Swift4TestAPI.swift | 85 +++++--- .../Classes/Swaggers/CodableHelper.swift | 4 +- .../Classes/Swaggers/Extensions.swift | 86 ++++++++ .../Swaggers/Models/AllPrimitives.swift | 87 +++++--- .../Classes/Swaggers/Models/ErrorInfo.swift | 24 ++- .../Swaggers/Models/GetAllModelsResult.swift | 24 ++- ...ModelWithIntAdditionalPropertiesOnly.swift | 49 +++++ ...ithPropertiesAndAdditionalProperties.swift | 81 +++++++ ...elWithStringAdditionalPropertiesOnly.swift | 49 +++++ .../Swaggers/Models/VariableNameTest.swift | 21 +- .../swift4/default/TestClientApp/Podfile.lock | 8 +- .../TestClientApp/Pods/Alamofire/LICENSE | 2 +- .../TestClientApp/Pods/Alamofire/README.md | 25 ++- .../Pods/Alamofire/Source/AFError.swift | 2 +- .../Pods/Alamofire/Source/Alamofire.swift | 2 +- .../Source/DispatchQueue+Alamofire.swift | 2 +- .../Alamofire/Source/MultipartFormData.swift | 2 +- .../Source/NetworkReachabilityManager.swift | 2 +- .../Pods/Alamofire/Source/Notifications.swift | 2 +- .../Alamofire/Source/ParameterEncoding.swift | 10 +- .../Pods/Alamofire/Source/Request.swift | 14 +- .../Pods/Alamofire/Source/Response.swift | 2 +- .../Source/ResponseSerialization.swift | 2 +- .../Pods/Alamofire/Source/Result.swift | 2 +- .../Alamofire/Source/ServerTrustPolicy.swift | 2 +- .../Alamofire/Source/SessionDelegate.swift | 2 +- .../Alamofire/Source/SessionManager.swift | 10 +- .../Pods/Alamofire/Source/TaskDelegate.swift | 19 +- .../Pods/Alamofire/Source/Timeline.swift | 2 +- .../Pods/Alamofire/Source/Validation.swift | 8 +- .../Local Podspecs/TestClient.podspec.json | 4 +- .../default/TestClientApp/Pods/Manifest.lock | 8 +- .../Pods/Pods.xcodeproj/project.pbxproj | 202 ++++++++++-------- .../Target Support Files/Alamofire/Info.plist | 2 +- ...ds-TestClientApp-acknowledgements.markdown | 2 +- .../Pods-TestClientApp-acknowledgements.plist | 2 +- 40 files changed, 814 insertions(+), 247 deletions(-) create mode 100644 samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift create mode 100644 samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift create mode 100644 samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift diff --git a/modules/swagger-codegen/src/main/resources/swift4/Extensions.mustache b/modules/swagger-codegen/src/main/resources/swift4/Extensions.mustache index 19a3dd7364c..2dc10db2bc3 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/Extensions.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/Extensions.mustache @@ -85,6 +85,92 @@ extension UUID: JSONEncodable { } } +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + {{#usePromiseKit}}extension RequestBuilder { public func execute() -> Promise> { let deferred = Promise>.pending() diff --git a/modules/swagger-codegen/src/main/resources/swift4/model.mustache b/modules/swagger-codegen/src/main/resources/swift4/model.mustache index bce3ce5c07a..9dedcc85d39 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/model.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/model.mustache @@ -21,10 +21,7 @@ public enum {{classname}}: {{dataType}}, Codable { } {{/isEnum}} {{^isEnum}} -{{#vars.isEmpty}} -public typealias {{classname}} = {{dataType}} -{{/vars.isEmpty}} -{{^vars.isEmpty}} + open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{/parent}} { {{#vars}} @@ -37,11 +34,11 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{ {{#vars}} {{#isEnum}} {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{/isEnum}} {{^isEnum}} {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatype}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} + {{/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) }) @@ -51,19 +48,9 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{ {{/vars}} {{#additionalPropertiesType}} - public var additionalProperties: [AnyHashable:{{{additionalPropertiesType}}}] = [:] + public var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] -{{/additionalPropertiesType}} -{{^unwrapRequired}} - {{^parent}}public init() {}{{/parent}}{{/unwrapRequired}} -{{#unwrapRequired}} - public init({{#allVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{datatype}}{{/isEnum}}{{^required}}?=nil{{/required}}{{/allVars}}) { - {{#vars}} - self.{{name}} = {{name}} - {{/vars}} - }{{/unwrapRequired}} -{{#additionalPropertiesType}} - public subscript(key: AnyHashable) -> {{{additionalPropertiesType}}}? { + public subscript(key: String) -> {{{additionalPropertiesType}}}? { get { if let value = additionalProperties[key] { return value @@ -77,12 +64,38 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{ } {{/additionalPropertiesType}} - private enum CodingKeys: String, CodingKey { {{#vars}} - case {{{name}}} = "{{{baseName}}}"{{/vars}} + // Encodable protocol methods + + public {{#parent}}override {{/parent}}func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + {{#vars}} + try container.encode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}") + {{/vars}} + {{#additionalPropertiesType}} + try container.encodeMap(additionalProperties) + {{/additionalPropertiesType}} } + // Decodable protocol methods + + public {{#parent}}override {{/parent}}required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + {{#vars}} + {{name}} = try container.decode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{#isListContainer}}{{{items.datatype}}}{{/isListContainer}}{{^isListContainer}}{{{datatype}}}{{/isListContainer}}.self, forKey: "{{{baseName}}}") + {{/vars}} + {{#additionalPropertiesType}} + var nonAdditionalPropertyKeys = Set() + {{#vars}} + nonAdditionalPropertyKeys.insert("{{{baseName}}}") + {{/vars}} + additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) + {{/additionalPropertiesType}} + } } -{{/vars.isEmpty}} + {{/isEnum}} {{/isArrayModel}} {{/model}} diff --git a/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json b/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json index d8533c3d7dd..cb13dfccb99 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json +++ b/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json @@ -274,6 +274,72 @@ } }, "description": "Response object containing AllPrimitives object" + }, + "ModelWithStringAdditionalPropertiesOnly": { + "description": "This is an empty model with no properties and only additionalProperties of type string", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "ModelWithIntAdditionalPropertiesOnly": { + "description": "This is an empty model with no properties and only additionalProperties of type int32", + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" + } + }, + "ModelWithPropertiesAndAdditionalProperties": { + "description": "This is an empty model with no properties and only additionalProperties of type int32", + "type": "object", + "required": [ + "myIntegerReq", + "myPrimitiveReq", + "myStringArrayReq", + "myPrimitiveArrayReq" + ], + "properties": { + "myIntegerReq": { + "type": "integer" + }, + "myIntegerOpt": { + "type": "integer" + }, + "myPrimitiveReq": { + "$ref": "#/definitions/AllPrimitives" + }, + "myPrimitiveOpt": { + "$ref": "#/definitions/AllPrimitives" + }, + "myStringArrayReq": { + "type": "array", + "items": { + "type": "string" + } + }, + "myStringArrayOpt": { + "type": "array", + "items": { + "type": "string" + } + }, + "myPrimitiveArrayReq": { + "type": "array", + "items": { + "$ref": "#/definitions/AllPrimitives" + } + }, + "myPrimitiveArrayOpt": { + "type": "array", + "items": { + "$ref": "#/definitions/AllPrimitives" + } + } + }, + "additionalProperties": { + "type": "string" + } } } } diff --git a/samples/client/test/swift4/default/TestClient.podspec b/samples/client/test/swift4/default/TestClient.podspec index d43a43c7a3c..046d936c1d7 100644 --- a/samples/client/test/swift4/default/TestClient.podspec +++ b/samples/client/test/swift4/default/TestClient.podspec @@ -8,6 +8,6 @@ Pod::Spec.new do |s| s.license = 'Proprietary' s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'TestClient' - s.source_files = 'TestClient/Classes/Swaggers/**/*.swift' - s.dependency 'Alamofire', '~> 4.5' + s.source_files = 'TestClient/Classes/**/*.swift' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift index c1f5188dce1..1ea35e3db1f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift @@ -30,60 +30,85 @@ open class Swift4TestAPI { - This endpoint tests get a dictionary which contains examples of all of the models. - examples: [{contentType=application/json, example={ "myPrimitive" : { - "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00" ], - "myStringArray" : [ "aeiou" ], + "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], + "myStringArray" : [ "myStringArray", "myStringArray" ], "myFile" : "", - "myFloatArray" : [ 2.302136 ], - "myBytes" : "aeiou", + "myFloatArray" : [ 2.302136, 2.302136 ], + "myBytes" : "myBytes", "myLong" : 1, - "myBooleanArray" : [ true ], - "myDoubleArray" : [ 9.301444243932576 ], + "myBooleanArray" : [ true, true ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], "myInteger" : 0, - "myString" : "aeiou", - "myBytesArray" : [ "aeiou" ], + "myString" : "myString", + "myBytesArray" : [ "myBytesArray", "myBytesArray" ], "myDouble" : 7.061401241503109, "myDate" : "2000-01-23", - "myDateArray" : [ "2000-01-23" ], + "myDateArray" : [ "2000-01-23", "2000-01-23" ], "myDateTime" : "2000-01-23T04:56:07.000+00:00", - "myLongArray" : [ 5 ], - "myIntegerArray" : [ 6 ], + "myLongArray" : [ 5, 5 ], + "myIntegerArray" : [ 6, 6 ], "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "myBoolean" : true, - "myFileArray" : [ "" ], + "myFileArray" : [ "", "" ], "myStringEnum" : { }, "myFloat" : 5.637377, - "myStringEnumArray" : [ null ], - "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] + "myStringEnumArray" : [ null, null ], + "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] }, "myVariableNameTest" : { - "for" : "aeiou", - "example_name" : "aeiou" + "for" : "for", + "example_name" : "example_name" }, "myPrimitiveArray" : [ { - "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00" ], - "myStringArray" : [ "aeiou" ], + "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], + "myStringArray" : [ "myStringArray", "myStringArray" ], "myFile" : "", - "myFloatArray" : [ 2.302136 ], - "myBytes" : "aeiou", + "myFloatArray" : [ 2.302136, 2.302136 ], + "myBytes" : "myBytes", "myLong" : 1, - "myBooleanArray" : [ true ], - "myDoubleArray" : [ 9.301444243932576 ], + "myBooleanArray" : [ true, true ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], "myInteger" : 0, - "myString" : "aeiou", - "myBytesArray" : [ "aeiou" ], + "myString" : "myString", + "myBytesArray" : [ "myBytesArray", "myBytesArray" ], "myDouble" : 7.061401241503109, "myDate" : "2000-01-23", - "myDateArray" : [ "2000-01-23" ], + "myDateArray" : [ "2000-01-23", "2000-01-23" ], "myDateTime" : "2000-01-23T04:56:07.000+00:00", - "myLongArray" : [ 5 ], - "myIntegerArray" : [ 6 ], + "myLongArray" : [ 5, 5 ], + "myIntegerArray" : [ 6, 6 ], "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "myBoolean" : true, - "myFileArray" : [ "" ], + "myFileArray" : [ "", "" ], "myStringEnum" : { }, "myFloat" : 5.637377, - "myStringEnumArray" : [ null ], - "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] + "myStringEnumArray" : [ null, null ], + "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] + }, { + "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], + "myStringArray" : [ "myStringArray", "myStringArray" ], + "myFile" : "", + "myFloatArray" : [ 2.302136, 2.302136 ], + "myBytes" : "myBytes", + "myLong" : 1, + "myBooleanArray" : [ true, true ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], + "myInteger" : 0, + "myString" : "myString", + "myBytesArray" : [ "myBytesArray", "myBytesArray" ], + "myDouble" : 7.061401241503109, + "myDate" : "2000-01-23", + "myDateArray" : [ "2000-01-23", "2000-01-23" ], + "myDateTime" : "2000-01-23T04:56:07.000+00:00", + "myLongArray" : [ 5, 5 ], + "myIntegerArray" : [ 6, 6 ], + "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", + "myBoolean" : true, + "myFileArray" : [ "", "" ], + "myStringEnum" : { }, + "myFloat" : 5.637377, + "myStringEnumArray" : [ null, null ], + "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] } ] }}] diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/CodableHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/CodableHelper.swift index 4ae4ca267ac..d56cb0e7348 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/CodableHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/CodableHelper.swift @@ -16,7 +16,7 @@ open class CodableHelper { var returnedError: Error? = nil let decoder = JSONDecoder() - decoder.dataDecodingStrategy = .base64Decode + decoder.dataDecodingStrategy = .base64 if #available(iOS 10.0, *) { decoder.dateDecodingStrategy = .iso8601 } @@ -38,7 +38,7 @@ open class CodableHelper { if prettyPrint { encoder.outputFormatting = .prettyPrinted } - encoder.dataEncodingStrategy = .base64Encode + encoder.dataEncodingStrategy = .base64 if #available(iOS 10.0, *) { encoder.dateEncodingStrategy = .iso8601 } diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Extensions.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Extensions.swift index 202b47449d8..9cac90e08d4 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Extensions.swift @@ -84,4 +84,90 @@ extension UUID: JSONEncodable { } } +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift index 37fabea3cf4..6d0bf4eca18 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift @@ -9,6 +9,7 @@ import Foundation /** Object which contains lots of different primitive Swagger types */ + open class AllPrimitives: Codable { public var myInteger: Int? @@ -36,34 +37,68 @@ open class AllPrimitives: Codable { public var myStringEnum: StringEnum? public var myStringEnumArray: [StringEnum]? - public init() {} + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case myInteger = "myInteger" - case myIntegerArray = "myIntegerArray" - case myLong = "myLong" - case myLongArray = "myLongArray" - case myFloat = "myFloat" - case myFloatArray = "myFloatArray" - case myDouble = "myDouble" - case myDoubleArray = "myDoubleArray" - case myString = "myString" - case myStringArray = "myStringArray" - case myBytes = "myBytes" - case myBytesArray = "myBytesArray" - case myBoolean = "myBoolean" - case myBooleanArray = "myBooleanArray" - case myDate = "myDate" - case myDateArray = "myDateArray" - case myDateTime = "myDateTime" - case myDateTimeArray = "myDateTimeArray" - case myFile = "myFile" - case myFileArray = "myFileArray" - case myUUID = "myUUID" - case myUUIDArray = "myUUIDArray" - case myStringEnum = "myStringEnum" - case myStringEnumArray = "myStringEnumArray" + try container.encodeIfPresent(myInteger, forKey: "myInteger") + try container.encodeArrayIfPresent(myIntegerArray, forKey: "myIntegerArray") + try container.encodeIfPresent(myLong, forKey: "myLong") + try container.encodeArrayIfPresent(myLongArray, forKey: "myLongArray") + try container.encodeIfPresent(myFloat, forKey: "myFloat") + try container.encodeArrayIfPresent(myFloatArray, forKey: "myFloatArray") + try container.encodeIfPresent(myDouble, forKey: "myDouble") + try container.encodeArrayIfPresent(myDoubleArray, forKey: "myDoubleArray") + try container.encodeIfPresent(myString, forKey: "myString") + try container.encodeArrayIfPresent(myStringArray, forKey: "myStringArray") + try container.encodeIfPresent(myBytes, forKey: "myBytes") + try container.encodeArrayIfPresent(myBytesArray, forKey: "myBytesArray") + try container.encodeIfPresent(myBoolean, forKey: "myBoolean") + try container.encodeArrayIfPresent(myBooleanArray, forKey: "myBooleanArray") + try container.encodeIfPresent(myDate, forKey: "myDate") + try container.encodeArrayIfPresent(myDateArray, forKey: "myDateArray") + try container.encodeIfPresent(myDateTime, forKey: "myDateTime") + try container.encodeArrayIfPresent(myDateTimeArray, forKey: "myDateTimeArray") + try container.encodeIfPresent(myFile, forKey: "myFile") + try container.encodeArrayIfPresent(myFileArray, forKey: "myFileArray") + try container.encodeIfPresent(myUUID, forKey: "myUUID") + try container.encodeArrayIfPresent(myUUIDArray, forKey: "myUUIDArray") + try container.encodeIfPresent(myStringEnum, forKey: "myStringEnum") + try container.encodeArrayIfPresent(myStringEnumArray, forKey: "myStringEnumArray") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myInteger = try container.decodeIfPresent(Int.self, forKey: "myInteger") + myIntegerArray = try container.decodeArrayIfPresent(Int.self, forKey: "myIntegerArray") + myLong = try container.decodeIfPresent(Int64.self, forKey: "myLong") + myLongArray = try container.decodeArrayIfPresent(Int64.self, forKey: "myLongArray") + myFloat = try container.decodeIfPresent(Float.self, forKey: "myFloat") + myFloatArray = try container.decodeArrayIfPresent(Float.self, forKey: "myFloatArray") + myDouble = try container.decodeIfPresent(Double.self, forKey: "myDouble") + myDoubleArray = try container.decodeArrayIfPresent(Double.self, forKey: "myDoubleArray") + myString = try container.decodeIfPresent(String.self, forKey: "myString") + myStringArray = try container.decodeArrayIfPresent(String.self, forKey: "myStringArray") + myBytes = try container.decodeIfPresent(Data.self, forKey: "myBytes") + myBytesArray = try container.decodeArrayIfPresent(Data.self, forKey: "myBytesArray") + myBoolean = try container.decodeIfPresent(Bool.self, forKey: "myBoolean") + myBooleanArray = try container.decodeArrayIfPresent(Bool.self, forKey: "myBooleanArray") + myDate = try container.decodeIfPresent(Date.self, forKey: "myDate") + myDateArray = try container.decodeArrayIfPresent(Date.self, forKey: "myDateArray") + myDateTime = try container.decodeIfPresent(Date.self, forKey: "myDateTime") + myDateTimeArray = try container.decodeArrayIfPresent(Date.self, forKey: "myDateTimeArray") + myFile = try container.decodeIfPresent(URL.self, forKey: "myFile") + myFileArray = try container.decodeArrayIfPresent(URL.self, forKey: "myFileArray") + myUUID = try container.decodeIfPresent(UUID.self, forKey: "myUUID") + myUUIDArray = try container.decodeArrayIfPresent(UUID.self, forKey: "myUUIDArray") + myStringEnum = try container.decodeIfPresent(StringEnum.self, forKey: "myStringEnum") + myStringEnumArray = try container.decodeArrayIfPresent(StringEnum.self, forKey: "myStringEnumArray") + } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift index 660654a1543..b4713b4c23d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift @@ -9,19 +9,33 @@ import Foundation /** Example Error object */ + open class ErrorInfo: Codable { public var code: Int? public var message: String? public var details: [String]? - public init() {} + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case code = "code" - case message = "message" - case details = "details" + try container.encodeIfPresent(code, forKey: "code") + try container.encodeIfPresent(message, forKey: "message") + try container.encodeArrayIfPresent(details, forKey: "details") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + code = try container.decodeIfPresent(Int.self, forKey: "code") + message = try container.decodeIfPresent(String.self, forKey: "message") + details = try container.decodeArrayIfPresent(String.self, forKey: "details") + } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift index 48cabc5b319..6cb8e4ce7d7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift @@ -9,19 +9,33 @@ import Foundation /** Response object containing AllPrimitives object */ + open class GetAllModelsResult: Codable { public var myPrimitiveArray: [AllPrimitives]? public var myPrimitive: AllPrimitives? public var myVariableNameTest: VariableNameTest? - public init() {} + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case myPrimitiveArray = "myPrimitiveArray" - case myPrimitive = "myPrimitive" - case myVariableNameTest = "myVariableNameTest" + try container.encodeArrayIfPresent(myPrimitiveArray, forKey: "myPrimitiveArray") + try container.encodeIfPresent(myPrimitive, forKey: "myPrimitive") + try container.encodeIfPresent(myVariableNameTest, forKey: "myVariableNameTest") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myPrimitiveArray = try container.decodeArrayIfPresent(AllPrimitives.self, forKey: "myPrimitiveArray") + myPrimitive = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitive") + myVariableNameTest = try container.decodeIfPresent(VariableNameTest.self, forKey: "myVariableNameTest") + } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift new file mode 100644 index 00000000000..c258745d8e9 --- /dev/null +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -0,0 +1,49 @@ +// +// ModelWithIntAdditionalPropertiesOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** This is an empty model with no properties and only additionalProperties of type int32 */ + +open class ModelWithIntAdditionalPropertiesOnly: Codable { + + + public var additionalProperties: [String:Int] = [:] + + public subscript(key: String) -> Int? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeMap(additionalProperties) + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + var nonAdditionalPropertyKeys = Set() + additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) + } +} + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift new file mode 100644 index 00000000000..f4aae6cc5e0 --- /dev/null +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -0,0 +1,81 @@ +// +// ModelWithPropertiesAndAdditionalProperties.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** This is an empty model with no properties and only additionalProperties of type int32 */ + +open class ModelWithPropertiesAndAdditionalProperties: Codable { + + public var myIntegerReq: Int + public var myIntegerOpt: Int? + public var myPrimitiveReq: AllPrimitives + public var myPrimitiveOpt: AllPrimitives? + public var myStringArrayReq: [String] + public var myStringArrayOpt: [String]? + public var myPrimitiveArrayReq: [AllPrimitives] + public var myPrimitiveArrayOpt: [AllPrimitives]? + + public var additionalProperties: [String:String] = [:] + + public subscript(key: String) -> String? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encode(myIntegerReq, forKey: "myIntegerReq") + try container.encodeIfPresent(myIntegerOpt, forKey: "myIntegerOpt") + try container.encode(myPrimitiveReq, forKey: "myPrimitiveReq") + try container.encodeIfPresent(myPrimitiveOpt, forKey: "myPrimitiveOpt") + try container.encodeArray(myStringArrayReq, forKey: "myStringArrayReq") + try container.encodeArrayIfPresent(myStringArrayOpt, forKey: "myStringArrayOpt") + try container.encodeArray(myPrimitiveArrayReq, forKey: "myPrimitiveArrayReq") + try container.encodeArrayIfPresent(myPrimitiveArrayOpt, forKey: "myPrimitiveArrayOpt") + try container.encodeMap(additionalProperties) + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myIntegerReq = try container.decode(Int.self, forKey: "myIntegerReq") + myIntegerOpt = try container.decodeIfPresent(Int.self, forKey: "myIntegerOpt") + myPrimitiveReq = try container.decode(AllPrimitives.self, forKey: "myPrimitiveReq") + myPrimitiveOpt = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitiveOpt") + myStringArrayReq = try container.decodeArray(String.self, forKey: "myStringArrayReq") + myStringArrayOpt = try container.decodeArrayIfPresent(String.self, forKey: "myStringArrayOpt") + myPrimitiveArrayReq = try container.decodeArray(AllPrimitives.self, forKey: "myPrimitiveArrayReq") + myPrimitiveArrayOpt = try container.decodeArrayIfPresent(AllPrimitives.self, forKey: "myPrimitiveArrayOpt") + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("myIntegerReq") + nonAdditionalPropertyKeys.insert("myIntegerOpt") + nonAdditionalPropertyKeys.insert("myPrimitiveReq") + nonAdditionalPropertyKeys.insert("myPrimitiveOpt") + nonAdditionalPropertyKeys.insert("myStringArrayReq") + nonAdditionalPropertyKeys.insert("myStringArrayOpt") + nonAdditionalPropertyKeys.insert("myPrimitiveArrayReq") + nonAdditionalPropertyKeys.insert("myPrimitiveArrayOpt") + additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) + } +} + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift new file mode 100644 index 00000000000..dba82ff7f08 --- /dev/null +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -0,0 +1,49 @@ +// +// ModelWithStringAdditionalPropertiesOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** This is an empty model with no properties and only additionalProperties of type string */ + +open class ModelWithStringAdditionalPropertiesOnly: Codable { + + + public var additionalProperties: [String:String] = [:] + + public subscript(key: String) -> String? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeMap(additionalProperties) + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + var nonAdditionalPropertyKeys = Set() + additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) + } +} + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift index 84c5dd180a0..470de98387e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift @@ -9,6 +9,7 @@ import Foundation /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */ + open class VariableNameTest: Codable { /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ @@ -16,12 +17,24 @@ open class VariableNameTest: Codable { /** This property name is a reserved word in most languages, including Swift 4. */ public var _for: String? - public init() {} + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case exampleName = "example_name" - case _for = "for" + try container.encodeIfPresent(exampleName, forKey: "example_name") + try container.encodeIfPresent(_for, forKey: "for") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + exampleName = try container.decodeIfPresent(String.self, forKey: "example_name") + _for = try container.decodeIfPresent(String.self, forKey: "for") + } } + diff --git a/samples/client/test/swift4/default/TestClientApp/Podfile.lock b/samples/client/test/swift4/default/TestClientApp/Podfile.lock index 5a82c71cd9d..c1f4274187d 100644 --- a/samples/client/test/swift4/default/TestClientApp/Podfile.lock +++ b/samples/client/test/swift4/default/TestClientApp/Podfile.lock @@ -1,7 +1,7 @@ PODS: - - Alamofire (4.5.0) + - Alamofire (4.5.1) - TestClient (0.0.1): - - Alamofire (~> 4.5) + - Alamofire (~> 4.5.0) DEPENDENCIES: - Alamofire (~> 4.5) @@ -12,8 +12,8 @@ EXTERNAL SOURCES: :path: ../ SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - TestClient: bcecc2c065b23aaa97f5b66a3f96741b560c381b + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a + TestClient: c12a94972a1128167637d39ea0b072f46c0790de PODFILE CHECKSUM: a4351ac5e001fd96f35ed7e647981803864100b5 diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE index 4cfbf72a4d8..1654602752b 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md index e1966fdca00..f190df923ba 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/README.md @@ -1,9 +1,9 @@ -![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/assets/alamofire.png) +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png) [![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) +[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](https://alamofire.github.io/Alamofire) [![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) [![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) @@ -45,7 +45,7 @@ Alamofire is an HTTP networking library written in Swift. - [x] TLS Certificate and Public Key Pinning - [x] Network Reachability - [x] Comprehensive Unit and Integration Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) +- [x] [Complete Documentation](https://alamofire.github.io/Alamofire) ## Component Libraries @@ -57,8 +57,8 @@ In order to keep Alamofire focused specifically on core networking implementatio ## Requirements - iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1, 8.2, 8.3, and 9.0 -- Swift 3.0, 3.1, 3.2, and 4.0 +- Xcode 8.3+ +- Swift 3.1+ ## Migration Guides @@ -84,7 +84,7 @@ In order to keep Alamofire focused specifically on core networking implementatio $ gem install cocoapods ``` -> CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+. +> CocoaPods 1.1+ is required to build Alamofire 4.0+. To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: @@ -94,7 +94,7 @@ platform :ios, '10.0' use_frameworks! target '' do - pod 'Alamofire', '~> 4.4' + pod 'Alamofire', '~> 4.5' end ``` @@ -118,7 +118,7 @@ $ brew install carthage To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl -github "Alamofire/Alamofire" ~> 4.4 +github "Alamofire/Alamofire" ~> 4.5 ``` Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. @@ -736,7 +736,7 @@ When sending relatively small amounts of data to a server using JSON or URL enco #### Uploading Data ```swift -let imageData = UIPNGRepresentation(image)! +let imageData = UIImagePNGRepresentation(image)! Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in debugPrint(response) @@ -1812,10 +1812,15 @@ There are some important things to remember when using network reachability to d The following radars have some effect on the current implementation of Alamofire. - [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage - `rdar://26870455` - Background URL Session Configurations do not work in the simulator - `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + ## FAQ ### What's the origin of the name Alamofire? diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift index f047695b6d6..585ae145e8a 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/AFError.swift @@ -1,7 +1,7 @@ // // AFError.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift index edcf717ca9e..e9716131ad9 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Alamofire.swift @@ -1,7 +1,7 @@ // // Alamofire.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift index 78e214ea179..9031395613c 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -1,7 +1,7 @@ // // DispatchQueue+Alamofire.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift index c5093f9f857..ba02d24f23f 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/MultipartFormData.swift @@ -1,7 +1,7 @@ // // MultipartFormData.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift index 30443b99b29..cdb5a02d313 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -1,7 +1,7 @@ // // NetworkReachabilityManager.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift index 81f6e378c89..df41505d97f 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Notifications.swift @@ -1,7 +1,7 @@ // // Notifications.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift index 959af6f9365..dabb56223cf 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/ParameterEncoding.swift @@ -1,7 +1,7 @@ // // ParameterEncoding.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -223,9 +223,9 @@ public struct URLEncoding: ParameterEncoding { let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex let range = startIndex..=4.0) - return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") - #else return components.map { "\($0)=\($1)" }.joined(separator: "&") - #endif } private func encodesParametersInURL(with method: HTTPMethod) -> Bool { diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift index 4f6350c5bfe..d93c52d100d 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Request.swift @@ -1,7 +1,7 @@ // // Request.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -293,11 +293,12 @@ extension Request: CustomDebugStringConvertible { if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") } } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") } } } @@ -308,7 +309,12 @@ extension Request: CustomDebugStringConvertible { let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty { let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[..=4.0) - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in - let (index, languageCode) = enumeratedLanguage - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #else let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in let quality = 1.0 - (Double(index) * 0.1) return "\(languageCode);q=\(quality)" }.joined(separator: ", ") - #endif // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/TaskDelegate.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/TaskDelegate.swift index d4fd2163c10..06077587d24 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/TaskDelegate.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/TaskDelegate.swift @@ -1,7 +1,7 @@ // // TaskDelegate.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -40,17 +40,30 @@ open class TaskDelegate: NSObject { public var error: Error? var task: URLSessionTask? { - didSet { reset() } + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } } var initialResponseTime: CFAbsoluteTime? var credential: URLCredential? var metrics: AnyObject? // URLSessionTaskMetrics + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + // MARK: Lifecycle init(task: URLSessionTask?) { - self.task = task + _task = task self.queue = { let operationQueue = OperationQueue() diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Timeline.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Timeline.swift index 1440989d5f1..c5dabd14fe0 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Timeline.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Timeline.swift @@ -1,7 +1,7 @@ // // Timeline.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Validation.swift b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Validation.swift index c405d02af10..989ac20091d 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Validation.swift +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Alamofire/Source/Validation.swift @@ -1,7 +1,7 @@ // // Validation.swift // -// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +// Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -48,7 +48,13 @@ extension Request { init?(_ string: String) { let components: [String] = { let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + return split.components(separatedBy: "/") }() diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Local Podspecs/TestClient.podspec.json b/samples/client/test/swift4/default/TestClientApp/Pods/Local Podspecs/TestClient.podspec.json index 061cca16502..72b5090a592 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Local Podspecs/TestClient.podspec.json +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Local Podspecs/TestClient.podspec.json @@ -13,10 +13,10 @@ "license": "Proprietary", "homepage": "https://github.com/swagger-api/swagger-codegen", "summary": "TestClient", - "source_files": "TestClient/Classes/Swaggers/**/*.swift", + "source_files": "TestClient/Classes/**/*.swift", "dependencies": { "Alamofire": [ - "~> 4.5" + "~> 4.5.0" ] } } diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Manifest.lock b/samples/client/test/swift4/default/TestClientApp/Pods/Manifest.lock index 5a82c71cd9d..c1f4274187d 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Manifest.lock +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Manifest.lock @@ -1,7 +1,7 @@ PODS: - - Alamofire (4.5.0) + - Alamofire (4.5.1) - TestClient (0.0.1): - - Alamofire (~> 4.5) + - Alamofire (~> 4.5.0) DEPENDENCIES: - Alamofire (~> 4.5) @@ -12,8 +12,8 @@ EXTERNAL SOURCES: :path: ../ SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - TestClient: bcecc2c065b23aaa97f5b66a3f96741b560c381b + Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a + TestClient: c12a94972a1128167637d39ea0b072f46c0790de PODFILE CHECKSUM: a4351ac5e001fd96f35ed7e647981803864100b5 diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/test/swift4/default/TestClientApp/Pods/Pods.xcodeproj/project.pbxproj index ce1337c74e6..f08334e9b0a 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Pods.xcodeproj/project.pbxproj +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Pods.xcodeproj/project.pbxproj @@ -3,55 +3,58 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 48; objects = { /* Begin PBXBuildFile section */ - 0D4972E6BBD4F9648AB1A64E5EA0A450 /* Swift4TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F8858EDEA88D85AAE1DF8EDE9DC77C /* Swift4TestAPI.swift */; }; + 06966509EB896061665956B254677EF3 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ADB9F167DA8EB39D3FA64AADB55D752 /* JSONEncodableEncoding.swift */; }; + 0A36E75434583424493479B3F81056C2 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8147CAF0602FB410B68FCBBDDE1244A /* JSONEncodingHelper.swift */; }; 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; + 1696BCB0ABCE1B4699943CBDD68BA0E7 /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDBDC5987A4E733064132DD2651D8D4A /* VariableNameTest.swift */; }; 16A8385493CF5CAE16F4A6EDC122554B /* TestClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = EC215D27FD61465426D20DB47BDF0A13 /* TestClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 16F9658ACE3C8E51723FD4D2808BD5B7 /* Swift4TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A91F27AE4FAB04A7B18D186684BC24 /* Swift4TestAPI.swift */; }; 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32542C877A09177CAEFC4F74BD271948 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64A7D3983284C3F8FD6A9C823E2C0205 /* Extensions.swift */; }; 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; - 48F6766C23FAA1C3EB26F2C79D05E90C /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83F55BF83F629A36D6E4DE56A7587EFE /* APIHelper.swift */; }; + 3684126CB8E9043D3CB679BD9F55DE3A /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D48A7304C97E00597AD2C0888F305D4 /* StringEnum.swift */; }; 491D85AF9A26E8E550FF18A085A7F93A /* Pods-TestClientAppTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D34026BC454C1DD59A8FEF08E0624FA /* Pods-TestClientAppTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4A19B588188141F7C2627331D135BA39 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; + 4CD53F2C3F07F184A4E9AFF987D853AE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B694C6A7D3FC9AB7995C5B62E1A4C81 /* Configuration.swift */; }; + 4D3D267D5EC61A81B3E97776C1F90BC2 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F6AE3BA0A5C5B83DF94B256CAB25B0C /* APIs.swift */; }; + 4EA043B27010D319B9D31A9ADCCF45EF /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C82967D176BC23B0E60DCC01C09B338 /* ModelWithStringAdditionalPropertiesOnly.swift */; }; 508F62094F4462562BA9D74DD32A1C69 /* Pods-TestClientApp-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A1A5FBE06254E8CD22605817BFC7C2A /* Pods-TestClientApp-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; + 54D7AEAF9281279158C7CDCC1519B34B /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 473EC0807F341A64DC33774F03A638B3 /* Extensions.swift */; }; 56810CDE959C88C7EEE42689888E150B /* Pods-TestClientApp-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EC60D563053BA3E937E249D19CBE5AB2 /* Pods-TestClientApp-dummy.m */; }; 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; + 7369905557251785485EE36C9E02F950 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BA405DCCE7A65CA4DA2B0E18A558185 /* CodableHelper.swift */; }; 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; 77801A4DCB8139D6B9FC60B06986AD59 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; - 7BDAAEFF614CDDFCF531965B3B601F12 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F0E897ED2B6C18C1ABE19A3EF6DCF35 /* JSONEncodingHelper.swift */; }; 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - 807D53F45D99E98922CB3FB2FEB8D462 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD220E07F1C948623A75B94EDD204C80 /* Models.swift */; }; - 85476C195492B54CC2ABB83CF43A5DE8 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D6D1D5AA8D6F123E125C094F8425913 /* Configuration.swift */; }; - 8EE6FAE17F65067E7B0641BC226D29D5 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0536CEC3E5D068534AF26E0822A0D37C /* APIs.swift */; }; - 908027787CFE432CE471A50AEC4DA4F9 /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95386376418CAFDA1C555370E0E12661 /* ErrorInfo.swift */; }; - 96A05165B067D8FC1A2B31CE4044EDAA /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1957CD13F1600BC8EDCE77287E02ABC /* GetAllModelsResult.swift */; }; + 98827C3F0CFA7E3E35F58BCEE6377E4A /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A4FC498355B3CB3435063F534C912B2 /* AllPrimitives.swift */; }; + 9AFDBFF4428F1DAD2456F1961301F0DF /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 403C559935235105D1940F7DA5169380 /* Models.swift */; }; 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C1C119BCE81C53F76CAC2BE27C38E0 /* Alamofire-dummy.m */; }; + AB24B68901CDB824AFB369B1014C33B8 /* TestClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 56FC4FE79F27E53676B9780C2E0408FC /* TestClient-dummy.m */; }; AC651427062D320B701382DCE4EBB3E7 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; + BBC8F5CBC843A3C3120323E14780D319 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42773192875A3DCB787D7318929AA7F6 /* AlamofireImplementations.swift */; }; + BBD1B0CD723F41BDB0D156F6918139DD /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE43F1B5A892E876D859A4377375182 /* ErrorInfo.swift */; }; BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; BE5EFF2B7869777404F6D9A4301C89F0 /* Pods-TestClientAppTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 0708401DDCEA2C9766573FC25995B724 /* Pods-TestClientAppTests-dummy.m */; }; - C35E9BD1765C0D9000B8909FD0DD340C /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = E39AD5DA1D27B3F292DCEEAE21D96605 /* AllPrimitives.swift */; }; CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - CDBEA35E8622312D4733BC983BE1B11D /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20D0A015D8572456F676A9F457B2620 /* AlamofireImplementations.swift */; }; - E18BBF7C05EB830F0B976B4811DAB3CB /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49F5BE6207AE35888A2153DFD4A2A185 /* JSONEncodableEncoding.swift */; }; - E531E1C6340BC226B7C447C4918BF367 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E6AC9BC99E1DDA7047BF4B9D49EBF6 /* CodableHelper.swift */; }; + DF576922335DC3DF1E0A2BB3F08E268C /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54BCC73C11DABEDD1168511015B45B0E /* APIHelper.swift */; }; + E299DDE12086E1950BFE65FAE5B4BF6D /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A80B74145656740388A2F2A8A6DEF7 /* ModelWithPropertiesAndAdditionalProperties.swift */; }; + E5A66AEEE7A4C9B38E9CD98DEA09FB71 /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4968CA07A325BD0A1E7D4461BE26DC08 /* GetAllModelsResult.swift */; }; + E8CC5F359BBC4B8CDD6D3F79A5C6921F /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ABA4A6D64C66093979DF0370F028D48 /* ModelWithIntAdditionalPropertiesOnly.swift */; }; EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - F5A379B0E89E2F2180452DA685406FB4 /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA19C43A35B935E36BDB03A579E03D76 /* VariableNameTest.swift */; }; - F5F316ECD754ABA19404421A138CA442 /* TestClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 56FC4FE79F27E53676B9780C2E0408FC /* TestClient-dummy.m */; }; F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; F9F9D4F89331668EBF47EBF7F73E05B7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; - FDDA91291F1F944700D12907 /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB8DA7B1F1F93C60083AF83 /* StringEnum.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -80,20 +83,20 @@ /* Begin PBXFileReference section */ 00F2B96AF439542BA8CB08C60AEDA11C /* TestClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "TestClient-prefix.pch"; sourceTree = ""; }; - 04E6AC9BC99E1DDA7047BF4B9D49EBF6 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 051F389CC74A5EEB0D289CBF0ACD7FF2 /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0536CEC3E5D068534AF26E0822A0D37C /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 051F389CC74A5EEB0D289CBF0ACD7FF2 /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_TestClientApp.framework; path = "Pods-TestClientApp.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 0708401DDCEA2C9766573FC25995B724 /* Pods-TestClientAppTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-TestClientAppTests-dummy.m"; sourceTree = ""; }; 07B75A0B6C507BAECEA8916067F04CC1 /* Pods-TestClientAppTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-TestClientAppTests-acknowledgements.markdown"; sourceTree = ""; }; 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 0F0E897ED2B6C18C1ABE19A3EF6DCF35 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; + 0D48A7304C97E00597AD2C0888F305D4 /* StringEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; }; 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 10D49DDF5275F7220CE632073C28829D /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 10D49DDF5275F7220CE632073C28829D /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_TestClientAppTests.framework; path = "Pods-TestClientAppTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 13A0A663B36A229C69D5274A83E93F88 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 1AE1C790A3C1BAEC17CB4508DA52569D /* Pods-TestClientApp.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-TestClientApp.modulemap"; sourceTree = ""; }; + 1A4FC498355B3CB3435063F534C912B2 /* AllPrimitives.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; }; + 1ADB9F167DA8EB39D3FA64AADB55D752 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 1AE1C790A3C1BAEC17CB4508DA52569D /* Pods-TestClientApp.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-TestClientApp.modulemap"; sourceTree = ""; }; 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; 1E7748C6BC5C4971F0CE95DAC1C5C9AB /* Pods-TestClientAppTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-TestClientAppTests-frameworks.sh"; sourceTree = ""; }; 20BAA66C9CB47A7685E432795BD57F74 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -103,26 +106,31 @@ 2E0292F5FFC33B8E8740CEE1C2FD591B /* Pods-TestClientApp-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-TestClientApp-acknowledgements.markdown"; sourceTree = ""; }; 31D7F9C80C3FD2025331A919AA7DB283 /* TestClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = TestClient.xcconfig; sourceTree = ""; }; 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + 3BA405DCCE7A65CA4DA2B0E18A558185 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; + 3C82967D176BC23B0E60DCC01C09B338 /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = ""; }; 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 403C559935235105D1940F7DA5169380 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 42773192875A3DCB787D7318929AA7F6 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 49F5BE6207AE35888A2153DFD4A2A185 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 473EC0807F341A64DC33774F03A638B3 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + 4968CA07A325BD0A1E7D4461BE26DC08 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; }; 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 505DF24A1D5BCB011EAED5834CF5E166 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 505DF24A1D5BCB011EAED5834CF5E166 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = TestClient.framework; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 54BCC73C11DABEDD1168511015B45B0E /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; 56FC4FE79F27E53676B9780C2E0408FC /* TestClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "TestClient-dummy.m"; sourceTree = ""; }; - 58F8858EDEA88D85AAE1DF8EDE9DC77C /* Swift4TestAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = ""; }; - 5D6D1D5AA8D6F123E125C094F8425913 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 64A7D3983284C3F8FD6A9C823E2C0205 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + 6ABA4A6D64C66093979DF0370F028D48 /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = ""; }; + 6F6AE3BA0A5C5B83DF94B256CAB25B0C /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7B4EA8191BDD7C6FBCDA7BFABEAABD65 /* Pods-TestClientAppTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-TestClientAppTests-resources.sh"; sourceTree = ""; }; - 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Alamofire.modulemap; sourceTree = ""; }; - 83F55BF83F629A36D6E4DE56A7587EFE /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 7D141D1953E5C6E67E362CE73090E48A /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; 859F2A4BF103D649ABB3C578D06E5644 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 95386376418CAFDA1C555370E0E12661 /* ErrorInfo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; }; - 9A41065D7EDA73C5461089CE09642EF4 /* Pods-TestClientAppTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-TestClientAppTests.modulemap"; sourceTree = ""; }; + 8B694C6A7D3FC9AB7995C5B62E1A4C81 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9A41065D7EDA73C5461089CE09642EF4 /* Pods-TestClientAppTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-TestClientAppTests.modulemap"; sourceTree = ""; }; + 9BE43F1B5A892E876D859A4377375182 /* ErrorInfo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; }; 9D34026BC454C1DD59A8FEF08E0624FA /* Pods-TestClientAppTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-TestClientAppTests-umbrella.h"; sourceTree = ""; }; A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; A234B48049014361A63FD492CFA12C33 /* Pods-TestClientApp-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-TestClientApp-resources.sh"; sourceTree = ""; }; @@ -130,26 +138,24 @@ AD7CCEFF0491973C176C68B2094165CE /* Pods-TestClientAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-TestClientAppTests.debug.xcconfig"; sourceTree = ""; }; B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; B44A27EFBB0DA84D738057B77F3413B1 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - B797C23587435A3F339881CAAC898D14 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B797C23587435A3F339881CAAC898D14 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B8147CAF0602FB410B68FCBBDDE1244A /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; BCCA9CA7D9C1A2047BB93336C5708DFD /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - C20D0A015D8572456F676A9F457B2620 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + CDBDC5987A4E733064132DD2651D8D4A /* VariableNameTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; }; D380217817360C1C3B246D7430A57536 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D9B3CA0144002E01B7C258E2AFFC5ECC /* Pods-TestClientApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-TestClientApp.debug.xcconfig"; sourceTree = ""; }; - DA19C43A35B935E36BDB03A579E03D76 /* VariableNameTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; }; - DD220E07F1C948623A75B94EDD204C80 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - E1957CD13F1600BC8EDCE77287E02ABC /* GetAllModelsResult.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; }; + E0A80B74145656740388A2F2A8A6DEF7 /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = ""; }; E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - E39AD5DA1D27B3F292DCEEAE21D96605 /* AllPrimitives.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; }; E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; E6F34CCF86067ED508C12C676E298C69 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - E80AE90233A5A495A962073C089D20F5 /* TestClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = TestClient.modulemap; sourceTree = ""; }; + E80AE90233A5A495A962073C089D20F5 /* TestClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = TestClient.modulemap; sourceTree = ""; }; EB09BADC596A8F1BDC2465074CEC2908 /* Pods-TestClientAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-TestClientAppTests.release.xcconfig"; sourceTree = ""; }; EC215D27FD61465426D20DB47BDF0A13 /* TestClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "TestClient-umbrella.h"; sourceTree = ""; }; EC60D563053BA3E937E249D19CBE5AB2 /* Pods-TestClientApp-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-TestClientApp-dummy.m"; sourceTree = ""; }; F41BAD9018CDC154B7E15EBFFF0E69CB /* Pods-TestClientApp-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-TestClientApp-frameworks.sh"; sourceTree = ""; }; + F9A91F27AE4FAB04A7B18D186684BC24 /* Swift4TestAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = ""; }; FA871D862680FF2E4D3660EEAFD05023 /* Pods-TestClientAppTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-TestClientAppTests-acknowledgements.plist"; sourceTree = ""; }; - FDB8DA7B1F1F93C60083AF83 /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -229,21 +235,10 @@ B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */, 55F14F994FE7AB51F028BFE66CEF3106 /* Support Files */, ); + name = Alamofire; path = Alamofire; sourceTree = ""; }; - 20F82AD8AB8A44DCA1E683A8640CA043 /* Models */ = { - isa = PBXGroup; - children = ( - FDB8DA7B1F1F93C60083AF83 /* StringEnum.swift */, - E39AD5DA1D27B3F292DCEEAE21D96605 /* AllPrimitives.swift */, - 95386376418CAFDA1C555370E0E12661 /* ErrorInfo.swift */, - E1957CD13F1600BC8EDCE77287E02ABC /* GetAllModelsResult.swift */, - DA19C43A35B935E36BDB03A579E03D76 /* VariableNameTest.swift */, - ); - path = Models; - sourceTree = ""; - }; 2FF51E396F814CDBFEF63FBE55F4DB94 /* Pods-TestClientAppTests */ = { isa = PBXGroup; children = ( @@ -301,29 +296,12 @@ name = iOS; sourceTree = ""; }; - 530616A10EB9820B3B3D3639C9541C2B /* Swaggers */ = { - isa = PBXGroup; - children = ( - C20D0A015D8572456F676A9F457B2620 /* AlamofireImplementations.swift */, - 83F55BF83F629A36D6E4DE56A7587EFE /* APIHelper.swift */, - 0536CEC3E5D068534AF26E0822A0D37C /* APIs.swift */, - 04E6AC9BC99E1DDA7047BF4B9D49EBF6 /* CodableHelper.swift */, - 5D6D1D5AA8D6F123E125C094F8425913 /* Configuration.swift */, - 64A7D3983284C3F8FD6A9C823E2C0205 /* Extensions.swift */, - 49F5BE6207AE35888A2153DFD4A2A185 /* JSONEncodableEncoding.swift */, - 0F0E897ED2B6C18C1ABE19A3EF6DCF35 /* JSONEncodingHelper.swift */, - DD220E07F1C948623A75B94EDD204C80 /* Models.swift */, - 9A505D484E83675727454467075A9031 /* APIs */, - 20F82AD8AB8A44DCA1E683A8640CA043 /* Models */, - ); - path = Swaggers; - sourceTree = ""; - }; 55150D9BCBE0156582CD9BCAB75BEA88 /* TestClient */ = { isa = PBXGroup; children = ( 6EB25EF4908044FE989DE53EF76DC47D /* Classes */, ); + name = TestClient; path = TestClient; sourceTree = ""; }; @@ -353,8 +331,9 @@ 6EB25EF4908044FE989DE53EF76DC47D /* Classes */ = { isa = PBXGroup; children = ( - 530616A10EB9820B3B3D3639C9541C2B /* Swaggers */, + F8E5F93111B4632BF4CEAA6615E4F8E6 /* Swaggers */, ); + name = Classes; path = Classes; sourceTree = ""; }; @@ -370,14 +349,31 @@ ); sourceTree = ""; }; - 9A505D484E83675727454467075A9031 /* APIs */ = { + 8D2C9AD02753DA5142931DEB9E397331 /* APIs */ = { isa = PBXGroup; children = ( - 58F8858EDEA88D85AAE1DF8EDE9DC77C /* Swift4TestAPI.swift */, + F9A91F27AE4FAB04A7B18D186684BC24 /* Swift4TestAPI.swift */, ); + name = APIs; path = APIs; sourceTree = ""; }; + AC474B980F22BBF449598D00D657BB46 /* Models */ = { + isa = PBXGroup; + children = ( + 1A4FC498355B3CB3435063F534C912B2 /* AllPrimitives.swift */, + 9BE43F1B5A892E876D859A4377375182 /* ErrorInfo.swift */, + 4968CA07A325BD0A1E7D4461BE26DC08 /* GetAllModelsResult.swift */, + 6ABA4A6D64C66093979DF0370F028D48 /* ModelWithIntAdditionalPropertiesOnly.swift */, + E0A80B74145656740388A2F2A8A6DEF7 /* ModelWithPropertiesAndAdditionalProperties.swift */, + 3C82967D176BC23B0E60DCC01C09B338 /* ModelWithStringAdditionalPropertiesOnly.swift */, + 0D48A7304C97E00597AD2C0888F305D4 /* StringEnum.swift */, + CDBDC5987A4E733064132DD2651D8D4A /* VariableNameTest.swift */, + ); + name = Models; + path = Models; + sourceTree = ""; + }; D241D358AF2A3AD51333DD16741209F5 /* Products */ = { isa = PBXGroup; children = ( @@ -407,6 +403,25 @@ path = "Target Support Files/Pods-TestClientApp"; sourceTree = ""; }; + F8E5F93111B4632BF4CEAA6615E4F8E6 /* Swaggers */ = { + isa = PBXGroup; + children = ( + 42773192875A3DCB787D7318929AA7F6 /* AlamofireImplementations.swift */, + 54BCC73C11DABEDD1168511015B45B0E /* APIHelper.swift */, + 6F6AE3BA0A5C5B83DF94B256CAB25B0C /* APIs.swift */, + 3BA405DCCE7A65CA4DA2B0E18A558185 /* CodableHelper.swift */, + 8B694C6A7D3FC9AB7995C5B62E1A4C81 /* Configuration.swift */, + 473EC0807F341A64DC33774F03A638B3 /* Extensions.swift */, + 1ADB9F167DA8EB39D3FA64AADB55D752 /* JSONEncodableEncoding.swift */, + B8147CAF0602FB410B68FCBBDDE1244A /* JSONEncodingHelper.swift */, + 403C559935235105D1940F7DA5169380 /* Models.swift */, + 8D2C9AD02753DA5142931DEB9E397331 /* APIs */, + AC474B980F22BBF449598D00D657BB46 /* Models */, + ); + name = Swaggers; + path = Swaggers; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -485,7 +500,7 @@ isa = PBXNativeTarget; buildConfigurationList = A3C6C15D000D0C0BF929BB22D7E47460 /* Build configuration list for PBXNativeTarget "TestClient" */; buildPhases = ( - 84F8DD24561589E606CA583744B6C382 /* Sources */, + 66D8A345E619AC0BC716043483937293 /* Sources */, AC284B2E37927E3BD90A51DE555787BE /* Frameworks */, BCCD67B6417E44806203C28B41FEC4EA /* Headers */, ); @@ -579,26 +594,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 84F8DD24561589E606CA583744B6C382 /* Sources */ = { + 66D8A345E619AC0BC716043483937293 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CDBEA35E8622312D4733BC983BE1B11D /* AlamofireImplementations.swift in Sources */, - C35E9BD1765C0D9000B8909FD0DD340C /* AllPrimitives.swift in Sources */, - 48F6766C23FAA1C3EB26F2C79D05E90C /* APIHelper.swift in Sources */, - 8EE6FAE17F65067E7B0641BC226D29D5 /* APIs.swift in Sources */, - E531E1C6340BC226B7C447C4918BF367 /* CodableHelper.swift in Sources */, - 85476C195492B54CC2ABB83CF43A5DE8 /* Configuration.swift in Sources */, - 908027787CFE432CE471A50AEC4DA4F9 /* ErrorInfo.swift in Sources */, - FDDA91291F1F944700D12907 /* StringEnum.swift in Sources */, - 32542C877A09177CAEFC4F74BD271948 /* Extensions.swift in Sources */, - 96A05165B067D8FC1A2B31CE4044EDAA /* GetAllModelsResult.swift in Sources */, - E18BBF7C05EB830F0B976B4811DAB3CB /* JSONEncodableEncoding.swift in Sources */, - 7BDAAEFF614CDDFCF531965B3B601F12 /* JSONEncodingHelper.swift in Sources */, - 807D53F45D99E98922CB3FB2FEB8D462 /* Models.swift in Sources */, - 0D4972E6BBD4F9648AB1A64E5EA0A450 /* Swift4TestAPI.swift in Sources */, - F5F316ECD754ABA19404421A138CA442 /* TestClient-dummy.m in Sources */, - F5A379B0E89E2F2180452DA685406FB4 /* VariableNameTest.swift in Sources */, + BBC8F5CBC843A3C3120323E14780D319 /* AlamofireImplementations.swift in Sources */, + 98827C3F0CFA7E3E35F58BCEE6377E4A /* AllPrimitives.swift in Sources */, + DF576922335DC3DF1E0A2BB3F08E268C /* APIHelper.swift in Sources */, + 4D3D267D5EC61A81B3E97776C1F90BC2 /* APIs.swift in Sources */, + 7369905557251785485EE36C9E02F950 /* CodableHelper.swift in Sources */, + 4CD53F2C3F07F184A4E9AFF987D853AE /* Configuration.swift in Sources */, + BBD1B0CD723F41BDB0D156F6918139DD /* ErrorInfo.swift in Sources */, + 54D7AEAF9281279158C7CDCC1519B34B /* Extensions.swift in Sources */, + E5A66AEEE7A4C9B38E9CD98DEA09FB71 /* GetAllModelsResult.swift in Sources */, + 06966509EB896061665956B254677EF3 /* JSONEncodableEncoding.swift in Sources */, + 0A36E75434583424493479B3F81056C2 /* JSONEncodingHelper.swift in Sources */, + 9AFDBFF4428F1DAD2456F1961301F0DF /* Models.swift in Sources */, + E8CC5F359BBC4B8CDD6D3F79A5C6921F /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */, + E299DDE12086E1950BFE65FAE5B4BF6D /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */, + 4EA043B27010D319B9D31A9ADCCF45EF /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */, + 3684126CB8E9043D3CB679BD9F55DE3A /* StringEnum.swift in Sources */, + 16F9658ACE3C8E51723FD4D2808BD5B7 /* Swift4TestAPI.swift in Sources */, + AB24B68901CDB824AFB369B1014C33B8 /* TestClient-dummy.m in Sources */, + 1696BCB0ABCE1B4699943CBDD68BA0E7 /* VariableNameTest.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Info.plist index c1c4a98b9a1..eaa7c2e93bf 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Info.plist +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.5.0 + 4.5.1 CFBundleSignature ???? CFBundleVersion diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.markdown b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.markdown index e04b910c370..2692156aee6 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.markdown +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.markdown @@ -3,7 +3,7 @@ This application makes use of the following third party libraries: ## Alamofire -Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) +Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.plist b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.plist index 931747768ba..d62aff07095 100644 --- a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.plist +++ b/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-acknowledgements.plist @@ -14,7 +14,7 @@ FooterText - Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) + Copyright (c) 2014-2017 Alamofire Software Foundation (http://alamofire.org/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 5f566255ace78ade49db0dace7f50e93682d1d03 Mon Sep 17 00:00:00 2001 From: Barry Andrews Date: Mon, 18 Sep 2017 13:14:47 -0400 Subject: [PATCH 026/197] Add support for reserved-words-mappings to cpprest (#6501) * Also handles automatic escaping for reserved words, i.e. by default, no need to provide a mapping. Fix #6498 --- .../codegen/languages/AbstractCppCodegen.java | 19 ++++++++++++++++++ .../languages/CppRestClientCodegen.java | 20 +++---------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java index 874d42f05af..7dcb9ed1464 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java @@ -101,6 +101,10 @@ public String toVarName(String name) { return sanitizeName(name); } + if (isReservedWord(name)) { + return escapeReservedWord(name); + } + if (name.length() > 1) { return sanitizeName(Character.toUpperCase(name.charAt(0)) + name.substring(1)); } @@ -108,6 +112,21 @@ public String toVarName(String name) { return sanitizeName(name); } + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle + * escaping those terms here. This logic is only called if a variable + * matches the reseved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + if(this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return sanitizeName("_" + name); + } + @Override public String toParamName(String name) { return sanitizeName(super.toParamName(name)); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java index 872e1f571d1..744e0102dfd 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CppRestClientCodegen.java @@ -55,7 +55,7 @@ public class CppRestClientCodegen extends AbstractCppCodegen { /** * Configures the type of generator. - * + * * @return the CodegenType for this generator * @see io.swagger.codegen.CodegenType */ @@ -66,7 +66,7 @@ public CodegenType getTag() { /** * 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() { @@ -76,7 +76,7 @@ public String getName() { /** * 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() { @@ -111,8 +111,6 @@ public CppRestClientCodegen() { "The default include statement that should be placed in all headers for including things like the declspec (convention: #include \"Commons.h\" ", this.defaultInclude); - reservedWords = new HashSet(); - supportingFiles.add(new SupportingFile("modelbase-header.mustache", "", "ModelBase.h")); supportingFiles.add(new SupportingFile("modelbase-source.mustache", "", "ModelBase.cpp")); supportingFiles.add(new SupportingFile("apiclient-header.mustache", "", "ApiClient.h")); @@ -187,18 +185,6 @@ public void processOpts() { additionalProperties.put("defaultInclude", defaultInclude); } - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle - * escaping those terms here. This logic is only called if a variable - * matches the reseved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - return "_" + name; // add an underscore to the name - } - /** * Location to write model files. You can use the modelPackage() as defined * when the class is instantiated From d928617b69db76ba5ba7736e2394b7baa3fe9db3 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Mon, 18 Sep 2017 12:24:38 -0500 Subject: [PATCH 027/197] [haskell-http-client] use katip logger, default strict (#6478) * change strictFields cli option default to True; * use katip logging; add cli-option for monad-logger * fix date parsing * remove package.yaml --- .../languages/HaskellHttpClientCodegen.java | 24 +- .../haskell-http-client/Client.mustache | 135 ++--- .../haskell-http-client/LoggingKatip.mustache | 108 ++++ .../LoggingMonadLogger.mustache | 117 ++++ .../haskell-http-client/Model.mustache | 6 +- .../haskell-http-client/README.mustache | 4 +- .../haskell-http-client/TopLevel.mustache | 2 + .../haskell-http-client.cabal.mustache | 10 +- .../haskell-http-client/package.mustache | 87 --- .../HaskellHttpClientOptionsTest.java | 2 + .../HaskellHttpClientOptionsProvider.java | 2 + .../haskell-http-client/CONTRIBUTING.md | 7 +- .../petstore/haskell-http-client/README.md | 4 +- .../docs/SwaggerPetstore-Client.html | 2 +- .../docs/SwaggerPetstore-Logging.html | 4 + .../docs/SwaggerPetstore-Model.html | 2 +- .../docs/SwaggerPetstore.html | 2 +- .../docs/doc-index-45.html | 2 +- .../docs/doc-index-95.html | 2 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.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 | 4 - .../haskell-http-client/docs/doc-index-F.html | 2 +- .../haskell-http-client/docs/doc-index-G.html | 2 +- .../haskell-http-client/docs/doc-index-H.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-R.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/doc-index-W.html | 2 +- .../haskell-http-client/docs/doc-index.html | 2 +- .../haskell-http-client/docs/index.html | 2 +- .../docs/mini_SwaggerPetstore-Client.html | 2 +- .../docs/mini_SwaggerPetstore-Logging.html | 4 + .../docs/src/Paths_swagger_petstore.html | 10 +- .../docs/src/SwaggerPetstore.API.html | 346 +++++------ .../docs/src/SwaggerPetstore.Client.html | 545 ++++++++---------- .../docs/src/SwaggerPetstore.Lens.html | 58 +- .../docs/src/SwaggerPetstore.Logging.html | 109 ++++ .../docs/src/SwaggerPetstore.MimeTypes.html | 102 ++-- .../docs/src/SwaggerPetstore.Model.html | 222 +++---- .../docs/src/SwaggerPetstore.html | 18 +- .../haskell-http-client/example-app/Main.hs | 15 +- .../example-app/debugLog.txt | 95 --- .../example-app/infoLog.txt | 92 +-- .../lib/SwaggerPetstore.hs | 2 + .../lib/SwaggerPetstore/Client.hs | 135 ++--- .../lib/SwaggerPetstore/Logging.hs | 108 ++++ .../lib/SwaggerPetstore/Model.hs | 56 +- .../petstore/haskell-http-client/package.yaml | 84 --- .../swagger-petstore.cabal | 9 +- .../tests-integration/package.yaml | 1 - .../swagger-petstore-tests-integration.cabal | 1 - .../tests-integration/tests/Test.hs | 6 +- 62 files changed, 1321 insertions(+), 1265 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Logging.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/doc-index-E.html create mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html delete mode 100644 samples/client/petstore/haskell-http-client/example-app/debugLog.txt create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs delete mode 100644 samples/client/petstore/haskell-http-client/package.yaml 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 a7cc41fd230..037af1b7787 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 @@ -44,6 +44,8 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected String defaultDateFormat = "%Y-%m-%d"; + protected Boolean useMonadLogger = false; + // CLI public static final String ALLOW_FROMJSON_NULLS = "allowFromJsonNulls"; public static final String ALLOW_TOJSON_NULLS = "allowToJsonNulls"; @@ -54,6 +56,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC public static final String GENERATE_MODEL_CONSTRUCTORS = "generateModelConstructors"; public static final String MODEL_DERIVING = "modelDeriving"; public static final String STRICT_FIELDS = "strictFields"; + public static final String USE_MONAD_LOGGER = "useMonadLogger"; // protected String MODEL_IMPORTS = "modelImports"; // protected String MODEL_EXTENSIONS = "modelExtensions"; @@ -192,7 +195,8 @@ public HaskellHttpClientCodegen() { cliOptions.add(CliOption.newBoolean(GENERATE_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newString(MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); - cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.FALSE.toString()))); + cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.TRUE.toString()))); + cliOptions.add(CliOption.newBoolean(USE_MONAD_LOGGER, "Use the monad-logger package to provide logging (if false, use the katip logging package)").defaultValue((Boolean.FALSE.toString()))); cliOptions.add(CliOption.newString(DATETIME_FORMAT, "format string used to parse/render a datetime")); cliOptions.add(CliOption.newString(DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); @@ -252,6 +256,11 @@ public void setStrictFields(Boolean value) { additionalProperties.put("x-strictFields", value); } + public void setUseMonadLogger(Boolean value) { + additionalProperties.put("x-useMonadLogger", value); + this.useMonadLogger = value; + } + @Override public void processOpts() { super.processOpts(); @@ -313,7 +322,12 @@ public void processOpts() { if (additionalProperties.containsKey(STRICT_FIELDS)) { setStrictFields(convertPropertyToBoolean(STRICT_FIELDS)); } else { - setStrictFields(false); + setStrictFields(true); + } + if (additionalProperties.containsKey(USE_MONAD_LOGGER)) { + setUseMonadLogger(convertPropertyToBoolean(USE_MONAD_LOGGER)); + } else { + setUseMonadLogger(false); } } @@ -366,9 +380,6 @@ public void preprocessSwagger(Swagger swagger) { // root supportingFiles.add(new SupportingFile("haskell-http-client.cabal.mustache", "", cabalName + ".cabal")); - supportingFiles.add(new SupportingFile("haskell-http-client.cabal.mustache", "", cabalName + ".cabal")); - supportingFiles.add(new SupportingFile("package.mustache", "", "package.yaml")); - // lib supportingFiles.add(new SupportingFile("TopLevel.mustache", "lib/", apiName + ".hs")); supportingFiles.add(new SupportingFile("Client.mustache", "lib/" + apiName, "Client.hs")); @@ -377,6 +388,9 @@ public void preprocessSwagger(Swagger swagger) { supportingFiles.add(new SupportingFile("Model.mustache", "lib/" + apiName, "Model.hs")); supportingFiles.add(new SupportingFile("MimeTypes.mustache", "lib/" + apiName, "MimeTypes.hs")); + // logger + supportingFiles.add(new SupportingFile(useMonadLogger ? "LoggingMonadLogger.mustache" : "LoggingKatip.mustache", "lib/" + apiName, "Logging.hs")); + // modelTemplateFiles.put("API.mustache", ".hs"); // apiTemplateFiles.put("Model.mustache", ".hs"); diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index f23f0ebf1dd..68228e22bbb 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -17,6 +17,7 @@ module {{title}}.Client where import {{title}}.Model import {{title}}.API import {{title}}.MimeTypes +import {{title}}.Logging import qualified Control.Monad.IO.Class as P import qualified Data.Aeson as A @@ -30,8 +31,6 @@ import Web.FormUrlEncoded as WH import Web.HttpApiData as WH import Control.Monad.Catch (MonadThrow) -import qualified Control.Monad.Logger as LG - import qualified Data.Time as TI import qualified Data.Map as Map import qualified Data.Text as T @@ -57,8 +56,8 @@ import qualified Control.Exception.Safe as E data {{configType}} = {{configType}} { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger } -- | display the config @@ -79,29 +78,29 @@ instance Show {{configType}} where -- -- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}"@ -- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: {{configType}} -newConfig = - {{configType}} - { configHost = "{{basePath}}" - , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: {{configType}} -> {{configType}} -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: {{configType}} -> {{configType}} -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +newConfig :: IO {{configType}} +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "{{{basePath}}}" + , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: {{configType}} -> IO {{configType}} +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: {{configType}} -> IO {{configType}} +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: {{configType}} -> {{configType}} -withNoLogging p = p { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * Dispatch @@ -146,10 +145,10 @@ dispatchMime dispatchMime manager config request accept = do httpResponse <- dispatchLbs manager config request accept parsedResult <- - runExceptionLoggingT "Client" config $ + runConfigLogWithExceptions "Client" config $ do case mimeUnrender' accept (NH.responseBody httpResponse) of Left s -> do - logNST LG.LevelError "Client" (T.pack s) + _log "Client" levelError (T.pack s) pure (Left (MimeError s httpResponse)) Right r -> pure (Right r) return (MimeResult parsedResult httpResponse) @@ -187,15 +186,15 @@ dispatchInitUnsafe -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) return res where - logSrc = "Client" + src = "Client" endpoint = T.pack $ BC.unpack $ @@ -250,68 +249,16 @@ modifyInitRequest (InitRequest req) f = 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 - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - -- ** Logging --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "{{title}}/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: {{configType}} -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT +-- | Run a block using the configured logger instance +runConfigLog + :: P.MonadIO m + => {{configType}} -> 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 -> {{configType}} -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + => T.Text -> {{configType}} -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache new file mode 100644 index 00000000000..470df933b09 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -0,0 +1,108 @@ +{-| +Module : {{title}}.Logging +Katip Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module {{title}}.Logging where + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import qualified Katip as LG + +-- * Type Aliases (for compatability) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A Katip logging block +type LogExec m = forall a. LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "{{title}}" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache new file mode 100644 index 00000000000..a9737b70e01 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache @@ -0,0 +1,117 @@ +{-| +Module : {{title}}.Logging +monad-logger Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module {{title}}.Logging where + +import Data.Text (Text) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Data.Text as T +import qualified Data.Time as TI +import Data.Monoid ((<>)) + +import qualified Control.Monad.Logger as LG + +-- * Type Aliases (for compatability) + +-- | Runs a monad-logger block with the filter predicate +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A monad-logger block +type LogExec m = forall a. LG.LoggingT m a -> m a + +-- | A monad-logger filter predicate +type LogContext = LG.LogSource -> LG.LogLevel -> Bool + +-- | A monad-logger log level +type LogLevel = LG.LogLevel + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = pure infoLevelFilter + +-- | Runs a monad-logger block with the filter predicate +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = runNullLogExec + +-- * stdout logger + +-- | Runs a monad-logger block targeting stdout, with the filter predicate +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec cxt = LG.runStdoutLoggingT . LG.filterLogger cxt + +-- | @pure@ +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext = pure + +-- * stderr logger + +-- | Runs a monad-logger block targeting stderr, with the filter predicate +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec cxt = LG.runStderrLoggingT . LG.filterLogger cxt + +-- | @pure@ +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext = pure + +-- * Null logger + +-- | Disables monad-logger logging +runNullLogExec :: LogExecWithContext +runNullLogExec = const (`LG.runLoggingT` nullLogger) + +-- | monad-logger which does nothing +nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () +nullLogger _ _ _ _ = return () + +-- * Log Msg + +-- | Log a message using the current time +_log :: (P.MonadIO m, LG.MonadLogger m) => Text -> LG.LogLevel -> Text -> m () +_log src level msg = do + now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) + LG.logOtherNS ("{{title}}." <> src) level ("[" <> now <> "] " <> msg) + where + formatTimeLog = + T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.LevelError ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.LevelInfo + +levelError :: LogLevel +levelError = LG.LevelError + +levelDebug :: LogLevel +levelDebug = LG.LevelDebug + +-- * Level Filter + +minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool +minLevelFilter l _ l' = l' >= l + +infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool +infoLevelFilter = minLevelFilter LG.LevelInfo 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 17b1b55827f..9176a1e047d 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 @@ -64,7 +64,7 @@ data {{classname}} = {{classname}} instance A.FromJSON {{classname}} where parseJSON = A.withObject "{{classname}}" $ \o -> {{classname}} - <$>{{#vars}} (o {{#required}}.: {{/required}}{{^required}}{{^allowFromJsonNulls}}.:!{{/allowFromJsonNulls}}{{#allowFromJsonNulls}}.:?{{/allowFromJsonNulls}}{{/required}} "{{baseName}}"{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _showDate{{/isDate}}){{#hasMore}} + <$>{{#vars}} (o {{#required}}.: {{/required}}{{^required}}{{^allowFromJsonNulls}}.:!{{/allowFromJsonNulls}}{{#allowFromJsonNulls}}.:?{{/allowFromJsonNulls}}{{/required}} "{{baseName}}"{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _readDate{{/isDate}}){{#hasMore}} <*>{{/hasMore}}{{/vars}} instance A.ToJSON {{classname}} where @@ -78,7 +78,7 @@ instance A.ToJSON {{classname}} where instance WH.FromForm {{classname}} where fromForm f = {{classname}} - <$>{{#vars}} ({{#required}}WH.parseUnique {{/required}}{{^required}}WH.parseMaybe {{/required}}"{{baseName}}" f{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _showDate{{/isDate}}){{#hasMore}} + <$>{{#vars}} ({{#required}}WH.parseUnique {{/required}}{{^required}}WH.parseMaybe {{/required}}"{{baseName}}" f{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _readDate{{/isDate}}){{#hasMore}} <*>{{/hasMore}}{{/vars}} instance WH.ToForm {{classname}} where @@ -166,4 +166,4 @@ _readDate = _showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}" -{-# INLINE _showDate #-} \ No newline at end of file +{-# INLINE _showDate #-} 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 028941e3ae7..1b1db613a2d 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 @@ -75,7 +75,8 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | {{{generateLenses}}} | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{{generateModelConstructors}}} | | modelDeriving | Additional classes to include in the deriving() clause of Models | | {{{modelDeriving}}} | -| strictFields | Add strictness annotations to all model fields | false | {{{x-strictFields}}} | +| strictFields | Add strictness annotations to all model fields | true | {{{x-strictFields}}} | +| useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | {{{x-useMonadLogger}}} | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -115,6 +116,7 @@ This library is intended to be imported qualified. | {{title}}.Model | describes models | | {{title}}.MimeTypes | encoding/decoding MIME types (content-types/accept) | | {{title}}.Lens | lenses for model fields | +| {{title}}.Logging | logging functions and utils | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an 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 3cbf6cd3630..83e2c8ed979 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 @@ -8,6 +8,7 @@ module {{title}} , module {{title}}.Model , module {{title}}.MimeTypes , module {{title}}.Lens + , module {{title}}.Logging ) where import {{title}}.API @@ -15,3 +16,4 @@ import {{title}}.Client import {{title}}.Model import {{title}}.MimeTypes import {{title}}.Lens +import {{title}}.Logging 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 0f1f9f28a6a..1125ab040da 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 @@ -8,6 +8,8 @@ synopsis: Auto-generated {{package}} API Client description: . Client library for calling the {{package}} API based on http-client. . + host: {{host}} + . base path: {{basePath}} . apiVersion: {{apiVersion}} @@ -17,6 +19,7 @@ description: . {{^hideGenerationTimestamp}}Generated on: {{generatedDate}} . {{/hideGenerationTimestamp}}OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/{{swaggerVersion}}.md + . category: Web homepage: https://github.com/swagger-api/swagger-codegen#readme author: Author Name Here @@ -33,7 +36,7 @@ extra-source-files: library hs-source-dirs: lib - ghc-options: -Wall + ghc-options: -Wall -funbox-strict-fields build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 @@ -54,7 +57,7 @@ library , network >=2.6.2 && <2.7 , random >=1.1 , exceptions >= 0.4 - , monad-logger >=0.3 && <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 @@ -65,6 +68,7 @@ library {{title}}.Model {{title}}.MimeTypes {{title}}.Lens + {{title}}.Logging other-modules: Paths_{{pathsName}} default-language: Haskell2010 @@ -74,7 +78,7 @@ test-suite tests main-is: Test.hs hs-source-dirs: tests - ghc-options: -fno-warn-orphans + ghc-options: -Wall -fno-warn-orphans build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache deleted file mode 100644 index 23b18b7c6ce..00000000000 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/package.mustache +++ /dev/null @@ -1,87 +0,0 @@ -name: {{package}} -version: '0.1.0.0' -synopsis: Auto-generated {{package}} API Client -description: ! ' - - Client library for calling the {{package}} API based on http-client. - - host: {{host}} - - - base path: {{basePath}} - - - apiVersion: {{apiVersion}} - - - swagger version: {{swaggerVersion}} - - - {{^hideGenerationTimestamp}}Generated on: {{generatedDate}} - - - {{/hideGenerationTimestamp}}OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/{{swaggerVersion}}.md -' -category: Web -author: Author Name Here -maintainer: author.name@email.com -copyright: YEAR - AUTHOR -license: UnspecifiedLicense -homepage: https://github.com/swagger-api/swagger-codegen#readme -extra-source-files: -- README.md -- swagger.json -dependencies: -- base >=4.7 && <5.0 -- transformers >=0.4.0.0 -- mtl >=2.2.1 -- unordered-containers -ghc-options: -Wall -library: - source-dirs: lib - ghc-options: - {{#x-strictFields}}- -funbox-strict-fields{{/x-strictFields}} - exposed-modules: - - {{title}} - - {{title}}.API - - {{title}}.Client - - {{title}}.Model - - {{title}}.MimeTypes - - {{title}}.Lens - dependencies: - - aeson >=1.0 && <2.0 - - bytestring >=0.10.0 && <0.11 - - containers >=0.5.0.0 && <0.6 - - http-types >=0.8 && <0.10 - - 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 - - iso8601-time >=0.1.3 && <0.2.0 - - vector >=0.10.9 && <0.13 - - network >=2.6.2 && <2.7 - - random >=1.1 - - exceptions >= 0.4 - - monad-logger >=0.3 && <0.4 - - safe-exceptions <0.2 - - case-insensitive - - microlens >= 0.4.3 && <0.5 -tests: - tests: - main: Test.hs - source-dirs: tests - ghc-options: - - -fno-warn-orphans - dependencies: - - {{package}} - - bytestring >=0.10.0 && <0.11 - - containers - - hspec >=1.8 - - text - - time - - iso8601-time - - aeson - - semigroups - - QuickCheck 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 98d583fbd11..fbd99027bfd 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 @@ -49,6 +49,8 @@ protected void setExpectations() { times = 1; clientCodegen.setStrictFields(Boolean.valueOf(HaskellHttpClientOptionsProvider.STRICT_FIELDS)); times = 1; + clientCodegen.setUseMonadLogger(Boolean.valueOf(HaskellHttpClientOptionsProvider.USE_MONAD_LOGGER)); + times = 1; }}; } 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 d124c66ff54..4695069a53d 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 @@ -23,6 +23,7 @@ public class HaskellHttpClientOptionsProvider implements OptionsProvider { public static final String GENERATE_FORM_URLENCODED_INSTANCES = "true"; public static final String GENERATE_LENSES = "true"; public static final String GENERATE_MODEL_CONSTRUCTORS = "true"; + public static final String USE_MONAD_LOGGER = "false"; @Override public String getLanguage() { @@ -48,6 +49,7 @@ public Map createOptions() { .put(HaskellHttpClientCodegen.GENERATE_LENSES, GENERATE_LENSES) .put(HaskellHttpClientCodegen.GENERATE_MODEL_CONSTRUCTORS, GENERATE_MODEL_CONSTRUCTORS) .put(HaskellHttpClientCodegen.STRICT_FIELDS, STRICT_FIELDS) + .put(HaskellHttpClientCodegen.USE_MONAD_LOGGER, USE_MONAD_LOGGER) .build(); } diff --git a/samples/client/petstore/haskell-http-client/CONTRIBUTING.md b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md index 91fbe58305b..4d86a160843 100644 --- a/samples/client/petstore/haskell-http-client/CONTRIBUTING.md +++ b/samples/client/petstore/haskell-http-client/CONTRIBUTING.md @@ -17,9 +17,10 @@ 2. Check that the following commands complete build without any errors ```bash - (stack clean && stack haddock && stack test); - (cd ./example-app; stack clean && stack build); - (cd ./tests-integration; stack clean && stack build --no-run-tests); + (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); + (stack haddock && stack test); + (cd ./example-app; stack build); + (cd ./tests-integration; stack build --no-run-tests); ``` ### Integration Tests diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 35ac99a323a..cfbe72747d8 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -75,7 +75,8 @@ These options allow some customization of the code generation process. | generateLenses | Generate Lens optics for Models | true | true | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true | | modelDeriving | Additional classes to include in the deriving() clause of Models | | | -| strictFields | Add strictness annotations to all model fields | false | false | +| strictFields | Add strictness annotations to all model fields | true | true | +| useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | false | [1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis @@ -115,6 +116,7 @@ This library is intended to be imported qualified. | SwaggerPetstore.Model | describes models | | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) | | SwaggerPetstore.Lens | lenses for model fields | +| SwaggerPetstore.Logging | logging functions and utils | This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index 5be560eab09..54087571b77 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

configExecLoggingT: runNullLoggingT

configLoggingFilter: infoLevelFilter

withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stdout.

withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to use a MonadLogger instance which prints to stderr.

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

type ExecLoggingT = forall m. MonadIO m => forall a. LoggingT m a -> m a Source #

A block using a MonadLogger instance

Null Logger

nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () Source #

a logger which disables logging

runNullLoggingT :: LoggingT m a -> m a Source #

run the monad transformer that disables logging

Logging Filters

errorLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelError as the minimum logging level

infoLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelInfo as the minimum logging level

debugLevelFilter :: LogSource -> LogLevel -> Bool Source #

a log filter that uses LevelDebug as the minimum logging level

Logging

logNST :: (MonadIO m, MonadLogger m) => LogLevel -> Text -> Text -> m () Source #

Log a message using the current time

logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT Source #

Run a block using the configured MonadLogger instance

runExceptionLoggingT :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LoggingT m a -> m a Source #

Run a block using the configured MonadLogger instance (logs exceptions)

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: IO SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

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

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Logging

Description

Katip Logging functions

Type Aliases (for compatability)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a Katip logging block with the Log environment

type LogExec m = forall a. KatipT m a -> m a Source #

A Katip logging block

type LogContext = LogEnv Source #

A Katip Log environment

type LogLevel = Severity Source #

A Katip Log severity

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdoutLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stdout

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stderrLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stderr

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables Katip logging

Log Msg

_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () Source #

Log a katip message

Log Exceptions

logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

\ 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 e54d8c2a3d3..2e94ca821d5 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ 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

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html index 6ae120a6311..31238fe42e7 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html @@ -1,4 +1,4 @@ SwaggerPetstore

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html b/samples/client/petstore/haskell-http-client/docs/doc-index-45.html index bc2e69901ea..b075b316c57 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-45.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.API, SwaggerPetstore
\ No newline at end of file +

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

Index - -

-&-SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index f05689deb6e..7c4ba0203b2 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.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 - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ 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 b27a47d654f..0c70842879e 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

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - A

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, 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 32f2de0df2e..01798755240 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.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
debugLevelFilterSwaggerPetstore.Client, 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
errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, 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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, 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
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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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
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
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
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
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, 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 863fdeaafeb..e50148774b0 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

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configExecLoggingTSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLoggingFilterSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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 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 b2d4af4309e..50baaa0befa 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

debugLevelFilterSwaggerPetstore.Client, 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
\ No newline at end of file +

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

Index - D

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
\ 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 deleted file mode 100644 index a656d616cba..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-E.html +++ /dev/null @@ -1,4 +0,0 @@ -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

errorLevelFilterSwaggerPetstore.Client, SwaggerPetstore
ExecLoggingTSwaggerPetstore.Client, 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 41aed3abf04..07d76cf97de 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

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
\ No newline at end of file +

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

Index - F

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
\ 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 ba44a64e37d..1d4374339f9 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, 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 diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html index 907c42532e2..81e4217389e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - H)

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

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.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 cda6ec29fe0..b190c9d63e1 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

infoLevelFilterSwaggerPetstore.Client, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, 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
\ 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 800469ab06e..34300a382d5 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, SwaggerPetstore
logExceptionsSwaggerPetstore.Client, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
logNSTSwaggerPetstore.Client, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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 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 d1f062a7a9a..bfc39c25bc2 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

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
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
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
minLevelFilterSwaggerPetstore.Client, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - M

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
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
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
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, 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 46e938dcc57..09dd3efbb76 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
nullLoggerSwaggerPetstore.Client, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, 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 cef8bb7a96d..78a8242a188 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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 49fe76696ca..60ab39ed038 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 37efd6d0758..0c476d5eb64 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

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

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runExceptionLoggingTSwaggerPetstore.Client, SwaggerPetstore
runLoggingTSwaggerPetstore.Client, SwaggerPetstore
runNullLoggingTSwaggerPetstore.Client, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, 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 64ec100e604..edbcbd89f67 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.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
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 - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 a918a451f03..224de1d846b 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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 dd47647ad7d..f83238befbf 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html index b30049c4ec8..4db5785b8f0 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - W)

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

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index.html b/samples/client/petstore/haskell-http-client/docs/doc-index.html index 93b48705f11..d1c15e2898d 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index.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

\ No newline at end of file +

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

\ 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 07839448e85..828f1906ded 100644 --- a/samples/client/petstore/haskell-http-client/docs/index.html +++ b/samples/client/petstore/haskell-http-client/docs/index.html @@ -3,4 +3,4 @@ //]]>

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

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

apiVersion: 0.0.1

swagger version: 2.0

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

\ No newline at end of file +host: petstore.swagger.io

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

apiVersion: 0.0.1

swagger version: 2.0

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

\ 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 index 9f32380e5d4..fc5f19bb9ee 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

SwaggerPetstore.Client

\ No newline at end of file +

SwaggerPetstore.Client

\ 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 new file mode 100644 index 00000000000..3e0e32d8dd4 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html @@ -0,0 +1,4 @@ +SwaggerPetstore.Logging

SwaggerPetstore.Logging

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 9f192a77a35..5698d1fe765 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -30,7 +30,7 @@ bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/bin" -libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-CY2qj9sV8yi3N5R3aev4xa" +libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-Kuz5nG0AYvXTOw4CQ9HS" dynlibdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2" datadir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/share/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0" libexecdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/libexec" @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 2f8e8d83d05..6bffe8754f0 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 @@ -83,13 +83,13 @@ -- Note: Has 'Produces' instances, but no response schema -- addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = _mkRequest "POST" ["/pet"] - `setBodyParam` body + `setBodyParam` body data AddPet @@ -121,15 +121,15 @@ -- deletePet :: Integer -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = - _mkRequest "DELETE" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +deletePet petId = + _mkRequest "DELETE" ["/pet/",toPath petId] data DeletePet instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey xs) = - req `setHeader` toHeader ("api_key", xs) + applyOptionalParam req (ApiUnderscorekey xs) = + req `setHeader` toHeader ("api_key", xs) -- | @application/xml@ instance Produces DeletePet MimeXML -- | @application/json@ @@ -149,9 +149,9 @@ findPetsByStatus :: [Text] -- ^ "status" - Status values that need to be considered for filter -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = +findPetsByStatus status = _mkRequest "GET" ["/pet/findByStatus"] - `_setQuery` toQueryColl CommaSeparated ("status", Just status) + `_setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -173,9 +173,9 @@ findPetsByTags :: [Text] -- ^ "tags" - Tags to filter by -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = +findPetsByTags tags = _mkRequest "GET" ["/pet/findByTags"] - `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -199,8 +199,8 @@ getPetById :: Integer -- ^ "petId" - ID of pet to return -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = - _mkRequest "GET" ["/pet/",toPath petId] +getPetById petId = + _mkRequest "GET" ["/pet/",toPath petId] data GetPetById @@ -223,13 +223,13 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = + -> SwaggerPetstoreRequest UpdatePet contentType res +updatePet _ body = _mkRequest "PUT" ["/pet"] - `setBodyParam` body + `setBodyParam` body data UpdatePet @@ -260,25 +260,25 @@ -- Note: Has 'Produces' instances, but no response schema -- updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = - _mkRequest "POST" ["/pet/",toPath petId] + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ petId = + _mkRequest "POST" ["/pet/",toPath petId] data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = - req `_addForm` toForm ("name", xs) + applyOptionalParam req (Name xs) = + req `_addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status xs) = - req `_addForm` toForm ("status", xs) + applyOptionalParam req (Status xs) = + req `_addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -300,25 +300,25 @@ -- AuthMethod: petstore_auth -- uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') -> Integer -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +uploadFile _ petId = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] 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) + 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 + applyOptionalParam req (File xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ instance Consumes UploadFile MimeMultipartFormData @@ -341,9 +341,9 @@ -- deleteOrder :: Text -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder orderId = - _mkRequest "DELETE" ["/store/order/",toPath orderId] + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +deleteOrder orderId = + _mkRequest "DELETE" ["/store/order/",toPath orderId] data DeleteOrder @@ -384,8 +384,8 @@ getOrderById :: Integer -- ^ "orderId" - ID of pet that needs to be fetched -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById orderId = - _mkRequest "GET" ["/store/order/",toPath orderId] +getOrderById orderId = + _mkRequest "GET" ["/store/order/",toPath orderId] data GetOrderById @@ -404,13 +404,13 @@ -- -- placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => contentType -- ^ request content-type ('MimeType') -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -placeOrder _ body = + -> SwaggerPetstoreRequest PlaceOrder contentType Order +placeOrder _ body = _mkRequest "POST" ["/store/order"] - `setBodyParam` body + `setBodyParam` body data PlaceOrder @@ -435,13 +435,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -createUser _ body = + -> SwaggerPetstoreRequest CreateUser contentType res +createUser _ body = _mkRequest "POST" ["/user"] - `setBodyParam` body + `setBodyParam` body data CreateUser @@ -464,13 +464,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +createUsersWithArrayInput _ body = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithArrayInput @@ -493,13 +493,13 @@ -- Note: Has 'Produces' instances, but no response schema -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) + => contentType -- ^ request content-type ('MimeType') -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +createUsersWithListInput _ body = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body + `setBodyParam` body data CreateUsersWithListInput @@ -523,9 +523,9 @@ -- deleteUser :: Text -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser username = - _mkRequest "DELETE" ["/user/",toPath username] + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser username = + _mkRequest "DELETE" ["/user/",toPath username] data DeleteUser @@ -546,8 +546,8 @@ getUserByName :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName username = - _mkRequest "GET" ["/user/",toPath username] +getUserByName username = + _mkRequest "GET" ["/user/",toPath username] data GetUserByName @@ -569,10 +569,10 @@ :: Text -- ^ "username" - The user name for login -> Text -- ^ "password" - The password for login in clear text -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username password = +loginUser username password = _mkRequest "GET" ["/user/login"] - `_setQuery` toQuery ("username", Just username) - `_setQuery` toQuery ("password", Just password) + `_setQuery` toQuery ("username", Just username) + `_setQuery` toQuery ("password", Just password) data LoginUser -- | @application/xml@ @@ -592,7 +592,7 @@ -- Note: Has 'Produces' instances, but no response schema -- logoutUser - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res logoutUser = _mkRequest "GET" ["/user/logout"] @@ -614,15 +614,15 @@ -- Note: Has 'Produces' instances, but no response schema -- updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdateUser contentType, MimeRender contentType User) + => contentType -- ^ request content-type ('MimeType') -> Text -- ^ "username" - name that need to be deleted -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ username body = - _mkRequest "PUT" ["/user/",toPath username] + -> SwaggerPetstoreRequest UpdateUser contentType res +updateUser _ username body = + _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body + `setBodyParam` body data UpdateUser @@ -638,25 +638,25 @@ -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + 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 -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -678,7 +678,7 @@ -- * SwaggerPetstoreRequest -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , rParams :: Params -- ^ params of SwaggerPetstoreRequest @@ -686,18 +686,18 @@ deriving (P.Show) -- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod {-# INLINE rMethodL #-} -- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath {-# INLINE rUrlPathL #-} -- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} -- | Request Params @@ -710,17 +710,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 @@ -736,87 +736,87 @@ _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +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. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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 -_setAcceptHeader req accept = - case mimeType' 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 +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = - req & +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_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 -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_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 -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_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 -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -- ** 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 @@ -828,38 +828,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 #-} 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 e8979eb697f..1322b6658ca 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 @@ -17,302 +17,249 @@ import SwaggerPetstore.Model import SwaggerPetstore.API import SwaggerPetstore.MimeTypes - -import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A -import qualified Data.Aeson.Types as A -import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Control.Monad.Logger as LG - -import qualified Data.Time as TI -import qualified Data.Map as Map -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB -import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH -import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH - -import qualified Control.Exception.Safe as E --- * Config - --- | -data SwaggerPetstoreConfig = SwaggerPetstoreConfig - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. - } - --- | display the config -instance Show SwaggerPetstoreConfig where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default SwaggerPetstoreConfig --- --- configHost: --- --- @http://petstore.swagger.io/v2@ --- --- configUserAgent: --- --- @"swagger-haskell-http-client/1.0.0"@ --- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: SwaggerPetstoreConfig -newConfig = - SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} - --- | updates the config to disable logging -withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configExecLoggingT = runNullLoggingT} - --- * Dispatch - --- ** Lbs - --- | send a request returning the raw http response -dispatchLbs - :: (Produces req accept, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- ** Mime - --- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response - } - deriving (Show, Functor, Foldable, Traversable) - --- | pair of unrender/parser error and http response -data MimeError = - MimeError { - mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response - } deriving (Eq, Show) - --- | send a request returning the 'MimeResult' -dispatchMime - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runExceptionLoggingT "Client" config $ - do case mimeUnrender' accept (NH.responseBody httpResponse) of - Left s -> do - logNST LG.LevelError "Client" (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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - 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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- | dispatch an InitRequest -dispatchInitUnsafe - :: NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> InitRequest req contentType res accept -- ^ init request - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) - return res - where - logSrc = "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) - _ -> "<RequestBody>") - 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 - { unInitRequest :: NH.Request - } deriving (Show) - --- | Build an http-client 'Request' record from the supplied config and request -_toInitRequest - :: (MimeType accept, MimeType contentType) - => SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) 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) - --- | 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) - --- | 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) - --- * Logging - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - --- ** Logging - --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc - \ No newline at end of file +import SwaggerPetstore.Logging + +import qualified Control.Monad.IO.Class as P +import qualified Data.Aeson as A +import qualified Data.Aeson.Types as A +import qualified Data.Proxy as P (Proxy(..)) +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) +import Web.FormUrlEncoded as WH +import Web.HttpApiData as WH +import Control.Monad.Catch (MonadThrow) + +import qualified Data.Time as TI +import qualified Data.Map as Map +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Text.Printf as T + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Builder as BB +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Client.TLS as NH +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types.Method as NH +import qualified Network.HTTP.Types as NH +import qualified Network.HTTP.Types.URI as NH + +import qualified Control.Exception.Safe as E +-- * Config + +-- | +data SwaggerPetstoreConfig = SwaggerPetstoreConfig + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + } + +-- | display the config +instance Show SwaggerPetstoreConfig where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default SwaggerPetstoreConfig +-- +-- configHost: +-- +-- @http://petstore.swagger.io/v2@ +-- +-- configUserAgent: +-- +-- @"swagger-haskell-http-client/1.0.0"@ +-- +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +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} + +-- * Dispatch + +-- ** Lbs + +-- | send a request returning the raw http response +dispatchLbs + :: (Produces req accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- ** Mime + +-- | pair of decoded http body and http response +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + } + deriving (Show, Functor, Foldable, Traversable) + +-- | pair of unrender/parser error and http response +data MimeError = + MimeError { + mimeError :: String -- ^ unrender/parser error + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + } deriving (Eq, Show) + +-- | send a request returning the 'MimeResult' +dispatchMime + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> 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 + where + 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) + _ -> "<RequestBody>") + 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 + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery + } + outReq <- case paramsBody (rParams req1) 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) + +-- | 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) + +-- | 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) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: 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 + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 72210d62f14..eddc4581818 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -29,25 +29,25 @@ -- * 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 -- * ApiResponse -- | '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 #-} @@ -56,12 +56,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 #-} @@ -70,32 +70,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 UTCTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} -- | 'orderStatus' Lens orderStatusL :: Lens_' Order (Maybe Text) -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 #-} @@ -104,32 +104,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 Text) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus {-# INLINE petStatusL #-} @@ -138,12 +138,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 #-} @@ -152,42 +152,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 #-} diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html new file mode 100644 index 00000000000..8df26c2340a --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -0,0 +1,109 @@ +
{-|
+Module : SwaggerPetstore.Logging
+Katip Logging functions
+-}
+
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module SwaggerPetstore.Logging where
+
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
+
+import qualified Control.Exception.Safe as E
+import qualified Control.Monad.IO.Class as P
+import qualified Control.Monad.Trans.Reader as P
+import qualified Data.Text as T
+import qualified Lens.Micro as L
+import qualified System.IO as IO
+
+import qualified Katip as LG
+
+-- * Type Aliases (for compatability)
+
+-- | Runs a Katip logging block with the Log environment
+type LogExecWithContext = forall m. P.MonadIO m =>
+                                    LogContext -> LogExec m
+
+-- | A Katip logging block
+type LogExec m = forall a. LG.KatipT m a -> m a
+
+-- | A Katip Log environment
+type LogContext = LG.LogEnv
+
+-- | A Katip Log severity
+type LogLevel = LG.Severity
+
+-- * default logger
+
+-- | the default log environment
+initLogContext :: IO LogContext
+initLogContext = LG.initLogEnv "SwaggerPetstore" "dev"
+
+-- | Runs a Katip logging block with the Log environment
+runDefaultLogExecWithContext :: LogExecWithContext
+runDefaultLogExecWithContext = LG.runKatipT
+
+-- * stdout logger
+
+-- | Runs a Katip logging block with the Log environment
+stdoutLoggingExec :: LogExecWithContext
+stdoutLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stdout
+stdoutLoggingContext :: LogContext -> IO LogContext
+stdoutLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2
+    LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
+
+-- * stderr logger
+
+-- | Runs a Katip logging block with the Log environment
+stderrLoggingExec :: LogExecWithContext
+stderrLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stderr
+stderrLoggingContext :: LogContext -> IO LogContext
+stderrLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
+    LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
+
+-- * Null logger
+
+-- | Disables Katip logging
+runNullLogExec :: LogExecWithContext
+runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
+
+-- * Log Msg
+
+-- | Log a katip message
+_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
+_log src level msg = do
+  LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
+
+-- * Log Exceptions
+
+-- | re-throws exceptions after logging them
+logExceptions
+  :: (LG.Katip m, E.MonadCatch m, Applicative m)
+  => Text -> m a -> m a
+logExceptions src =
+  E.handle
+    (\(e :: E.SomeException) -> do
+       _log src LG.ErrorS ((T.pack . show) e)
+       E.throw e)
+
+-- * Log Level
+
+levelInfo :: LogLevel
+levelInfo = LG.InfoS
+
+levelError :: LogLevel
+levelError = LG.ErrorS
+
+levelDebug :: LogLevel
+levelDebug = LG.DebugS
+
+
\ 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 cec9866dffa..42836733cfd 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 @@ -54,94 +54,94 @@
-- ** 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) -- ** MimeType Instances -- | @application/json@ instance MimeType MimeJSON where - mimeTypes _ = + mimeTypes _ = [ "application" ME.// "json" ME./: ("charset", "utf-8") , "application" ME.// "json" ] -- | @application/xml@ instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" + mimeType _ = Just $ "application" ME.// "xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" + mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" + mimeType _ = Just $ "multipart" ME.// "form-data" -- | @text/plain;charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") + mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" + mimeType _ = Just $ "application" ME.// "octet-stream" 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 -- ** 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 -- | @P.id@ -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack -- | @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 -- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec -- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec @@ -151,41 +151,41 @@ -- ** 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 -- ** 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 +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent -- ** Request Consumes -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- ** Request Produces -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where \ 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 ebdc681521a..f7d6ec052bb 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 @@ -52,24 +52,24 @@ -- -- Describes the result of uploading an image resource data ApiResponse = ApiResponse - { apiResponseCode :: Maybe Int -- ^ "code" - , apiResponseType :: Maybe Text -- ^ "type" - , apiResponseMessage :: Maybe Text -- ^ "message" + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> + parseJSON = A.withObject "ApiResponse" $ \o -> ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") instance A.ToJSON ApiResponse where - toJSON ApiResponse {..} = + toJSON ApiResponse {..} = _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage ] @@ -91,21 +91,21 @@ -- -- A category for a pet data Category = Category - { categoryId :: Maybe Integer -- ^ "id" - , categoryName :: Maybe Text -- ^ "name" + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> + parseJSON = A.withObject "Category" $ \o -> Category - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") instance A.ToJSON Category where - toJSON Category {..} = + toJSON Category {..} = _omitNulls - [ "id" .= categoryId - , "name" .= categoryName + [ "id" .= categoryId + , "name" .= categoryName ] @@ -126,33 +126,33 @@ -- -- An order for a pets from the pet store data Order = Order - { orderId :: Maybe Integer -- ^ "id" - , orderPetId :: Maybe Integer -- ^ "petId" - , orderQuantity :: Maybe Int -- ^ "quantity" - , orderShipDate :: Maybe UTCTime -- ^ "shipDate" - , orderStatus :: Maybe Text -- ^ "status" - Order Status - , orderComplete :: Maybe Bool -- ^ "complete" + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" + , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> + parseJSON = A.withObject "Order" $ \o -> Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate" >>= P.mapM _readDateTime) - <*> (o .:? "status") - <*> (o .:? "complete") + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate" >>= P.mapM _readDateTime) + <*> (o .:? "status") + <*> (o .:? "complete") instance A.ToJSON Order where - toJSON Order {..} = + toJSON Order {..} = _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= P.fmap _showDateTime orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= P.fmap _showDateTime orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete ] @@ -177,33 +177,33 @@ -- -- A pet for sale in the pet store 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 Text -- ^ "status" - pet status in the store + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> + parseJSON = A.withObject "Pet" $ \o -> Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") instance A.ToJSON Pet where - toJSON Pet {..} = + toJSON Pet {..} = _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus ] @@ -212,12 +212,12 @@ :: Text -- ^ 'petName' -> [Text] -- ^ 'petPhotoUrls' -> Pet -mkPet petName petPhotoUrls = +mkPet petName petPhotoUrls = Pet { petId = Nothing , petCategory = Nothing - , petName - , petPhotoUrls + , petName + , petPhotoUrls , petTags = Nothing , petStatus = Nothing } @@ -230,21 +230,21 @@ -- -- A tag for a pet data Tag = Tag - { tagId :: Maybe Integer -- ^ "id" - , tagName :: Maybe Text -- ^ "name" + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> + parseJSON = A.withObject "Tag" $ \o -> Tag - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") instance A.ToJSON Tag where - toJSON Tag {..} = + toJSON Tag {..} = _omitNulls - [ "id" .= tagId - , "name" .= tagName + [ "id" .= tagId + , "name" .= tagName ] @@ -265,39 +265,39 @@ -- -- A User who is purchasing from the pet store 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 + { 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) instance A.FromJSON User where - parseJSON = A.withObject "User" $ \o -> + parseJSON = A.withObject "User" $ \o -> User - <$> (o .:? "id") - <*> (o .:? "username") - <*> (o .:? "firstName") - <*> (o .:? "lastName") - <*> (o .:? "email") - <*> (o .:? "password") - <*> (o .:? "phone") - <*> (o .:? "userStatus") + <$> (o .:? "id") + <*> (o .:? "username") + <*> (o .:? "firstName") + <*> (o .:? "lastName") + <*> (o .:? "email") + <*> (o .:? "password") + <*> (o .:? "phone") + <*> (o .:? "userStatus") instance A.ToJSON User where - toJSON User {..} = + toJSON User {..} = _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus ] @@ -323,55 +323,55 @@ -- | 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 -_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 _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing -_emptyToNothing x = x +_emptyToNothing x = x {-# INLINE _emptyToNothing #-} -_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 -- | @_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 ~ UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} -_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 #-} -- * Date Formatting -- | @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 #-} \ No newline at end of file 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 2a5910ad33e..25b9e55eff2 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -8,11 +8,13 @@ , module SwaggerPetstore.Model , module SwaggerPetstore.MimeTypes , module SwaggerPetstore.Lens - ) where - -import SwaggerPetstore.API -import SwaggerPetstore.Client -import SwaggerPetstore.Model -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens - \ No newline at end of file + , module SwaggerPetstore.Logging + ) where + +import SwaggerPetstore.API +import SwaggerPetstore.Client +import SwaggerPetstore.Model +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens +import SwaggerPetstore.Logging + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index 50432703ab5..717d03643f0 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -13,19 +13,22 @@ import qualified SwaggerPetstore as S import Data.Monoid ((<>)) +import System.Environment (getEnvironment) + -- * MAIN main :: IO () main = do + env <- getEnvironment + mgr <- NH.newManager NH.defaultManagerSettings - -- print log messages to sdtout - let config = - S.withStdoutLogging - S.newConfig { S.configHost = "http://0.0.0.0/v2" - -- , S.configLoggingFilter = S.debugLevelFilter - } + config0 <- S.withStdoutLogging =<< S.newConfig + + let config = case lookup "HOST" env of + Just h -> config0 { S.configHost = BCL.pack h } + _ -> config0 putStrLn "******** CONFIG ********" putStrLn (show config) diff --git a/samples/client/petstore/haskell-http-client/example-app/debugLog.txt b/samples/client/petstore/haskell-http-client/example-app/debugLog.txt deleted file mode 100644 index 45de7fc52a1..00000000000 --- a/samples/client/petstore/haskell-http-client/example-app/debugLog.txt +++ /dev/null @@ -1,95 +0,0 @@ -******** CONFIG ******** -{ configHost = "http://0.0.0.0/v2", configUserAgent = "swagger-haskell-http-client/1.0.0", ..} -******** Pet operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:POST 0.0.0.0/v2/pet -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"photoUrls":["url1","url2"],"name":"name"} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":30,\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[]}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/30 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/30) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":30,\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[]}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -getPetById: found pet: Pet {petId = Just 30, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "[{\"id\":1,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":2,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"available\"},{\"id\":3,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"pending\"},{\"id\":4,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":5,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"sold\"},{\"id\":6,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"pending\"},{\"id\":7,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":8,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 2\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag2\"},{\"id\":2,\"name\":\"tag3\"}],\"status\":\"available\"},{\"id\":9,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 3\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"available\"},{\"id\":10,\"category\":{\"id\":3,\"name\":\"Rabbits\"},\"name\":\"Rabbit 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag3\"},{\"id\":2,\"name\":\"tag4\"}],\"status\":\"available\"},{\"id\":25,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"name\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"available\"},{\"id\":26,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"petName\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"pending\"},{\"id\":27,\"category\":{\"id\":3,\"name\":\"catname\"},\"name\":\"petName\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[],\"status\":\"pending\"}]", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -findPetsByStatus: found 13 pets -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "[{\"id\":1,\"category\":{\"id\":2,\"name\":\"Cats\"},\"name\":\"Cat 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":4,\"category\":{\"id\":1,\"name\":\"Dogs\"},\"name\":\"Dog 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"},{\"id\":7,\"category\":{\"id\":4,\"name\":\"Lions\"},\"name\":\"Lion 1\",\"photoUrls\":[\"url1\",\"url2\"],\"tags\":[{\"id\":1,\"name\":\"tag1\"},{\"id\":2,\"name\":\"tag2\"}],\"status\":\"available\"}]", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -findPetsByTags: found 3 pets -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC REQ:PUT 0.0.0.0/v2/pet -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:03UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/xml")] Body={"photoUrls":["url1","url2"],"status":"available","category":{"name":"catname","id":3},"name":"name","id":30,"tags":[]} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (PUT 0.0.0.0/v2/pet) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/xml"),("Content-Length","251"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "3catname30nameurl1url2available", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/pet/30 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/x-www-form-urlencoded"),("accept","application/json;charset=utf-8")] Body=status=pending&name=petName -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/pet/30/uploadImage -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("Content-Type","multipart/form-data; boundary=----WebKitFormBoundarytMtEWXPCyyC5CTsF"),("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30/uploadImage) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"code\":200,\"type\":\"unknown\",\"message\":\"additionalMetadata: a package.yaml file\\nFile uploaded to ./package.yaml, 893 bytes\"}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 893 bytes"} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/pet/30 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8"),("api_key","api key")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/30) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -******** Store operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/store/inventory -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8"),("api_key","special-key")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"sold\":1,\"pending\":4,\"available\":8}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -getInventoryRequest: found 3 results -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/store/order -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"quantity":210,"id":21,"shipDate":"2017-09-02T19:52:04.306Z"} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/store/order) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"petId\":0,\"quantity\":210,\"shipDate\":\"2017-09-02T19:52:04.306+0000\",\"complete\":false}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:52:04.306 UTC, orderStatus = Nothing, orderComplete = Just False} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/store/order/21 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"petId\":0,\"quantity\":210,\"shipDate\":\"2017-09-02T19:52:04.306+0000\",\"complete\":false}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -getOrderById: found order: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:52:04.306 UTC, orderStatus = Nothing, orderComplete = Just False} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/store/order/21 -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -******** User operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"username":"hsusername","id":21} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user/createWithArray -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8")] Body=[{"username":"hsusername*","id":22},{"username":"hsusername**","id":23},{"username":"hsusername***","id":24},{"username":"hsusername****","id":25},{"username":"hsusername*****","id":26},{"username":"hsusername******","id":27},{"username":"hsusername*******","id":28},{"username":"hsusername********","id":29}] -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:POST 0.0.0.0/v2/user/createWithList -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8")] Body=[{"username":"hsusername*","id":22},{"username":"hsusername**","id":23},{"username":"hsusername***","id":24},{"username":"hsusername****","id":25},{"username":"hsusername*****","id":26},{"username":"hsusername******","id":27},{"username":"hsusername*******","id":28},{"username":"hsusername********","id":29}] -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/hsusername -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "{\"id\":21,\"username\":\"hsusername\",\"userStatus\":0}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -getUserByName: found user: User {userId = Just 21, userUsername = Just "hsusername", userFirstName = Nothing, userLastName = Nothing, userEmail = Nothing, userPassword = Nothing, userPhone = Nothing, userUserStatus = Just 0} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("X-Expires-After","Sat Sep 02 15:52:04 CDT 2017"),("X-Rate-Limit","5000"),("Content-Type","application/json"),("Transfer-Encoding","chunked"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "logged in user session:1504381924767", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -loginUser: logged in user session:1504381924767 -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:PUT 0.0.0.0/v2/user/hsusername -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("content-type","application/json;charset=utf-8"),("accept","application/json;charset=utf-8")] Body={"email":"xyz@example.com","username":"hsusername","id":21} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:GET 0.0.0.0/v2/user/logout -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/logout) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC REQ:DELETE 0.0.0.0/v2/user/hsusername -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Headers=[("User-Agent","swagger-haskell-http-client/1.0.0"),("accept","application/json;charset=utf-8")] Body= -[Info#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername) -[Debug#SwaggerPetstore/Client] 2017-09-02T19:52:04UTC Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Origin","*"),("Access-Control-Allow-Methods","GET, POST, DELETE, PUT"),("Access-Control-Allow-Headers","Content-Type, api_key, Authorization"),("Content-Type","application/json"),("Content-Length","0"),("Server","Jetty(8.1.11.v20130520)")], responseBody = "", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose} -******** END ******** diff --git a/samples/client/petstore/haskell-http-client/example-app/infoLog.txt b/samples/client/petstore/haskell-http-client/example-app/infoLog.txt index fa386df6764..a2da7f6e1c6 100644 --- a/samples/client/petstore/haskell-http-client/example-app/infoLog.txt +++ b/samples/client/petstore/haskell-http-client/example-app/infoLog.txt @@ -1,55 +1,55 @@ ******** CONFIG ******** { configHost = "http://0.0.0.0/v2", configUserAgent = "swagger-haskell-http-client/1.0.0", ..} ******** Pet operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:POST 0.0.0.0/v2/pet -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/30 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/30) -getPetById: found pet: Pet {petId = Just 30, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing} -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold) -findPetsByStatus: found 13 pets -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/pet/11 +getPetById: found pet: Pet {petId = Just 11, petCategory = Nothing, petName = "name", petPhotoUrls = ["url1","url2"], petTags = Just [], petStatus = Nothing} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold +findPetsByStatus: found 10 pets +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByStatus?status=available%2Cpending%2Csold) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1 findPetsByTags: found 3 pets -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:PUT 0.0.0.0/v2/pet -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC RES:statusCode=200 (PUT 0.0.0.0/v2/pet) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:49UTC REQ:POST 0.0.0.0/v2/pet/30 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/pet/30/uploadImage -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/pet/30/uploadImage) -uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 893 bytes"} -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/pet/30 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/30) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/pet/findByTags?tags=name%2Ctag1) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:PUT 0.0.0.0/v2/pet +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (PUT 0.0.0.0/v2/pet) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet/11 +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/pet/11/uploadImage +uploadFile: ApiResponse {apiResponseCode = Just 200, apiResponseType = Just "unknown", apiResponseMessage = Just "additionalMetadata: a package.yaml file\nFile uploaded to ./package.yaml, 942 bytes"} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/pet/11/uploadImage) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:DELETE 0.0.0.0/v2/pet/11 ******** Store operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/store/inventory -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/pet/11) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/store/inventory getInventoryRequest: found 3 results -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/store/order -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/store/order) -placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:51:50.222 UTC, orderStatus = Nothing, orderComplete = Just False} -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/store/order/21 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21) -getOrderById: found order: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-02 19:51:50.222 UTC, orderStatus = Nothing, orderComplete = Just False} -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/store/order/21 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/store/inventory) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/store/order +placeOrderResult: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-12 03:59:19.571 UTC, orderStatus = Nothing, orderComplete = Just False} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/store/order) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/store/order/21 +getOrderById: found order: Order {orderId = Just 21, orderPetId = Just 0, orderQuantity = Just 210, orderShipDate = Just 2017-09-12 03:59:19.571 UTC, orderStatus = Nothing, orderComplete = Just False} +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/store/order/21) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:DELETE 0.0.0.0/v2/store/order/21 ******** User operations ******** -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user/createWithArray -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:POST 0.0.0.0/v2/user/createWithList -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/hsusername -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/store/order/21) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user/createWithArray +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithArray) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:POST 0.0.0.0/v2/user/createWithList +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (POST 0.0.0.0/v2/user/createWithList) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/user/hsusername getUserByName: found user: User {userId = Just 21, userUsername = Just "hsusername", userFirstName = Nothing, userLastName = Nothing, userEmail = Nothing, userPassword = Nothing, userPhone = Nothing, userUserStatus = Just 0} -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername) -loginUser: logged in user session:1504381910612 -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:PUT 0.0.0.0/v2/user/hsusername -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:GET 0.0.0.0/v2/user/logout -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (GET 0.0.0.0/v2/user/logout) -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC REQ:DELETE 0.0.0.0/v2/user/hsusername -[Info#SwaggerPetstore/Client] 2017-09-02T19:51:50UTC RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/user/login?password=password1&username=hsusername +loginUser: logged in user session:1505188759581 +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/login?password=password1&username=hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:PUT 0.0.0.0/v2/user/hsusername +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (PUT 0.0.0.0/v2/user/hsusername) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:GET 0.0.0.0/v2/user/logout +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (GET 0.0.0.0/v2/user/logout) +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] REQ:DELETE 0.0.0.0/v2/user/hsusername ******** END ******** +[2017-09-12 03:59:19][SwaggerPetstore.Client][Info][kestrel][18748][ThreadId 1] RES:statusCode=200 (DELETE 0.0.0.0/v2/user/hsusername) diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index edfeec4b1de..cb5e7c140c1 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -8,6 +8,7 @@ module SwaggerPetstore , module SwaggerPetstore.Model , module SwaggerPetstore.MimeTypes , module SwaggerPetstore.Lens + , module SwaggerPetstore.Logging ) where import SwaggerPetstore.API @@ -15,3 +16,4 @@ import SwaggerPetstore.Client import SwaggerPetstore.Model import SwaggerPetstore.MimeTypes import SwaggerPetstore.Lens +import SwaggerPetstore.Logging diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index 681ecb28607..ade235e502c 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -17,6 +17,7 @@ module SwaggerPetstore.Client where import SwaggerPetstore.Model import SwaggerPetstore.API import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Logging import qualified Control.Monad.IO.Class as P import qualified Data.Aeson as A @@ -30,8 +31,6 @@ import Web.FormUrlEncoded as WH import Web.HttpApiData as WH import Control.Monad.Catch (MonadThrow) -import qualified Control.Monad.Logger as LG - import qualified Data.Time as TI import qualified Data.Map as Map import qualified Data.Text as T @@ -57,8 +56,8 @@ import qualified Control.Exception.Safe as E data SwaggerPetstoreConfig = SwaggerPetstoreConfig { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configExecLoggingT :: ExecLoggingT -- ^ Run a block using a MonadLogger instance - , configLoggingFilter :: LG.LogSource -> LG.LogLevel -> Bool -- ^ Only log messages passing the given predicate function. + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger } -- | display the config @@ -79,29 +78,29 @@ instance Show SwaggerPetstoreConfig where -- -- @"swagger-haskell-http-client/1.0.0"@ -- --- configExecLoggingT: 'runNullLoggingT' --- --- configLoggingFilter: 'infoLevelFilter' -newConfig :: SwaggerPetstoreConfig -newConfig = - SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configExecLoggingT = runNullLoggingT - , configLoggingFilter = infoLevelFilter - } - --- | updates the config to use a MonadLogger instance which prints to stdout. -withStdoutLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStdoutLogging p = p { configExecLoggingT = LG.runStdoutLoggingT} - --- | updates the config to use a MonadLogger instance which prints to stderr. -withStderrLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withStderrLogging p = p { configExecLoggingT = LG.runStderrLoggingT} +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + } + +withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +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 { configExecLoggingT = runNullLoggingT} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * Dispatch @@ -146,10 +145,10 @@ dispatchMime dispatchMime manager config request accept = do httpResponse <- dispatchLbs manager config request accept parsedResult <- - runExceptionLoggingT "Client" config $ + runConfigLogWithExceptions "Client" config $ do case mimeUnrender' accept (NH.responseBody httpResponse) of Left s -> do - logNST LG.LevelError "Client" (T.pack s) + _log "Client" levelError (T.pack s) pure (Left (MimeError s httpResponse)) Right r -> pure (Right r) return (MimeResult parsedResult httpResponse) @@ -187,15 +186,15 @@ dispatchInitUnsafe -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response dispatchInitUnsafe manager config (InitRequest req) = do - runExceptionLoggingT logSrc config $ - do logNST LG.LevelInfo logSrc requestLogMsg - logNST LG.LevelDebug logSrc requestDbgLogMsg + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg res <- P.liftIO $ NH.httpLbs req manager - logNST LG.LevelInfo logSrc (responseLogMsg res) - logNST LG.LevelDebug logSrc ((T.pack . show) res) + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) return res where - logSrc = "Client" + src = "Client" endpoint = T.pack $ BC.unpack $ @@ -250,68 +249,16 @@ modifyInitRequest (InitRequest req) f = 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 - --- | A block using a MonadLogger instance -type ExecLoggingT = forall m. P.MonadIO m => - forall a. LG.LoggingT m a -> m a - --- ** Null Logger - --- | a logger which disables logging -nullLogger :: LG.Loc -> LG.LogSource -> LG.LogLevel -> LG.LogStr -> IO () -nullLogger _ _ _ _ = return () - --- | run the monad transformer that disables logging -runNullLoggingT :: LG.LoggingT m a -> m a -runNullLoggingT = (`LG.runLoggingT` nullLogger) - --- ** Logging Filters - --- | a log filter that uses 'LevelError' as the minimum logging level -errorLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -errorLevelFilter = minLevelFilter LG.LevelError - --- | a log filter that uses 'LevelInfo' as the minimum logging level -infoLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -infoLevelFilter = minLevelFilter LG.LevelInfo - --- | a log filter that uses 'LevelDebug' as the minimum logging level -debugLevelFilter :: LG.LogSource -> LG.LogLevel -> Bool -debugLevelFilter = minLevelFilter LG.LevelDebug - -minLevelFilter :: LG.LogLevel -> LG.LogSource -> LG.LogLevel -> Bool -minLevelFilter l _ l' = l' >= l - -- ** Logging --- | Log a message using the current time -logNST :: (P.MonadIO m, LG.MonadLogger m) => LG.LogLevel -> Text -> Text -> m () -logNST level src msg = do - now <- P.liftIO (formatTimeLog <$> TI.getCurrentTime) - LG.logOtherNS sourceLog level (now <> " " <> msg) - where - sourceLog = "SwaggerPetstore/" <> src - formatTimeLog = - T.pack . TI.formatTime TI.defaultTimeLocale "%Y-%m-%dT%H:%M:%S%Z" - --- | re-throws exceptions after logging them -logExceptions - :: (LG.MonadLogger m, E.MonadCatch m, P.MonadIO m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - logNST LG.LevelError src ((T.pack . show) e) - E.throw e) - --- | Run a block using the configured MonadLogger instance -runLoggingT :: SwaggerPetstoreConfig -> ExecLoggingT -runLoggingT config = - configExecLoggingT config . LG.filterLogger (configLoggingFilter config) - --- | Run a block using the configured MonadLogger instance (logs exceptions) -runExceptionLoggingT +-- | Run a block using the configured logger instance +runConfigLog + :: 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 -> LG.LoggingT m a -> m a -runExceptionLoggingT logSrc config = runLoggingT config . logExceptions logSrc + => T.Text -> SwaggerPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs new file mode 100644 index 00000000000..7ab4bac9186 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs @@ -0,0 +1,108 @@ +{-| +Module : SwaggerPetstore.Logging +Katip Logging functions +-} + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module SwaggerPetstore.Logging where + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import qualified Katip as LG + +-- * Type Aliases (for compatability) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A Katip logging block +type LogExec m = forall a. LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "SwaggerPetstore" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + 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 d14764e85a8..b1c1399a556 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -52,9 +52,9 @@ import qualified Prelude as P -- -- Describes the result of uploading an image resource data ApiResponse = ApiResponse - { apiResponseCode :: Maybe Int -- ^ "code" - , apiResponseType :: Maybe Text -- ^ "type" - , apiResponseMessage :: Maybe Text -- ^ "message" + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON ApiResponse where @@ -91,8 +91,8 @@ mkApiResponse = -- -- A category for a pet data Category = Category - { categoryId :: Maybe Integer -- ^ "id" - , categoryName :: Maybe Text -- ^ "name" + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Category where @@ -126,12 +126,12 @@ mkCategory = -- -- An order for a pets from the pet store data Order = Order - { orderId :: Maybe Integer -- ^ "id" - , orderPetId :: Maybe Integer -- ^ "petId" - , orderQuantity :: Maybe Int -- ^ "quantity" - , orderShipDate :: Maybe UTCTime -- ^ "shipDate" - , orderStatus :: Maybe Text -- ^ "status" - Order Status - , orderComplete :: Maybe Bool -- ^ "complete" + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" + , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Order where @@ -177,12 +177,12 @@ mkOrder = -- -- A pet for sale in the pet store 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 Text -- ^ "status" - pet status in the store + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Pet where @@ -230,8 +230,8 @@ mkPet petName petPhotoUrls = -- -- A tag for a pet data Tag = Tag - { tagId :: Maybe Integer -- ^ "id" - , tagName :: Maybe Text -- ^ "name" + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" } deriving (P.Show,P.Eq,P.Typeable) instance A.FromJSON Tag where @@ -265,14 +265,14 @@ mkTag = -- -- A User who is purchasing from the pet store 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 + { 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) instance A.FromJSON User where @@ -374,4 +374,4 @@ _readDate = _showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} \ No newline at end of file +{-# INLINE _showDate #-} diff --git a/samples/client/petstore/haskell-http-client/package.yaml b/samples/client/petstore/haskell-http-client/package.yaml deleted file mode 100644 index 4ec0778ce1a..00000000000 --- a/samples/client/petstore/haskell-http-client/package.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: swagger-petstore -version: '0.1.0.0' -synopsis: Auto-generated swagger-petstore API Client -description: ! ' - - Client library for calling the swagger-petstore API based on http-client. - - host: petstore.swagger.io - - - base path: http://petstore.swagger.io/v2 - - - apiVersion: 0.0.1 - - - swagger version: 2.0 - - - OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md -' -category: Web -author: Author Name Here -maintainer: author.name@email.com -copyright: YEAR - AUTHOR -license: UnspecifiedLicense -homepage: https://github.com/swagger-api/swagger-codegen#readme -extra-source-files: -- README.md -- swagger.json -dependencies: -- base >=4.7 && <5.0 -- transformers >=0.4.0.0 -- mtl >=2.2.1 -- unordered-containers -ghc-options: -Wall -library: - source-dirs: lib - ghc-options: - - exposed-modules: - - SwaggerPetstore - - SwaggerPetstore.API - - SwaggerPetstore.Client - - SwaggerPetstore.Model - - SwaggerPetstore.MimeTypes - - SwaggerPetstore.Lens - dependencies: - - aeson >=1.0 && <2.0 - - bytestring >=0.10.0 && <0.11 - - containers >=0.5.0.0 && <0.6 - - http-types >=0.8 && <0.10 - - 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 - - iso8601-time >=0.1.3 && <0.2.0 - - vector >=0.10.9 && <0.13 - - network >=2.6.2 && <2.7 - - random >=1.1 - - exceptions >= 0.4 - - monad-logger >=0.3 && <0.4 - - safe-exceptions <0.2 - - case-insensitive - - microlens >= 0.4.3 && <0.5 -tests: - tests: - main: Test.hs - source-dirs: tests - ghc-options: - - -fno-warn-orphans - dependencies: - - swagger-petstore - - bytestring >=0.10.0 && <0.11 - - containers - - hspec >=1.8 - - text - - time - - iso8601-time - - aeson - - semigroups - - QuickCheck diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index e8e4b538161..fec52d34259 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -7,6 +7,7 @@ version: 0.1.0.0 synopsis: Auto-generated swagger-petstore API Client description: . Client library for calling the swagger-petstore API based on http-client. + . host: petstore.swagger.io . base path: http://petstore.swagger.io/v2 @@ -15,7 +16,8 @@ description: . . swagger version: 2.0 . - OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md + OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md + . category: Web homepage: https://github.com/swagger-api/swagger-codegen#readme author: Author Name Here @@ -32,7 +34,7 @@ extra-source-files: library hs-source-dirs: lib - ghc-options: -Wall + ghc-options: -Wall -funbox-strict-fields build-depends: base >=4.7 && <5.0 , transformers >=0.4.0.0 @@ -53,7 +55,7 @@ library , network >=2.6.2 && <2.7 , random >=1.1 , exceptions >= 0.4 - , monad-logger >=0.3 && <0.4 + , katip >=0.4 && < 0.6 , safe-exceptions <0.2 , case-insensitive , microlens >= 0.4.3 && <0.5 @@ -64,6 +66,7 @@ library SwaggerPetstore.Model SwaggerPetstore.MimeTypes SwaggerPetstore.Lens + SwaggerPetstore.Logging other-modules: Paths_swagger_petstore default-language: Haskell2010 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml index 44bc8174414..211e8abb300 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/package.yaml +++ b/samples/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -29,7 +29,6 @@ dependencies: - text >=0.11 && <1.3 - time >=1.5 && <1.9 - vector >=0.10.9 && <0.13 -- monad-logger >=0.3 && <0.4 - exceptions >= 0.4 - case-insensitive - safe-exceptions <0.2 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal index 98c3670066a..4da1e31bab9 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/swagger-petstore-tests-integration.cabal @@ -40,7 +40,6 @@ test-suite tests , text >=0.11 && <1.3 , time >=1.5 && <1.9 , vector >=0.10.9 && <0.13 - , monad-logger >=0.3 && <0.4 , exceptions >= 0.4 , case-insensitive , safe-exceptions <0.2 diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index b1fe57c0793..36663eb5fd3 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -53,10 +53,8 @@ main = do Just h -> BCL.pack h _ -> "http://0.0.0.0/v2" - let config = - S.withStdoutLogging - S.newConfig { S.configHost = host } - -- , S.configLoggingFilter = S.debugLevelFilter } + config0 <- S.withStdoutLogging =<< S.newConfig + let config = config0 { S.configHost = host } putStrLn "\n******** CONFIG ********" putStrLn (show config) From f3c41e866cd65296ddc9fa8a2de575de62d25fc2 Mon Sep 17 00:00:00 2001 From: Mehdy Bohlool Date: Mon, 18 Sep 2017 10:25:33 -0700 Subject: [PATCH 028/197] [Python] Add configuration.{connection_pool_maxsize, assert_hostname} (#6508) * Backport kubernetes client features: - assert_hostname - connection_pool_maxsize - cleanups * Update petstore sample --- .../main/resources/python/api_client.mustache | 6 +- .../resources/python/configuration.mustache | 13 +- .../src/main/resources/python/rest.mustache | 18 +- .../client/petstore/python-asyncio/.gitignore | 64 ++ .../python-asyncio/.swagger-codegen-ignore | 23 + .../python-asyncio/.swagger-codegen/VERSION | 1 + .../petstore/python-asyncio/.travis.yml | 14 + .../client/petstore/python-asyncio/README.md | 176 ++++ .../docs/AdditionalPropertiesClass.md | 11 + .../petstore/python-asyncio/docs/Animal.md | 11 + .../python-asyncio/docs/AnimalFarm.md | 9 + .../python-asyncio/docs/AnotherFakeApi.md | 57 ++ .../python-asyncio/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../python-asyncio/docs/ArrayOfNumberOnly.md | 10 + .../petstore/python-asyncio/docs/ArrayTest.md | 12 + .../python-asyncio/docs/Capitalization.md | 15 + .../petstore/python-asyncio/docs/Cat.md | 10 + .../petstore/python-asyncio/docs/Category.md | 11 + .../python-asyncio/docs/ClassModel.md | 10 + .../petstore/python-asyncio/docs/Client.md | 10 + .../petstore/python-asyncio/docs/Dog.md | 10 + .../python-asyncio/docs/EnumArrays.md | 11 + .../petstore/python-asyncio/docs/EnumClass.md | 9 + .../petstore/python-asyncio/docs/EnumTest.md | 13 + .../petstore/python-asyncio/docs/FakeApi.md | 440 +++++++++ .../docs/FakeClassnameTags123Api.md | 61 ++ .../python-asyncio/docs/FormatTest.md | 22 + .../python-asyncio/docs/HasOnlyReadOnly.md | 11 + .../petstore/python-asyncio/docs/List.md | 10 + .../petstore/python-asyncio/docs/MapTest.md | 11 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../python-asyncio/docs/Model200Response.md | 11 + .../python-asyncio/docs/ModelReturn.md | 10 + .../petstore/python-asyncio/docs/Name.md | 13 + .../python-asyncio/docs/NumberOnly.md | 10 + .../petstore/python-asyncio/docs/Order.md | 15 + .../python-asyncio/docs/OuterBoolean.md | 9 + .../python-asyncio/docs/OuterComposite.md | 12 + .../petstore/python-asyncio/docs/OuterEnum.md | 9 + .../python-asyncio/docs/OuterNumber.md | 9 + .../python-asyncio/docs/OuterString.md | 9 + .../petstore/python-asyncio/docs/Pet.md | 15 + .../petstore/python-asyncio/docs/PetApi.md | 440 +++++++++ .../python-asyncio/docs/ReadOnlyFirst.md | 11 + .../python-asyncio/docs/SpecialModelName.md | 10 + .../petstore/python-asyncio/docs/StoreApi.md | 205 ++++ .../petstore/python-asyncio/docs/Tag.md | 11 + .../petstore/python-asyncio/docs/User.md | 17 + .../petstore/python-asyncio/docs/UserApi.md | 394 ++++++++ .../petstore/python-asyncio/git_push.sh | 52 + .../python-asyncio/petstore_api/__init__.py | 65 ++ .../python-asyncio/petstore_api/api_client.py | 628 +++++++++++++ .../petstore_api/apis/__init__.py | 9 + .../petstore_api/apis/another_fake_api.py | 134 +++ .../petstore_api/apis/fake_api.py | 886 ++++++++++++++++++ .../apis/fake_classname_tags_123_api.py | 132 +++ .../petstore_api/apis/pet_api.py | 826 ++++++++++++++++ .../petstore_api/apis/store_api.py | 408 ++++++++ .../petstore_api/apis/user_api.py | 794 ++++++++++++++++ .../petstore_api/configuration.py | 254 +++++ .../petstore_api/models/__init__.py | 52 + .../models/additional_properties_class.py | 150 +++ .../petstore_api/models/animal.py | 166 ++++ .../petstore_api/models/animal_farm.py | 100 ++ .../petstore_api/models/api_response.py | 176 ++++ .../models/array_of_array_of_number_only.py | 124 +++ .../models/array_of_number_only.py | 124 +++ .../petstore_api/models/array_test.py | 176 ++++ .../petstore_api/models/capitalization.py | 256 +++++ .../python-asyncio/petstore_api/models/cat.py | 124 +++ .../petstore_api/models/category.py | 150 +++ .../petstore_api/models/class_model.py | 124 +++ .../petstore_api/models/client.py | 124 +++ .../python-asyncio/petstore_api/models/dog.py | 124 +++ .../petstore_api/models/enum_arrays.py | 163 ++++ .../petstore_api/models/enum_class.py | 106 +++ .../petstore_api/models/enum_test.py | 220 +++++ .../petstore_api/models/format_test.py | 468 +++++++++ .../petstore_api/models/has_only_read_only.py | 150 +++ .../petstore_api/models/list.py | 124 +++ .../petstore_api/models/map_test.py | 157 ++++ ...perties_and_additional_properties_class.py | 176 ++++ .../petstore_api/models/model_200_response.py | 150 +++ .../petstore_api/models/model_return.py | 124 +++ .../petstore_api/models/name.py | 203 ++++ .../petstore_api/models/number_only.py | 124 +++ .../petstore_api/models/order.py | 262 ++++++ .../petstore_api/models/outer_boolean.py | 100 ++ .../petstore_api/models/outer_composite.py | 176 ++++ .../petstore_api/models/outer_enum.py | 106 +++ .../petstore_api/models/outer_number.py | 100 ++ .../petstore_api/models/outer_string.py | 100 ++ .../python-asyncio/petstore_api/models/pet.py | 264 ++++++ .../petstore_api/models/read_only_first.py | 150 +++ .../petstore_api/models/special_model_name.py | 124 +++ .../python-asyncio/petstore_api/models/tag.py | 150 +++ .../petstore_api/models/user.py | 308 ++++++ .../python-asyncio/petstore_api/rest.py | 251 +++++ .../petstore/python-asyncio/requirements.txt | 5 + .../client/petstore/python-asyncio/setup.py | 42 + .../python-asyncio/test-requirements.txt | 5 + .../petstore/python-asyncio/test/__init__.py | 0 .../test/test_additional_properties_class.py | 44 + .../python-asyncio/test/test_animal.py | 44 + .../python-asyncio/test/test_animal_farm.py | 44 + .../test/test_another_fake_api.py | 44 + .../python-asyncio/test/test_api_response.py | 44 + .../test_array_of_array_of_number_only.py | 44 + .../test/test_array_of_number_only.py | 44 + .../python-asyncio/test/test_array_test.py | 44 + .../test/test_capitalization.py | 44 + .../petstore/python-asyncio/test/test_cat.py | 44 + .../python-asyncio/test/test_category.py | 44 + .../python-asyncio/test/test_class_model.py | 44 + .../python-asyncio/test/test_client.py | 44 + .../petstore/python-asyncio/test/test_dog.py | 44 + .../python-asyncio/test/test_enum_arrays.py | 44 + .../python-asyncio/test/test_enum_class.py | 44 + .../python-asyncio/test/test_enum_test.py | 44 + .../python-asyncio/test/test_fake_api.py | 100 ++ .../test/test_fake_classname_tags_123_api.py | 44 + .../python-asyncio/test/test_format_test.py | 44 + .../test/test_has_only_read_only.py | 44 + .../petstore/python-asyncio/test/test_list.py | 44 + .../python-asyncio/test/test_map_test.py | 44 + ...perties_and_additional_properties_class.py | 44 + .../test/test_model_200_response.py | 44 + .../python-asyncio/test/test_model_return.py | 44 + .../petstore/python-asyncio/test/test_name.py | 44 + .../python-asyncio/test/test_number_only.py | 44 + .../python-asyncio/test/test_order.py | 44 + .../python-asyncio/test/test_outer_boolean.py | 44 + .../test/test_outer_composite.py | 44 + .../python-asyncio/test/test_outer_enum.py | 44 + .../python-asyncio/test/test_outer_number.py | 44 + .../python-asyncio/test/test_outer_string.py | 44 + .../petstore/python-asyncio/test/test_pet.py | 44 + .../python-asyncio/test/test_pet_api.py | 100 ++ .../test/test_read_only_first.py | 44 + .../test/test_special_model_name.py | 44 + .../python-asyncio/test/test_store_api.py | 68 ++ .../petstore/python-asyncio/test/test_tag.py | 44 + .../petstore/python-asyncio/test/test_user.py | 44 + .../python-asyncio/test/test_user_api.py | 100 ++ .../client/petstore/python-asyncio/tox.ini | 10 + .../client/petstore/python-tornado/.gitignore | 64 ++ .../python-tornado/.swagger-codegen-ignore | 23 + .../python-tornado/.swagger-codegen/VERSION | 1 + .../petstore/python-tornado/.travis.yml | 14 + .../client/petstore/python-tornado/README.md | 176 ++++ .../docs/AdditionalPropertiesClass.md | 11 + .../petstore/python-tornado/docs/Animal.md | 11 + .../python-tornado/docs/AnimalFarm.md | 9 + .../python-tornado/docs/AnotherFakeApi.md | 57 ++ .../python-tornado/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../python-tornado/docs/ArrayOfNumberOnly.md | 10 + .../petstore/python-tornado/docs/ArrayTest.md | 12 + .../python-tornado/docs/Capitalization.md | 15 + .../petstore/python-tornado/docs/Cat.md | 10 + .../petstore/python-tornado/docs/Category.md | 11 + .../python-tornado/docs/ClassModel.md | 10 + .../petstore/python-tornado/docs/Client.md | 10 + .../petstore/python-tornado/docs/Dog.md | 10 + .../python-tornado/docs/EnumArrays.md | 11 + .../petstore/python-tornado/docs/EnumClass.md | 9 + .../petstore/python-tornado/docs/EnumTest.md | 13 + .../petstore/python-tornado/docs/FakeApi.md | 440 +++++++++ .../docs/FakeClassnameTags123Api.md | 61 ++ .../python-tornado/docs/FormatTest.md | 22 + .../python-tornado/docs/HasOnlyReadOnly.md | 11 + .../petstore/python-tornado/docs/List.md | 10 + .../petstore/python-tornado/docs/MapTest.md | 11 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../python-tornado/docs/Model200Response.md | 11 + .../python-tornado/docs/ModelReturn.md | 10 + .../petstore/python-tornado/docs/Name.md | 13 + .../python-tornado/docs/NumberOnly.md | 10 + .../petstore/python-tornado/docs/Order.md | 15 + .../python-tornado/docs/OuterBoolean.md | 9 + .../python-tornado/docs/OuterComposite.md | 12 + .../petstore/python-tornado/docs/OuterEnum.md | 9 + .../python-tornado/docs/OuterNumber.md | 9 + .../python-tornado/docs/OuterString.md | 9 + .../petstore/python-tornado/docs/Pet.md | 15 + .../petstore/python-tornado/docs/PetApi.md | 440 +++++++++ .../python-tornado/docs/ReadOnlyFirst.md | 11 + .../python-tornado/docs/SpecialModelName.md | 10 + .../petstore/python-tornado/docs/StoreApi.md | 205 ++++ .../petstore/python-tornado/docs/Tag.md | 11 + .../petstore/python-tornado/docs/User.md | 17 + .../petstore/python-tornado/docs/UserApi.md | 394 ++++++++ .../petstore/python-tornado/git_push.sh | 52 + .../python-tornado/petstore_api/__init__.py | 65 ++ .../python-tornado/petstore_api/api_client.py | 630 +++++++++++++ .../petstore_api/apis/__init__.py | 9 + .../petstore_api/apis/another_fake_api.py | 134 +++ .../petstore_api/apis/fake_api.py | 886 ++++++++++++++++++ .../apis/fake_classname_tags_123_api.py | 132 +++ .../petstore_api/apis/pet_api.py | 826 ++++++++++++++++ .../petstore_api/apis/store_api.py | 408 ++++++++ .../petstore_api/apis/user_api.py | 794 ++++++++++++++++ .../petstore_api/configuration.py | 254 +++++ .../petstore_api/models/__init__.py | 52 + .../models/additional_properties_class.py | 150 +++ .../petstore_api/models/animal.py | 166 ++++ .../petstore_api/models/animal_farm.py | 100 ++ .../petstore_api/models/api_response.py | 176 ++++ .../models/array_of_array_of_number_only.py | 124 +++ .../models/array_of_number_only.py | 124 +++ .../petstore_api/models/array_test.py | 176 ++++ .../petstore_api/models/capitalization.py | 256 +++++ .../python-tornado/petstore_api/models/cat.py | 124 +++ .../petstore_api/models/category.py | 150 +++ .../petstore_api/models/class_model.py | 124 +++ .../petstore_api/models/client.py | 124 +++ .../python-tornado/petstore_api/models/dog.py | 124 +++ .../petstore_api/models/enum_arrays.py | 163 ++++ .../petstore_api/models/enum_class.py | 106 +++ .../petstore_api/models/enum_test.py | 220 +++++ .../petstore_api/models/format_test.py | 468 +++++++++ .../petstore_api/models/has_only_read_only.py | 150 +++ .../petstore_api/models/list.py | 124 +++ .../petstore_api/models/map_test.py | 157 ++++ ...perties_and_additional_properties_class.py | 176 ++++ .../petstore_api/models/model_200_response.py | 150 +++ .../petstore_api/models/model_return.py | 124 +++ .../petstore_api/models/name.py | 203 ++++ .../petstore_api/models/number_only.py | 124 +++ .../petstore_api/models/order.py | 262 ++++++ .../petstore_api/models/outer_boolean.py | 100 ++ .../petstore_api/models/outer_composite.py | 176 ++++ .../petstore_api/models/outer_enum.py | 106 +++ .../petstore_api/models/outer_number.py | 100 ++ .../petstore_api/models/outer_string.py | 100 ++ .../python-tornado/petstore_api/models/pet.py | 264 ++++++ .../petstore_api/models/read_only_first.py | 150 +++ .../petstore_api/models/special_model_name.py | 124 +++ .../python-tornado/petstore_api/models/tag.py | 150 +++ .../petstore_api/models/user.py | 308 ++++++ .../python-tornado/petstore_api/rest.py | 259 +++++ .../petstore/python-tornado/requirements.txt | 5 + .../client/petstore/python-tornado/setup.py | 42 + .../python-tornado/test-requirements.txt | 5 + .../petstore/python-tornado/test/__init__.py | 0 .../test/test_additional_properties_class.py | 44 + .../python-tornado/test/test_animal.py | 44 + .../python-tornado/test/test_animal_farm.py | 44 + .../test/test_another_fake_api.py | 44 + .../python-tornado/test/test_api_response.py | 44 + .../test_array_of_array_of_number_only.py | 44 + .../test/test_array_of_number_only.py | 44 + .../python-tornado/test/test_array_test.py | 44 + .../test/test_capitalization.py | 44 + .../petstore/python-tornado/test/test_cat.py | 44 + .../python-tornado/test/test_category.py | 44 + .../python-tornado/test/test_class_model.py | 44 + .../python-tornado/test/test_client.py | 44 + .../petstore/python-tornado/test/test_dog.py | 44 + .../python-tornado/test/test_enum_arrays.py | 44 + .../python-tornado/test/test_enum_class.py | 44 + .../python-tornado/test/test_enum_test.py | 44 + .../python-tornado/test/test_fake_api.py | 100 ++ .../test/test_fake_classname_tags_123_api.py | 44 + .../python-tornado/test/test_format_test.py | 44 + .../test/test_has_only_read_only.py | 44 + .../petstore/python-tornado/test/test_list.py | 44 + .../python-tornado/test/test_map_test.py | 44 + ...perties_and_additional_properties_class.py | 44 + .../test/test_model_200_response.py | 44 + .../python-tornado/test/test_model_return.py | 44 + .../petstore/python-tornado/test/test_name.py | 44 + .../python-tornado/test/test_number_only.py | 44 + .../python-tornado/test/test_order.py | 44 + .../python-tornado/test/test_outer_boolean.py | 44 + .../test/test_outer_composite.py | 44 + .../python-tornado/test/test_outer_enum.py | 44 + .../python-tornado/test/test_outer_number.py | 44 + .../python-tornado/test/test_outer_string.py | 44 + .../petstore/python-tornado/test/test_pet.py | 44 + .../python-tornado/test/test_pet_api.py | 100 ++ .../test/test_read_only_first.py | 44 + .../test/test_special_model_name.py | 44 + .../python-tornado/test/test_store_api.py | 68 ++ .../petstore/python-tornado/test/test_tag.py | 44 + .../petstore/python-tornado/test/test_user.py | 44 + .../python-tornado/test/test_user_api.py | 100 ++ .../client/petstore/python-tornado/tox.ini | 10 + .../python/petstore_api/api_client.py | 6 +- .../python/petstore_api/configuration.py | 13 +- .../petstore/python/petstore_api/rest.py | 18 +- 292 files changed, 29674 insertions(+), 14 deletions(-) create mode 100644 samples/client/petstore/python-asyncio/.gitignore create mode 100644 samples/client/petstore/python-asyncio/.swagger-codegen-ignore create mode 100644 samples/client/petstore/python-asyncio/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/python-asyncio/.travis.yml create mode 100644 samples/client/petstore/python-asyncio/README.md create mode 100644 samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/python-asyncio/docs/Animal.md create mode 100644 samples/client/petstore/python-asyncio/docs/AnimalFarm.md create mode 100644 samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/python-asyncio/docs/ApiResponse.md create mode 100644 samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/python-asyncio/docs/ArrayTest.md create mode 100644 samples/client/petstore/python-asyncio/docs/Capitalization.md create mode 100644 samples/client/petstore/python-asyncio/docs/Cat.md create mode 100644 samples/client/petstore/python-asyncio/docs/Category.md create mode 100644 samples/client/petstore/python-asyncio/docs/ClassModel.md create mode 100644 samples/client/petstore/python-asyncio/docs/Client.md create mode 100644 samples/client/petstore/python-asyncio/docs/Dog.md create mode 100644 samples/client/petstore/python-asyncio/docs/EnumArrays.md create mode 100644 samples/client/petstore/python-asyncio/docs/EnumClass.md create mode 100644 samples/client/petstore/python-asyncio/docs/EnumTest.md create mode 100644 samples/client/petstore/python-asyncio/docs/FakeApi.md create mode 100644 samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/python-asyncio/docs/FormatTest.md create mode 100644 samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/python-asyncio/docs/List.md create mode 100644 samples/client/petstore/python-asyncio/docs/MapTest.md create mode 100644 samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/python-asyncio/docs/Model200Response.md create mode 100644 samples/client/petstore/python-asyncio/docs/ModelReturn.md create mode 100644 samples/client/petstore/python-asyncio/docs/Name.md create mode 100644 samples/client/petstore/python-asyncio/docs/NumberOnly.md create mode 100644 samples/client/petstore/python-asyncio/docs/Order.md create mode 100644 samples/client/petstore/python-asyncio/docs/OuterBoolean.md create mode 100644 samples/client/petstore/python-asyncio/docs/OuterComposite.md create mode 100644 samples/client/petstore/python-asyncio/docs/OuterEnum.md create mode 100644 samples/client/petstore/python-asyncio/docs/OuterNumber.md create mode 100644 samples/client/petstore/python-asyncio/docs/OuterString.md create mode 100644 samples/client/petstore/python-asyncio/docs/Pet.md create mode 100644 samples/client/petstore/python-asyncio/docs/PetApi.md create mode 100644 samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/python-asyncio/docs/SpecialModelName.md create mode 100644 samples/client/petstore/python-asyncio/docs/StoreApi.md create mode 100644 samples/client/petstore/python-asyncio/docs/Tag.md create mode 100644 samples/client/petstore/python-asyncio/docs/User.md create mode 100644 samples/client/petstore/python-asyncio/docs/UserApi.md create mode 100644 samples/client/petstore/python-asyncio/git_push.sh create mode 100644 samples/client/petstore/python-asyncio/petstore_api/__init__.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/api_client.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/configuration.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/__init__.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/animal.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/api_response.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/array_test.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/cat.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/category.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/class_model.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/client.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/dog.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/format_test.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/list.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/map_test.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/model_return.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/name.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/number_only.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/order.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/pet.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/tag.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/models/user.py create mode 100644 samples/client/petstore/python-asyncio/petstore_api/rest.py create mode 100644 samples/client/petstore/python-asyncio/requirements.txt create mode 100644 samples/client/petstore/python-asyncio/setup.py create mode 100644 samples/client/petstore/python-asyncio/test-requirements.txt create mode 100644 samples/client/petstore/python-asyncio/test/__init__.py create mode 100644 samples/client/petstore/python-asyncio/test/test_additional_properties_class.py create mode 100644 samples/client/petstore/python-asyncio/test/test_animal.py create mode 100644 samples/client/petstore/python-asyncio/test/test_animal_farm.py create mode 100644 samples/client/petstore/python-asyncio/test/test_another_fake_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_api_response.py create mode 100644 samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py create mode 100644 samples/client/petstore/python-asyncio/test/test_array_of_number_only.py create mode 100644 samples/client/petstore/python-asyncio/test/test_array_test.py create mode 100644 samples/client/petstore/python-asyncio/test/test_capitalization.py create mode 100644 samples/client/petstore/python-asyncio/test/test_cat.py create mode 100644 samples/client/petstore/python-asyncio/test/test_category.py create mode 100644 samples/client/petstore/python-asyncio/test/test_class_model.py create mode 100644 samples/client/petstore/python-asyncio/test/test_client.py create mode 100644 samples/client/petstore/python-asyncio/test/test_dog.py create mode 100644 samples/client/petstore/python-asyncio/test/test_enum_arrays.py create mode 100644 samples/client/petstore/python-asyncio/test/test_enum_class.py create mode 100644 samples/client/petstore/python-asyncio/test/test_enum_test.py create mode 100644 samples/client/petstore/python-asyncio/test/test_fake_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_format_test.py create mode 100644 samples/client/petstore/python-asyncio/test/test_has_only_read_only.py create mode 100644 samples/client/petstore/python-asyncio/test/test_list.py create mode 100644 samples/client/petstore/python-asyncio/test/test_map_test.py create mode 100644 samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/client/petstore/python-asyncio/test/test_model_200_response.py create mode 100644 samples/client/petstore/python-asyncio/test/test_model_return.py create mode 100644 samples/client/petstore/python-asyncio/test/test_name.py create mode 100644 samples/client/petstore/python-asyncio/test/test_number_only.py create mode 100644 samples/client/petstore/python-asyncio/test/test_order.py create mode 100644 samples/client/petstore/python-asyncio/test/test_outer_boolean.py create mode 100644 samples/client/petstore/python-asyncio/test/test_outer_composite.py create mode 100644 samples/client/petstore/python-asyncio/test/test_outer_enum.py create mode 100644 samples/client/petstore/python-asyncio/test/test_outer_number.py create mode 100644 samples/client/petstore/python-asyncio/test/test_outer_string.py create mode 100644 samples/client/petstore/python-asyncio/test/test_pet.py create mode 100644 samples/client/petstore/python-asyncio/test/test_pet_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_read_only_first.py create mode 100644 samples/client/petstore/python-asyncio/test/test_special_model_name.py create mode 100644 samples/client/petstore/python-asyncio/test/test_store_api.py create mode 100644 samples/client/petstore/python-asyncio/test/test_tag.py create mode 100644 samples/client/petstore/python-asyncio/test/test_user.py create mode 100644 samples/client/petstore/python-asyncio/test/test_user_api.py create mode 100644 samples/client/petstore/python-asyncio/tox.ini create mode 100644 samples/client/petstore/python-tornado/.gitignore create mode 100644 samples/client/petstore/python-tornado/.swagger-codegen-ignore create mode 100644 samples/client/petstore/python-tornado/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/python-tornado/.travis.yml create mode 100644 samples/client/petstore/python-tornado/README.md create mode 100644 samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/python-tornado/docs/Animal.md create mode 100644 samples/client/petstore/python-tornado/docs/AnimalFarm.md create mode 100644 samples/client/petstore/python-tornado/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/python-tornado/docs/ApiResponse.md create mode 100644 samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/python-tornado/docs/ArrayTest.md create mode 100644 samples/client/petstore/python-tornado/docs/Capitalization.md create mode 100644 samples/client/petstore/python-tornado/docs/Cat.md create mode 100644 samples/client/petstore/python-tornado/docs/Category.md create mode 100644 samples/client/petstore/python-tornado/docs/ClassModel.md create mode 100644 samples/client/petstore/python-tornado/docs/Client.md create mode 100644 samples/client/petstore/python-tornado/docs/Dog.md create mode 100644 samples/client/petstore/python-tornado/docs/EnumArrays.md create mode 100644 samples/client/petstore/python-tornado/docs/EnumClass.md create mode 100644 samples/client/petstore/python-tornado/docs/EnumTest.md create mode 100644 samples/client/petstore/python-tornado/docs/FakeApi.md create mode 100644 samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/python-tornado/docs/FormatTest.md create mode 100644 samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/python-tornado/docs/List.md create mode 100644 samples/client/petstore/python-tornado/docs/MapTest.md create mode 100644 samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/python-tornado/docs/Model200Response.md create mode 100644 samples/client/petstore/python-tornado/docs/ModelReturn.md create mode 100644 samples/client/petstore/python-tornado/docs/Name.md create mode 100644 samples/client/petstore/python-tornado/docs/NumberOnly.md create mode 100644 samples/client/petstore/python-tornado/docs/Order.md create mode 100644 samples/client/petstore/python-tornado/docs/OuterBoolean.md create mode 100644 samples/client/petstore/python-tornado/docs/OuterComposite.md create mode 100644 samples/client/petstore/python-tornado/docs/OuterEnum.md create mode 100644 samples/client/petstore/python-tornado/docs/OuterNumber.md create mode 100644 samples/client/petstore/python-tornado/docs/OuterString.md create mode 100644 samples/client/petstore/python-tornado/docs/Pet.md create mode 100644 samples/client/petstore/python-tornado/docs/PetApi.md create mode 100644 samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/python-tornado/docs/SpecialModelName.md create mode 100644 samples/client/petstore/python-tornado/docs/StoreApi.md create mode 100644 samples/client/petstore/python-tornado/docs/Tag.md create mode 100644 samples/client/petstore/python-tornado/docs/User.md create mode 100644 samples/client/petstore/python-tornado/docs/UserApi.md create mode 100644 samples/client/petstore/python-tornado/git_push.sh create mode 100644 samples/client/petstore/python-tornado/petstore_api/__init__.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/api_client.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/__init__.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/store_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/apis/user_api.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/configuration.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/__init__.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/animal.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/api_response.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/array_test.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/capitalization.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/cat.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/category.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/class_model.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/client.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/dog.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_class.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/enum_test.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/format_test.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/list.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/map_test.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/model_return.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/name.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/number_only.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/order.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_number.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/outer_string.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/pet.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/tag.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/models/user.py create mode 100644 samples/client/petstore/python-tornado/petstore_api/rest.py create mode 100644 samples/client/petstore/python-tornado/requirements.txt create mode 100644 samples/client/petstore/python-tornado/setup.py create mode 100644 samples/client/petstore/python-tornado/test-requirements.txt create mode 100644 samples/client/petstore/python-tornado/test/__init__.py create mode 100644 samples/client/petstore/python-tornado/test/test_additional_properties_class.py create mode 100644 samples/client/petstore/python-tornado/test/test_animal.py create mode 100644 samples/client/petstore/python-tornado/test/test_animal_farm.py create mode 100644 samples/client/petstore/python-tornado/test/test_another_fake_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_api_response.py create mode 100644 samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py create mode 100644 samples/client/petstore/python-tornado/test/test_array_of_number_only.py create mode 100644 samples/client/petstore/python-tornado/test/test_array_test.py create mode 100644 samples/client/petstore/python-tornado/test/test_capitalization.py create mode 100644 samples/client/petstore/python-tornado/test/test_cat.py create mode 100644 samples/client/petstore/python-tornado/test/test_category.py create mode 100644 samples/client/petstore/python-tornado/test/test_class_model.py create mode 100644 samples/client/petstore/python-tornado/test/test_client.py create mode 100644 samples/client/petstore/python-tornado/test/test_dog.py create mode 100644 samples/client/petstore/python-tornado/test/test_enum_arrays.py create mode 100644 samples/client/petstore/python-tornado/test/test_enum_class.py create mode 100644 samples/client/petstore/python-tornado/test/test_enum_test.py create mode 100644 samples/client/petstore/python-tornado/test/test_fake_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_format_test.py create mode 100644 samples/client/petstore/python-tornado/test/test_has_only_read_only.py create mode 100644 samples/client/petstore/python-tornado/test/test_list.py create mode 100644 samples/client/petstore/python-tornado/test/test_map_test.py create mode 100644 samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/client/petstore/python-tornado/test/test_model_200_response.py create mode 100644 samples/client/petstore/python-tornado/test/test_model_return.py create mode 100644 samples/client/petstore/python-tornado/test/test_name.py create mode 100644 samples/client/petstore/python-tornado/test/test_number_only.py create mode 100644 samples/client/petstore/python-tornado/test/test_order.py create mode 100644 samples/client/petstore/python-tornado/test/test_outer_boolean.py create mode 100644 samples/client/petstore/python-tornado/test/test_outer_composite.py create mode 100644 samples/client/petstore/python-tornado/test/test_outer_enum.py create mode 100644 samples/client/petstore/python-tornado/test/test_outer_number.py create mode 100644 samples/client/petstore/python-tornado/test/test_outer_string.py create mode 100644 samples/client/petstore/python-tornado/test/test_pet.py create mode 100644 samples/client/petstore/python-tornado/test/test_pet_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_read_only_first.py create mode 100644 samples/client/petstore/python-tornado/test/test_special_model_name.py create mode 100644 samples/client/petstore/python-tornado/test/test_store_api.py create mode 100644 samples/client/petstore/python-tornado/test/test_tag.py create mode 100644 samples/client/petstore/python-tornado/test/test_user.py create mode 100644 samples/client/petstore/python-tornado/test/test_user_api.py create mode 100644 samples/client/petstore/python-tornado/tox.ini diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 967e1c5d293..5372dea0592 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -280,7 +280,7 @@ class ApiClient(object): _request_timeout=None): """ Makes the HTTP request (synchronous) and return the deserialized data. - To make an async request, define a function for callback. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. :param method: Method to call. @@ -304,10 +304,10 @@ class ApiClient(object): :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: - If provide parameter callback, + If async parameter is True, the request will be called asynchronously. The method will return the request thread. - If parameter callback is None, + If parameter async is False or missing, then the method will return the response directly. """ if not async: diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 41c9778087c..512e755c24f 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -6,8 +6,9 @@ from __future__ import absolute_import import urllib3 -import sys import logging +import multiprocessing +import sys from six import iteritems from six.moves import http_client as httplib @@ -66,6 +67,16 @@ class Configuration(object): self.cert_file = None # client key file self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + # Proxy URL self.proxy = None diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 15c11f0828e..49508f77324 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -47,7 +47,7 @@ class RESTResponse(io.IOBase): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=4): + def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 @@ -67,6 +67,16 @@ class RESTClientObject(object): # if not set certificate file, use Mozilla's root certificates. ca_certs = certifi.where() + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = config.assert_hostname + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + # https pool manager if configuration.proxy: self.pool_manager = urllib3.ProxyManager( @@ -76,7 +86,8 @@ class RESTClientObject(object): ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, - proxy_url=configuration.proxy + proxy_url=configuration.proxy, + **addition_pool_args ) else: self.pool_manager = urllib3.PoolManager( @@ -85,7 +96,8 @@ class RESTClientObject(object): cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, - key_file=configuration.key_file + key_file=configuration.key_file, + **addition_pool_args ) def request(self, method, url, query_params=None, headers=None, diff --git a/samples/client/petstore/python-asyncio/.gitignore b/samples/client/petstore/python-asyncio/.gitignore new file mode 100644 index 00000000000..a655050c263 --- /dev/null +++ b/samples/client/petstore/python-asyncio/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/client/petstore/python-asyncio/.swagger-codegen-ignore b/samples/client/petstore/python-asyncio/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/python-asyncio/.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/python-asyncio/.swagger-codegen/VERSION b/samples/client/petstore/python-asyncio/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/python-asyncio/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.travis.yml b/samples/client/petstore/python-asyncio/.travis.yml new file mode 100644 index 00000000000..86211e2d4a2 --- /dev/null +++ b/samples/client/petstore/python-asyncio/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md new file mode 100644 index 00000000000..87f80990fc5 --- /dev/null +++ b/samples/client/petstore/python-asyncio/README.md @@ -0,0 +1,176 @@ +# petstore-api +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +# create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + - [Cat](docs/Cat.md) + - [Dog](docs/Dog.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + +apiteam@swagger.io + diff --git a/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..ea12f270f02 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **dict(str, str)** | | [optional] +**map_of_map_property** | [**dict(str, dict(str, str))**](dict.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Animal.md b/samples/client/petstore/python-asyncio/docs/Animal.md new file mode 100644 index 00000000000..7ed4ba541fa --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/AnimalFarm.md b/samples/client/petstore/python-asyncio/docs/AnimalFarm.md new file mode 100644 index 00000000000..df6bab21dae --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/AnimalFarm.md @@ -0,0 +1,9 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..b78fcf86f43 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **test_special_tags** +> Client test_special_tags(body) + +To test special tags + +To test special tags + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/docs/ApiResponse.md b/samples/client/petstore/python-asyncio/docs/ApiResponse.md new file mode 100644 index 00000000000..8fc302305ab --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..aa3988ab167 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **list[list[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..2c3de967aec --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **list[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/ArrayTest.md b/samples/client/petstore/python-asyncio/docs/ArrayTest.md new file mode 100644 index 00000000000..6ab0d137806 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **list[str]** | | [optional] +**array_array_of_integer** | **list[list[int]]** | | [optional] +**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Capitalization.md b/samples/client/petstore/python-asyncio/docs/Capitalization.md new file mode 100644 index 00000000000..85d88d239ee --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Cat.md b/samples/client/petstore/python-asyncio/docs/Cat.md new file mode 100644 index 00000000000..8d30565d014 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Cat.md @@ -0,0 +1,10 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Category.md b/samples/client/petstore/python-asyncio/docs/Category.md new file mode 100644 index 00000000000..7f453539bf8 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/ClassModel.md b/samples/client/petstore/python-asyncio/docs/ClassModel.md new file mode 100644 index 00000000000..7f6f6d17211 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ClassModel.md @@ -0,0 +1,10 @@ +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Client.md b/samples/client/petstore/python-asyncio/docs/Client.md new file mode 100644 index 00000000000..88e99384f92 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Dog.md b/samples/client/petstore/python-asyncio/docs/Dog.md new file mode 100644 index 00000000000..f727487975c --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Dog.md @@ -0,0 +1,10 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/EnumArrays.md b/samples/client/petstore/python-asyncio/docs/EnumArrays.md new file mode 100644 index 00000000000..e15a5f1fd04 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/EnumClass.md b/samples/client/petstore/python-asyncio/docs/EnumClass.md new file mode 100644 index 00000000000..67f017becd0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/EnumClass.md @@ -0,0 +1,9 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/EnumTest.md b/samples/client/petstore/python-asyncio/docs/EnumTest.md new file mode 100644 index 00000000000..94dd4864629 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/EnumTest.md @@ -0,0 +1,13 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md new file mode 100644 index 00000000000..eb669540e53 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -0,0 +1,440 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data + + +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(body=body) + + + +Test serialization of outer boolean types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(body=body) + + + +Test serialization of object with outer number type + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(body=body) + + + +Test serialization of outer number types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(body=body) + + + +Test serialization of outer string types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterString() # OuterString | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> Client test_client_model(body) + +To test \"client\" model + +To test \"client\" model + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 1.2 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 789 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = 'B' # str | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **str**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double) + +To test enum parameters + +To test enum parameters + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_form_string_array = ['enum_form_string_array_example'] # list[str] | Form parameter enum test (string array) (optional) +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to -efg) +enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to -efg) +enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to -efg) +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 1.2 # float | Query parameter enum test (double) (optional) + +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to -efg] + **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to -efg] + **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to -efg] + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..a103a4ee327 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(body) + +To test class name in snake case + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key_query +configuration = petstore_api.Configuration() +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +body = petstore_api.Client() # Client | client model + +try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/docs/FormatTest.md b/samples/client/petstore/python-asyncio/docs/FormatTest.md new file mode 100644 index 00000000000..3e489e863fa --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/FormatTest.md @@ -0,0 +1,22 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **float** | | +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**byte** | **str** | | +**binary** | **str** | | [optional] +**date** | **date** | | +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**password** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..44ad450b52c --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**foo** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/List.md b/samples/client/petstore/python-asyncio/docs/List.md new file mode 100644 index 00000000000..11f4f3a05f3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/List.md @@ -0,0 +1,10 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/MapTest.md b/samples/client/petstore/python-asyncio/docs/MapTest.md new file mode 100644 index 00000000000..63cdab0374a --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/MapTest.md @@ -0,0 +1,11 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | [**dict(str, dict(str, str))**](dict.md) | | [optional] +**map_of_enum_string** | **dict(str, str)** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..b9808d5275e --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**dict(str, Animal)**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Model200Response.md b/samples/client/petstore/python-asyncio/docs/Model200Response.md new file mode 100644 index 00000000000..30f47cae521 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Model200Response.md @@ -0,0 +1,11 @@ +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/ModelReturn.md b/samples/client/petstore/python-asyncio/docs/ModelReturn.md new file mode 100644 index 00000000000..2b03798e301 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ModelReturn.md @@ -0,0 +1,10 @@ +# ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Name.md b/samples/client/petstore/python-asyncio/docs/Name.md new file mode 100644 index 00000000000..542da3f0476 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Name.md @@ -0,0 +1,13 @@ +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/NumberOnly.md b/samples/client/petstore/python-asyncio/docs/NumberOnly.md new file mode 100644 index 00000000000..93a0fde7b93 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Order.md b/samples/client/petstore/python-asyncio/docs/Order.md new file mode 100644 index 00000000000..b5f7b22d34c --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to False] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/OuterBoolean.md b/samples/client/petstore/python-asyncio/docs/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/OuterComposite.md b/samples/client/petstore/python-asyncio/docs/OuterComposite.md new file mode 100644 index 00000000000..159e67b48ee --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/OuterEnum.md b/samples/client/petstore/python-asyncio/docs/OuterEnum.md new file mode 100644 index 00000000000..06d413b0168 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/OuterEnum.md @@ -0,0 +1,9 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/OuterNumber.md b/samples/client/petstore/python-asyncio/docs/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/OuterString.md b/samples/client/petstore/python-asyncio/docs/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/Pet.md b/samples/client/petstore/python-asyncio/docs/Pet.md new file mode 100644 index 00000000000..9e15090300f --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **str** | | +**photo_urls** | **list[str]** | | +**tags** | [**list[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md new file mode 100644 index 00000000000..74c6a5196fd --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/PetApi.md @@ -0,0 +1,440 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **add_pet** +> add_pet(body) + +Add a new pet to the store + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Add a new pet to the store + api_instance.add_pet(body) +except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pet** +> delete_pet(pet_id, api_key=api_key) + +Deletes a pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_status** +> list[Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # list[str] | Status values that need to be considered for filter + +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_tags** +> list[Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # list[str] | Tags to filter by + +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**list[str]**](str.md)| Tags to filter by | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = petstore_api.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to return + +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet** +> update_pet(body) + +Update an existing pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Update an existing pet + api_instance.update_pet(body) +except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_with_form** +> update_pet_with_form(pet_id, name=name, status=status) + +Updates a pet in the store with form data + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file** +> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) + +uploads an image + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = '/path/to/file.txt' # file | file to upload (optional) + +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md b/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..93fed253d01 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/SpecialModelName.md b/samples/client/petstore/python-asyncio/docs/SpecialModelName.md new file mode 100644 index 00000000000..022ee19169c --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md new file mode 100644 index 00000000000..a75113975ef --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md @@ -0,0 +1,205 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_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 + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inventory** +> dict(str, int) get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = petstore_api.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**dict(str, int)** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 789 # int | ID of pet that needs to be fetched + +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **place_order** +> Order place_order(body) + +Place an order for a pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +body = petstore_api.Order() # Order | order placed for purchasing the pet + +try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/docs/Tag.md b/samples/client/petstore/python-asyncio/docs/Tag.md new file mode 100644 index 00000000000..243cd98eda6 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/User.md b/samples/client/petstore/python-asyncio/docs/User.md new file mode 100644 index 00000000000..443ac123fdc --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md new file mode 100644 index 00000000000..5b73179dce3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/docs/UserApi.md @@ -0,0 +1,394 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(body) + +Create user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = petstore_api.User() # User | Created user object + +try: + # Create user + api_instance.create_user(body) +except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_array_input** +> create_users_with_array_input(body) + +Creates list of users with given input array + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_list_input** +> create_users_with_list_input(body) + +Creates list of users with given input array + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +try: + # Delete user + api_instance.delete_user(username) +except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() + +try: + # Logs out current logged in user session + api_instance.logout_user() +except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> update_user(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +body = petstore_api.User() # User | Updated user object + +try: + # Updated user + api_instance.update_user(username, body) +except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-asyncio/git_push.sh b/samples/client/petstore/python-asyncio/git_push.sh new file mode 100644 index 00000000000..ed374619b13 --- /dev/null +++ b/samples/client/petstore/python-asyncio/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/python-asyncio/petstore_api/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/__init__.py new file mode 100644 index 00000000000..cad09e2691c --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/__init__.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into sdk package +from .models.additional_properties_class import AdditionalPropertiesClass +from .models.animal import Animal +from .models.animal_farm import AnimalFarm +from .models.api_response import ApiResponse +from .models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from .models.array_of_number_only import ArrayOfNumberOnly +from .models.array_test import ArrayTest +from .models.capitalization import Capitalization +from .models.category import Category +from .models.class_model import ClassModel +from .models.client import Client +from .models.enum_arrays import EnumArrays +from .models.enum_class import EnumClass +from .models.enum_test import EnumTest +from .models.format_test import FormatTest +from .models.has_only_read_only import HasOnlyReadOnly +from .models.list import List +from .models.map_test import MapTest +from .models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from .models.model_200_response import Model200Response +from .models.model_return import ModelReturn +from .models.name import Name +from .models.number_only import NumberOnly +from .models.order import Order +from .models.outer_boolean import OuterBoolean +from .models.outer_composite import OuterComposite +from .models.outer_enum import OuterEnum +from .models.outer_number import OuterNumber +from .models.outer_string import OuterString +from .models.pet import Pet +from .models.read_only_first import ReadOnlyFirst +from .models.special_model_name import SpecialModelName +from .models.tag import Tag +from .models.user import User +from .models.cat import Cat +from .models.dog import Dog + +# import apis into sdk package +from .apis.another_fake_api import AnotherFakeApi +from .apis.fake_api import FakeApi +from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api +from .apis.pet_api import PetApi +from .apis.store_api import StoreApi +from .apis.user_api import UserApi + +# import ApiClient +from .api_client import ApiClient + +from .configuration import Configuration diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py new file mode 100644 index 00000000000..9f265a7f94a --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -0,0 +1,628 @@ +# coding: utf-8 +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import re +import json +import mimetypes +import tempfile +from multiprocessing.pool import ThreadPool + +from datetime import date, datetime + +# python 2 and python 3 compatibility library +from six import PY3, integer_types, iteritems, text_type +from six.moves.urllib.parse import quote + +from . import models +from .configuration import Configuration +from .rest import ApiException, RESTClientObject + + +class ApiClient(object): + """ + Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param host: The base path for the server to call. + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to the API. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if PY3 else long, + 'float': float, + 'str': str, + 'bool': bool, + 'date': date, + 'datetime': datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """ + Gets user agent. + """ + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + """ + Sets user agent. + """ + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + async def __call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, _preload_content=True, + _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param)) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = await self.request(method, url, + query_params=query_params, + headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """ + Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """ + Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """ + Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match('list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == date: + return self.__deserialize_date(data) + elif klass == datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async=None, + _return_http_data_only=None, collection_formats=None, _preload_content=True, + _request_timeout=None): + """ + Makes the HTTP request (synchronous) and return the deserialized data. + To make an async request, set the async parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async bool: execute request asynchronously + :param _return_http_data_only: response data without head status code and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without + reading/decoding response data. Default is True. + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :return: + If async parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async is False or missing, + then the method will return the response directly. + """ + if not async: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, method, + path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, _request_timeout=None): + """ + Makes the HTTP request using RESTClient. + """ + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """ + Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in iteritems(params) if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """ + Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = mimetypes.\ + guess_type(filename)[0] or 'application/octet-stream' + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """ + Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """ + Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """ + Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """ + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.\ + search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ + group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "w") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """ + Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return unicode(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """ + Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """ + Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise ApiException( + status=0, + reason="Failed to parse `{0}` into a date object".format(string) + ) + + def __deserialize_datatime(self, string): + """ + Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise ApiException( + status=0, + reason=( + "Failed to parse `{0}` into a datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """ + Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in iteritems(klass.swagger_types): + if data is not None \ + and klass.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py new file mode 100644 index 00000000000..b4b975ca8e0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/__init__.py @@ -0,0 +1,9 @@ +from __future__ import absolute_import + +# import apis into api package +from .another_fake_api import AnotherFakeApi +from .fake_api import FakeApi +from .fake_classname_tags_123_api import FakeClassnameTags123Api +from .pet_api import PetApi +from .store_api import StoreApi +from .user_api import UserApi diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py new file mode 100644 index 00000000000..8fb991ff3df --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/another_fake_api.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class AnotherFakeApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_special_tags(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_special_tags_with_http_info(body, **kwargs) + else: + (data) = self.test_special_tags_with_http_info(body, **kwargs) + return data + + def test_special_tags_with_http_info(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_special_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py new file mode 100644 index 00000000000..46fb22f7290 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/fake_api.py @@ -0,0 +1,886 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class FakeApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def fake_outer_boolean_serialize(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_boolean_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return data + + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_boolean_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_composite_serialize(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_composite_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_composite_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + return data + + def fake_outer_composite_serialize_with_http_info(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_composite_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_number_serialize(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_number_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_number_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + return data + + def fake_outer_number_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_number_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_string_serialize(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_string_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_string_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + return data + + def fake_outer_string_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_string_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_client_model(self, body, **kwargs): + """ + To test \"client\" model + To test \"client\" model + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_client_model(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_client_model_with_http_info(body, **kwargs) + else: + (data) = self.test_client_model_with_http_info(body, **kwargs) + return data + + def test_client_model_with_http_info(self, body, **kwargs): + """ + To test \"client\" model + To test \"client\" model + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_client_model_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_client_model" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) + >>> result = thread.get() + + :param async bool + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param str binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + else: + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + return data + + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) + >>> result = thread.get() + + :param async bool + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param str binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_endpoint_parameters" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'number' is set + if ('number' not in params) or (params['number'] is None): + raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") + # verify the required parameter 'double' is set + if ('double' not in params) or (params['double'] is None): + raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") + # verify the required parameter 'pattern_without_delimiter' is set + if ('pattern_without_delimiter' not in params) or (params['pattern_without_delimiter'] is None): + raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") + # verify the required parameter 'byte' is set + if ('byte' not in params) or (params['byte'] is None): + raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") + + if 'number' in params and params['number'] > 543.2: + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") + if 'number' in params and params['number'] < 32.1: + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") + if 'double' in params and params['double'] > 123.4: + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") + if 'double' in params and params['double'] < 67.8: + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") + if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): + raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") + if 'integer' in params and params['integer'] > 100: + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") + if 'integer' in params and params['integer'] < 10: + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") + if 'int32' in params and params['int32'] > 200: + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") + if 'int32' in params and params['int32'] < 20: + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") + if 'float' in params and params['float'] > 987.6: + raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") + if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): + raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") + if 'password' in params and len(params['password']) > 64: + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") + if 'password' in params and len(params['password']) < 10: + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'integer' in params: + form_params.append(('integer', params['integer'])) + if 'int32' in params: + form_params.append(('int32', params['int32'])) + if 'int64' in params: + form_params.append(('int64', params['int64'])) + if 'number' in params: + form_params.append(('number', params['number'])) + if 'float' in params: + form_params.append(('float', params['float'])) + if 'double' in params: + form_params.append(('double', params['double'])) + if 'string' in params: + form_params.append(('string', params['string'])) + if 'pattern_without_delimiter' in params: + form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) + if 'byte' in params: + form_params.append(('byte', params['byte'])) + if 'binary' in params: + form_params.append(('binary', params['binary'])) + if 'date' in params: + form_params.append(('date', params['date'])) + if 'date_time' in params: + form_params.append(('dateTime', params['date_time'])) + if 'password' in params: + form_params.append(('password', params['password'])) + if 'param_callback' in params: + form_params.append(('callback', params['param_callback'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + + # Authentication setting + auth_settings = ['http_basic_test'] + + return self.api_client.call_api('/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_enum_parameters(self, **kwargs): + """ + To test enum parameters + To test enum parameters + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_enum_parameters(async=True) + >>> result = thread.get() + + :param async bool + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_enum_parameters_with_http_info(**kwargs) + else: + (data) = self.test_enum_parameters_with_http_info(**kwargs) + return data + + def test_enum_parameters_with_http_info(self, **kwargs): + """ + To test enum parameters + To test enum parameters + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_enum_parameters_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_enum_parameters" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'enum_query_string_array' in params: + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) + collection_formats['enum_query_string_array'] = 'csv' + if 'enum_query_string' in params: + query_params.append(('enum_query_string', params['enum_query_string'])) + if 'enum_query_integer' in params: + query_params.append(('enum_query_integer', params['enum_query_integer'])) + + header_params = {} + if 'enum_header_string_array' in params: + header_params['enum_header_string_array'] = params['enum_header_string_array'] + collection_formats['enum_header_string_array'] = 'csv' + if 'enum_header_string' in params: + header_params['enum_header_string'] = params['enum_header_string'] + + form_params = [] + local_var_files = {} + if 'enum_form_string_array' in params: + form_params.append(('enum_form_string_array', params['enum_form_string_array'])) + collection_formats['enum_form_string_array'] = 'csv' + if 'enum_form_string' in params: + form_params.append(('enum_form_string', params['enum_form_string'])) + if 'enum_query_double' in params: + form_params.append(('enum_query_double', params['enum_query_double'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['*/*']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['*/*']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, param, param2, **kwargs): + """ + test json serialization of form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_json_form_data(param, param2, async=True) + >>> result = thread.get() + + :param async bool + :param str param: field1 (required) + :param str param2: field2 (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_json_form_data_with_http_info(param, param2, **kwargs) + else: + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) + return data + + def test_json_form_data_with_http_info(self, param, param2, **kwargs): + """ + test json serialization of form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) + >>> result = thread.get() + + :param async bool + :param str param: field1 (required) + :param str param2: field2 (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['param', 'param2'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_json_form_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in params) or (params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") + # verify the required parameter 'param2' is set + if ('param2' not in params) or (params['param2'] is None): + raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'param' in params: + form_params.append(('param', params['param'])) + if 'param2' in params: + form_params.append(('param2', params['param2'])) + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py new file mode 100644 index 00000000000..da75ad3cccd --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/fake_classname_tags_123_api.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class FakeClassnameTags123Api(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): + """ + To test class name in snake case + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_classname(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_classname_with_http_info(body, **kwargs) + else: + (data) = self.test_classname_with_http_info(body, **kwargs) + return data + + def test_classname_with_http_info(self, body, **kwargs): + """ + To test class name in snake case + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_classname_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['api_key_query'] + + return self.api_client.call_api('/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py new file mode 100644 index 00000000000..51b6ce82540 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/pet_api.py @@ -0,0 +1,826 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class PetApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_pet(self, body, **kwargs): + """ + Add a new pet to the store + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.add_pet(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.add_pet_with_http_info(body, **kwargs) + else: + (data) = self.add_pet_with_http_info(body, **kwargs) + return data + + def add_pet_with_http_info(self, body, **kwargs): + """ + Add a new pet to the store + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.add_pet_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_pet(self, pet_id, **kwargs): + """ + Deletes a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_pet(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_pet_with_http_info(pet_id, **kwargs) + else: + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): + """ + Deletes a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_pet_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_status(self, status, **kwargs): + """ + Finds Pets by status + Multiple status values can be provided with comma separated strings + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_status(status, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.find_pets_by_status_with_http_info(status, **kwargs) + else: + (data) = self.find_pets_by_status_with_http_info(status, **kwargs) + return data + + def find_pets_by_status_with_http_info(self, status, **kwargs): + """ + Finds Pets by status + Multiple status values can be provided with comma separated strings + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_status_with_http_info(status, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'status' is set + if ('status' not in params) or (params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in params: + query_params.append(('status', params['status'])) + collection_formats['status'] = 'csv' + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_tags(self, tags, **kwargs): + """ + Finds Pets by tags + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_tags(tags, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.find_pets_by_tags_with_http_info(tags, **kwargs) + else: + (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) + return data + + def find_pets_by_tags_with_http_info(self, tags, **kwargs): + """ + Finds Pets by tags + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_tags_with_http_info(tags, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tags'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tags' is set + if ('tags' not in params) or (params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tags' in params: + query_params.append(('tags', params['tags'])) + collection_formats['tags'] = 'csv' + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_pet_by_id(self, pet_id, **kwargs): + """ + Find pet by ID + Returns a single pet + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_pet_by_id(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) + else: + (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) + return data + + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): + """ + Find pet by ID + Returns a single pet + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['api_key'] + + return self.api_client.call_api('/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet(self, body, **kwargs): + """ + Update an existing pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_pet_with_http_info(body, **kwargs) + else: + (data) = self.update_pet_with_http_info(body, **kwargs) + return data + + def update_pet_with_http_info(self, body, **kwargs): + """ + Update an existing pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet_with_form(self, pet_id, **kwargs): + """ + Updates a pet in the store with form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_form(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) + else: + (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) + return data + + def update_pet_with_form_with_http_info(self, pet_id, **kwargs): + """ + Updates a pet in the store with form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'name', 'status'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet_with_form" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in params: + form_params.append(('name', params['name'])) + if 'status' in params: + form_params.append(('status', params['status'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/x-www-form-urlencoded']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_file(self, pet_id, **kwargs): + """ + uploads an image + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.upload_file(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.upload_file_with_http_info(pet_id, **kwargs) + else: + (data) = self.upload_file_with_http_info(pet_id, **kwargs) + return data + + def upload_file_with_http_info(self, pet_id, **kwargs): + """ + uploads an image + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.upload_file_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'additional_metadata', 'file'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_file" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'additional_metadata' in params: + form_params.append(('additionalMetadata', params['additional_metadata'])) + if 'file' in params: + local_var_files['file'] = params['file'] + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['multipart/form-data']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py new file mode 100644 index 00000000000..e9d9599c363 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/store_api.py @@ -0,0 +1,408 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class StoreApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_order(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_order(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_order_with_http_info(order_id, **kwargs) + else: + (data) = self.delete_order_with_http_info(order_id, **kwargs) + return data + + def delete_order_with_http_info(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_order_with_http_info(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_inventory(self, **kwargs): + """ + Returns pet inventories by status + Returns a map of status codes to quantities + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_inventory(async=True) + >>> result = thread.get() + + :param async bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_inventory_with_http_info(**kwargs) + else: + (data) = self.get_inventory_with_http_info(**kwargs) + return data + + def get_inventory_with_http_info(self, **kwargs): + """ + Returns pet inventories by status + Returns a map of status codes to quantities + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_inventory_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_inventory" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # Authentication setting + auth_settings = ['api_key'] + + return self.api_client.call_api('/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_order_by_id(self, order_id, **kwargs): + """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_order_by_id(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_order_by_id_with_http_info(order_id, **kwargs) + else: + (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) + return data + + def get_order_by_id_with_http_info(self, order_id, **kwargs): + """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_order_by_id_with_http_info(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_order_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") + + if 'order_id' in params and params['order_id'] > 5: + raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") + if 'order_id' in params and params['order_id'] < 1: + raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def place_order(self, body, **kwargs): + """ + Place an order for a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.place_order(body, async=True) + >>> result = thread.get() + + :param async bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.place_order_with_http_info(body, **kwargs) + else: + (data) = self.place_order_with_http_info(body, **kwargs) + return data + + def place_order_with_http_info(self, body, **kwargs): + """ + Place an order for a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.place_order_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method place_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py new file mode 100644 index 00000000000..ffdad2dd60f --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/apis/user_api.py @@ -0,0 +1,794 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class UserApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_user(self, body, **kwargs): + """ + Create user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_user(body, async=True) + >>> result = thread.get() + + :param async bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_user_with_http_info(body, **kwargs) + else: + (data) = self.create_user_with_http_info(body, **kwargs) + return data + + def create_user_with_http_info(self, body, **kwargs): + """ + Create user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_user_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_array_input(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_array_input(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_users_with_array_input_with_http_info(body, **kwargs) + else: + (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) + return data + + def create_users_with_array_input_with_http_info(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_array_input_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_array_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_list_input(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_list_input(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_users_with_list_input_with_http_info(body, **kwargs) + else: + (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) + return data + + def create_users_with_list_input_with_http_info(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_list_input_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_list_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_user(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_user_with_http_info(username, **kwargs) + else: + (data) = self.delete_user_with_http_info(username, **kwargs) + return data + + def delete_user_with_http_info(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_user_with_http_info(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_by_name(self, username, **kwargs): + """ + Get user by user name + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_user_by_name(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_user_by_name_with_http_info(username, **kwargs) + else: + (data) = self.get_user_by_name_with_http_info(username, **kwargs) + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): + """ + Get user by user name + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_user_by_name_with_http_info(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def login_user(self, username, password, **kwargs): + """ + Logs user into the system + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.login_user(username, password, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.login_user_with_http_info(username, password, **kwargs) + else: + (data) = self.login_user_with_http_info(username, password, **kwargs) + return data + + def login_user_with_http_info(self, username, password, **kwargs): + """ + Logs user into the system + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.login_user_with_http_info(username, password, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username', 'password'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method login_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") + # verify the required parameter 'password' is set + if ('password' not in params) or (params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'username' in params: + query_params.append(('username', params['username'])) + if 'password' in params: + query_params.append(('password', params['password'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def logout_user(self, **kwargs): + """ + Logs out current logged in user session + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.logout_user(async=True) + >>> result = thread.get() + + :param async bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.logout_user_with_http_info(**kwargs) + else: + (data) = self.logout_user_with_http_info(**kwargs) + return data + + def logout_user_with_http_info(self, **kwargs): + """ + Logs out current logged in user session + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.logout_user_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method logout_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_user(self, username, body, **kwargs): + """ + Updated user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_user(username, body, async=True) + >>> result = thread.get() + + :param async bool + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_user_with_http_info(username, body, **kwargs) + else: + (data) = self.update_user_with_http_info(username, body, **kwargs) + return data + + def update_user_with_http_info(self, username, body, **kwargs): + """ + Updated user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_user_with_http_info(username, body, async=True) + >>> result = thread.get() + + :param async bool + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username', 'body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py new file mode 100644 index 00000000000..9e1fcf24089 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import urllib3 + +import logging +import multiprocessing +import sys + +from six import iteritems +from six.moves import http_client as httplib + + +class Configuration(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """ + Constructor + """ + # Default Base url + self.host = "http://petstore.swagger.io:80/v2" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # access token for OAuth + self.access_token = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """ + Gets the logger_file. + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """ + Sets the logger_file. + + If the logger_file is None, then add stream handler and remove file handler. + Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """ + Gets the debug status. + """ + return self.__debug + + @debug.setter + def debug(self, value): + """ + Sets the debug status. + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """ + Gets the logger_format. + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """ + Sets the logger_format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """ + Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """ + Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ + .get('authorization') + + def auth_settings(self): + """ + Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + + } + + def to_debug_report(self): + """ + Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py b/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py new file mode 100644 index 00000000000..21b5d20fa3c --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/__init__.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into model package +from .additional_properties_class import AdditionalPropertiesClass +from .animal import Animal +from .animal_farm import AnimalFarm +from .api_response import ApiResponse +from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from .array_of_number_only import ArrayOfNumberOnly +from .array_test import ArrayTest +from .capitalization import Capitalization +from .category import Category +from .class_model import ClassModel +from .client import Client +from .enum_arrays import EnumArrays +from .enum_class import EnumClass +from .enum_test import EnumTest +from .format_test import FormatTest +from .has_only_read_only import HasOnlyReadOnly +from .list import List +from .map_test import MapTest +from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from .model_200_response import Model200Response +from .model_return import ModelReturn +from .name import Name +from .number_only import NumberOnly +from .order import Order +from .outer_boolean import OuterBoolean +from .outer_composite import OuterComposite +from .outer_enum import OuterEnum +from .outer_number import OuterNumber +from .outer_string import OuterString +from .pet import Pet +from .read_only_first import ReadOnlyFirst +from .special_model_name import SpecialModelName +from .tag import Tag +from .user import User +from .cat import Cat +from .dog import Dog diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py new file mode 100644 index 00000000000..a5329b411cd --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/additional_properties_class.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class AdditionalPropertiesClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_property': 'dict(str, str)', + 'map_of_map_property': 'dict(str, dict(str, str))' + } + + attribute_map = { + 'map_property': 'map_property', + 'map_of_map_property': 'map_of_map_property' + } + + def __init__(self, map_property=None, map_of_map_property=None): + """ + AdditionalPropertiesClass - a model defined in Swagger + """ + + self._map_property = None + self._map_of_map_property = None + self.discriminator = None + + if map_property is not None: + self.map_property = map_property + if map_of_map_property is not None: + self.map_of_map_property = map_of_map_property + + @property + def map_property(self): + """ + Gets the map_property of this AdditionalPropertiesClass. + + :return: The map_property of this AdditionalPropertiesClass. + :rtype: dict(str, str) + """ + return self._map_property + + @map_property.setter + def map_property(self, map_property): + """ + Sets the map_property of this AdditionalPropertiesClass. + + :param map_property: The map_property of this AdditionalPropertiesClass. + :type: dict(str, str) + """ + + self._map_property = map_property + + @property + def map_of_map_property(self): + """ + Gets the map_of_map_property of this AdditionalPropertiesClass. + + :return: The map_of_map_property of this AdditionalPropertiesClass. + :rtype: dict(str, dict(str, str)) + """ + return self._map_of_map_property + + @map_of_map_property.setter + def map_of_map_property(self, map_of_map_property): + """ + Sets the map_of_map_property of this AdditionalPropertiesClass. + + :param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. + :type: dict(str, dict(str, str)) + """ + + self._map_of_map_property = map_of_map_property + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, AdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py new file mode 100644 index 00000000000..13d8276713d --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Animal(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color' + } + + discriminator_value_class_map = { + '': 'Dog', + '': 'Cat' + } + + def __init__(self, class_name=None, color='red'): + """ + Animal - a model defined in Swagger + """ + + self._class_name = None + self._color = None + self.discriminator = 'className' + + self.class_name = class_name + if color is not None: + self.color = color + + @property + def class_name(self): + """ + Gets the class_name of this Animal. + + :return: The class_name of this Animal. + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """ + Sets the class_name of this Animal. + + :param class_name: The class_name of this Animal. + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") + + self._class_name = class_name + + @property + def color(self): + """ + Gets the color of this Animal. + + :return: The color of this Animal. + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """ + Sets the color of this Animal. + + :param color: The color of this Animal. + :type: str + """ + + self._color = color + + def get_real_child_model(self, data): + """ + Returns the real base class specified by the discriminator + """ + discriminator_value = data[self.discriminator].lower() + if self.discriminator_value_class_map.has_key(discriminator_value): + return self.discriminator_value_class_map[discriminator_value] + else: + return None + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Animal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py new file mode 100644 index 00000000000..fa47d63f881 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal_farm.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class AnimalFarm(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + AnimalFarm - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, AnimalFarm): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py new file mode 100644 index 00000000000..b2d784d8020 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/api_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ApiResponse(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'type': 'type', + 'message': 'message' + } + + def __init__(self, code=None, type=None, message=None): + """ + ApiResponse - a model defined in Swagger + """ + + self._code = None + self._type = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if type is not None: + self.type = type + if message is not None: + self.message = message + + @property + def code(self): + """ + Gets the code of this ApiResponse. + + :return: The code of this ApiResponse. + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this ApiResponse. + + :param code: The code of this ApiResponse. + :type: int + """ + + self._code = code + + @property + def type(self): + """ + Gets the type of this ApiResponse. + + :return: The type of this ApiResponse. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this ApiResponse. + + :param type: The type of this ApiResponse. + :type: str + """ + + self._type = type + + @property + def message(self): + """ + Gets the message of this ApiResponse. + + :return: The message of this ApiResponse. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this ApiResponse. + + :param message: The message of this ApiResponse. + :type: str + """ + + self._message = message + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ApiResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 00000000000..0792f5a8a23 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayOfArrayOfNumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_array_number': 'list[list[float]]' + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' + } + + def __init__(self, array_array_number=None): + """ + ArrayOfArrayOfNumberOnly - a model defined in Swagger + """ + + self._array_array_number = None + self.discriminator = None + + if array_array_number is not None: + self.array_array_number = array_array_number + + @property + def array_array_number(self): + """ + Gets the array_array_number of this ArrayOfArrayOfNumberOnly. + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. + :rtype: list[list[float]] + """ + return self._array_array_number + + @array_array_number.setter + def array_array_number(self, array_array_number): + """ + Sets the array_array_number of this ArrayOfArrayOfNumberOnly. + + :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. + :type: list[list[float]] + """ + + self._array_array_number = array_array_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py new file mode 100644 index 00000000000..9d00e1b37a2 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_of_number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayOfNumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_number': 'list[float]' + } + + attribute_map = { + 'array_number': 'ArrayNumber' + } + + def __init__(self, array_number=None): + """ + ArrayOfNumberOnly - a model defined in Swagger + """ + + self._array_number = None + self.discriminator = None + + if array_number is not None: + self.array_number = array_number + + @property + def array_number(self): + """ + Gets the array_number of this ArrayOfNumberOnly. + + :return: The array_number of this ArrayOfNumberOnly. + :rtype: list[float] + """ + return self._array_number + + @array_number.setter + def array_number(self, array_number): + """ + Sets the array_number of this ArrayOfNumberOnly. + + :param array_number: The array_number of this ArrayOfNumberOnly. + :type: list[float] + """ + + self._array_number = array_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py new file mode 100644 index 00000000000..ac3079087c8 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/array_test.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + + attribute_map = { + 'array_of_string': 'array_of_string', + 'array_array_of_integer': 'array_array_of_integer', + 'array_array_of_model': 'array_array_of_model' + } + + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): + """ + ArrayTest - a model defined in Swagger + """ + + self._array_of_string = None + self._array_array_of_integer = None + self._array_array_of_model = None + self.discriminator = None + + if array_of_string is not None: + self.array_of_string = array_of_string + if array_array_of_integer is not None: + self.array_array_of_integer = array_array_of_integer + if array_array_of_model is not None: + self.array_array_of_model = array_array_of_model + + @property + def array_of_string(self): + """ + Gets the array_of_string of this ArrayTest. + + :return: The array_of_string of this ArrayTest. + :rtype: list[str] + """ + return self._array_of_string + + @array_of_string.setter + def array_of_string(self, array_of_string): + """ + Sets the array_of_string of this ArrayTest. + + :param array_of_string: The array_of_string of this ArrayTest. + :type: list[str] + """ + + self._array_of_string = array_of_string + + @property + def array_array_of_integer(self): + """ + Gets the array_array_of_integer of this ArrayTest. + + :return: The array_array_of_integer of this ArrayTest. + :rtype: list[list[int]] + """ + return self._array_array_of_integer + + @array_array_of_integer.setter + def array_array_of_integer(self, array_array_of_integer): + """ + Sets the array_array_of_integer of this ArrayTest. + + :param array_array_of_integer: The array_array_of_integer of this ArrayTest. + :type: list[list[int]] + """ + + self._array_array_of_integer = array_array_of_integer + + @property + def array_array_of_model(self): + """ + Gets the array_array_of_model of this ArrayTest. + + :return: The array_array_of_model of this ArrayTest. + :rtype: list[list[ReadOnlyFirst]] + """ + return self._array_array_of_model + + @array_array_of_model.setter + def array_array_of_model(self, array_array_of_model): + """ + Sets the array_array_of_model of this ArrayTest. + + :param array_array_of_model: The array_array_of_model of this ArrayTest. + :type: list[list[ReadOnlyFirst]] + """ + + self._array_array_of_model = array_array_of_model + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py new file mode 100644 index 00000000000..c9be6ed4d15 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/capitalization.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Capitalization(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + + attribute_map = { + 'small_camel': 'smallCamel', + 'capital_camel': 'CapitalCamel', + 'small_snake': 'small_Snake', + 'capital_snake': 'Capital_Snake', + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', + 'att_name': 'ATT_NAME' + } + + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): + """ + Capitalization - a model defined in Swagger + """ + + self._small_camel = None + self._capital_camel = None + self._small_snake = None + self._capital_snake = None + self._sca_eth_flow_points = None + self._att_name = None + self.discriminator = None + + if small_camel is not None: + self.small_camel = small_camel + if capital_camel is not None: + self.capital_camel = capital_camel + if small_snake is not None: + self.small_snake = small_snake + if capital_snake is not None: + self.capital_snake = capital_snake + if sca_eth_flow_points is not None: + self.sca_eth_flow_points = sca_eth_flow_points + if att_name is not None: + self.att_name = att_name + + @property + def small_camel(self): + """ + Gets the small_camel of this Capitalization. + + :return: The small_camel of this Capitalization. + :rtype: str + """ + return self._small_camel + + @small_camel.setter + def small_camel(self, small_camel): + """ + Sets the small_camel of this Capitalization. + + :param small_camel: The small_camel of this Capitalization. + :type: str + """ + + self._small_camel = small_camel + + @property + def capital_camel(self): + """ + Gets the capital_camel of this Capitalization. + + :return: The capital_camel of this Capitalization. + :rtype: str + """ + return self._capital_camel + + @capital_camel.setter + def capital_camel(self, capital_camel): + """ + Sets the capital_camel of this Capitalization. + + :param capital_camel: The capital_camel of this Capitalization. + :type: str + """ + + self._capital_camel = capital_camel + + @property + def small_snake(self): + """ + Gets the small_snake of this Capitalization. + + :return: The small_snake of this Capitalization. + :rtype: str + """ + return self._small_snake + + @small_snake.setter + def small_snake(self, small_snake): + """ + Sets the small_snake of this Capitalization. + + :param small_snake: The small_snake of this Capitalization. + :type: str + """ + + self._small_snake = small_snake + + @property + def capital_snake(self): + """ + Gets the capital_snake of this Capitalization. + + :return: The capital_snake of this Capitalization. + :rtype: str + """ + return self._capital_snake + + @capital_snake.setter + def capital_snake(self, capital_snake): + """ + Sets the capital_snake of this Capitalization. + + :param capital_snake: The capital_snake of this Capitalization. + :type: str + """ + + self._capital_snake = capital_snake + + @property + def sca_eth_flow_points(self): + """ + Gets the sca_eth_flow_points of this Capitalization. + + :return: The sca_eth_flow_points of this Capitalization. + :rtype: str + """ + return self._sca_eth_flow_points + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, sca_eth_flow_points): + """ + Sets the sca_eth_flow_points of this Capitalization. + + :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. + :type: str + """ + + self._sca_eth_flow_points = sca_eth_flow_points + + @property + def att_name(self): + """ + Gets the att_name of this Capitalization. + Name of the pet + + :return: The att_name of this Capitalization. + :rtype: str + """ + return self._att_name + + @att_name.setter + def att_name(self, att_name): + """ + Sets the att_name of this Capitalization. + Name of the pet + + :param att_name: The att_name of this Capitalization. + :type: str + """ + + self._att_name = att_name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Capitalization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/cat.py b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py new file mode 100644 index 00000000000..76dfdc0e5b1 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/cat.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Cat(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'declawed': 'bool' + } + + attribute_map = { + 'declawed': 'declawed' + } + + def __init__(self, declawed=None): + """ + Cat - a model defined in Swagger + """ + + self._declawed = None + self.discriminator = None + + if declawed is not None: + self.declawed = declawed + + @property + def declawed(self): + """ + Gets the declawed of this Cat. + + :return: The declawed of this Cat. + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """ + Sets the declawed of this Cat. + + :param declawed: The declawed of this Cat. + :type: bool + """ + + self._declawed = declawed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Cat): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py new file mode 100644 index 00000000000..859283a3f77 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/category.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Category(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): + """ + Category - a model defined in Swagger + """ + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """ + Gets the id of this Category. + + :return: The id of this Category. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Category. + + :param id: The id of this Category. + :type: int + """ + + self._id = id + + @property + def name(self): + """ + Gets the name of this Category. + + :return: The name of this Category. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Category. + + :param name: The name of this Category. + :type: str + """ + + self._name = name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Category): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py new file mode 100644 index 00000000000..7b39d38abe9 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/class_model.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ClassModel(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_class': 'str' + } + + attribute_map = { + '_class': '_class' + } + + def __init__(self, _class=None): + """ + ClassModel - a model defined in Swagger + """ + + self.__class = None + self.discriminator = None + + if _class is not None: + self._class = _class + + @property + def _class(self): + """ + Gets the _class of this ClassModel. + + :return: The _class of this ClassModel. + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """ + Sets the _class of this ClassModel. + + :param _class: The _class of this ClassModel. + :type: str + """ + + self.__class = _class + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ClassModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/client.py b/samples/client/petstore/python-asyncio/petstore_api/models/client.py new file mode 100644 index 00000000000..395f77913cc --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/client.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Client(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client': 'str' + } + + attribute_map = { + 'client': 'client' + } + + def __init__(self, client=None): + """ + Client - a model defined in Swagger + """ + + self._client = None + self.discriminator = None + + if client is not None: + self.client = client + + @property + def client(self): + """ + Gets the client of this Client. + + :return: The client of this Client. + :rtype: str + """ + return self._client + + @client.setter + def client(self, client): + """ + Sets the client of this Client. + + :param client: The client of this Client. + :type: str + """ + + self._client = client + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Client): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/dog.py b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py new file mode 100644 index 00000000000..3c159ad0d6f --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/dog.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Dog(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'breed': 'str' + } + + attribute_map = { + 'breed': 'breed' + } + + def __init__(self, breed=None): + """ + Dog - a model defined in Swagger + """ + + self._breed = None + self.discriminator = None + + if breed is not None: + self.breed = breed + + @property + def breed(self): + """ + Gets the breed of this Dog. + + :return: The breed of this Dog. + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """ + Sets the breed of this Dog. + + :param breed: The breed of this Dog. + :type: str + """ + + self._breed = breed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Dog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py new file mode 100644 index 00000000000..893085ea235 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_arrays.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumArrays(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + + attribute_map = { + 'just_symbol': 'just_symbol', + 'array_enum': 'array_enum' + } + + def __init__(self, just_symbol=None, array_enum=None): + """ + EnumArrays - a model defined in Swagger + """ + + self._just_symbol = None + self._array_enum = None + self.discriminator = None + + if just_symbol is not None: + self.just_symbol = just_symbol + if array_enum is not None: + self.array_enum = array_enum + + @property + def just_symbol(self): + """ + Gets the just_symbol of this EnumArrays. + + :return: The just_symbol of this EnumArrays. + :rtype: str + """ + return self._just_symbol + + @just_symbol.setter + def just_symbol(self, just_symbol): + """ + Sets the just_symbol of this EnumArrays. + + :param just_symbol: The just_symbol of this EnumArrays. + :type: str + """ + allowed_values = [">=", "$"] + if just_symbol not in allowed_values: + raise ValueError( + "Invalid value for `just_symbol` ({0}), must be one of {1}" + .format(just_symbol, allowed_values) + ) + + self._just_symbol = just_symbol + + @property + def array_enum(self): + """ + Gets the array_enum of this EnumArrays. + + :return: The array_enum of this EnumArrays. + :rtype: list[str] + """ + return self._array_enum + + @array_enum.setter + def array_enum(self, array_enum): + """ + Sets the array_enum of this EnumArrays. + + :param array_enum: The array_enum of this EnumArrays. + :type: list[str] + """ + allowed_values = ["fish", "crab"] + if not set(array_enum).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" + .format(", ".join(map(str, set(array_enum)-set(allowed_values))), + ", ".join(map(str, allowed_values))) + ) + + self._array_enum = array_enum + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumArrays): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py new file mode 100644 index 00000000000..d9e0b771a7d --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_class.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _ABC = "_abc" + _EFG = "-efg" + _XYZ_ = "(xyz)" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + EnumClass - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py new file mode 100644 index 00000000000..6d7caa1f4bc --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enum_string': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } + + attribute_map = { + 'enum_string': 'enum_string', + 'enum_integer': 'enum_integer', + 'enum_number': 'enum_number', + 'outer_enum': 'outerEnum' + } + + def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): + """ + EnumTest - a model defined in Swagger + """ + + self._enum_string = None + self._enum_integer = None + self._enum_number = None + self._outer_enum = None + self.discriminator = None + + if enum_string is not None: + self.enum_string = enum_string + if enum_integer is not None: + self.enum_integer = enum_integer + if enum_number is not None: + self.enum_number = enum_number + if outer_enum is not None: + self.outer_enum = outer_enum + + @property + def enum_string(self): + """ + Gets the enum_string of this EnumTest. + + :return: The enum_string of this EnumTest. + :rtype: str + """ + return self._enum_string + + @enum_string.setter + def enum_string(self, enum_string): + """ + Sets the enum_string of this EnumTest. + + :param enum_string: The enum_string of this EnumTest. + :type: str + """ + allowed_values = ["UPPER", "lower", ""] + if enum_string not in allowed_values: + raise ValueError( + "Invalid value for `enum_string` ({0}), must be one of {1}" + .format(enum_string, allowed_values) + ) + + self._enum_string = enum_string + + @property + def enum_integer(self): + """ + Gets the enum_integer of this EnumTest. + + :return: The enum_integer of this EnumTest. + :rtype: int + """ + return self._enum_integer + + @enum_integer.setter + def enum_integer(self, enum_integer): + """ + Sets the enum_integer of this EnumTest. + + :param enum_integer: The enum_integer of this EnumTest. + :type: int + """ + allowed_values = [1, -1] + if enum_integer not in allowed_values: + raise ValueError( + "Invalid value for `enum_integer` ({0}), must be one of {1}" + .format(enum_integer, allowed_values) + ) + + self._enum_integer = enum_integer + + @property + def enum_number(self): + """ + Gets the enum_number of this EnumTest. + + :return: The enum_number of this EnumTest. + :rtype: float + """ + return self._enum_number + + @enum_number.setter + def enum_number(self, enum_number): + """ + Sets the enum_number of this EnumTest. + + :param enum_number: The enum_number of this EnumTest. + :type: float + """ + allowed_values = [1.1, -1.2] + if enum_number not in allowed_values: + raise ValueError( + "Invalid value for `enum_number` ({0}), must be one of {1}" + .format(enum_number, allowed_values) + ) + + self._enum_number = enum_number + + @property + def outer_enum(self): + """ + Gets the outer_enum of this EnumTest. + + :return: The outer_enum of this EnumTest. + :rtype: OuterEnum + """ + return self._outer_enum + + @outer_enum.setter + def outer_enum(self, outer_enum): + """ + Sets the outer_enum of this EnumTest. + + :param outer_enum: The outer_enum of this EnumTest. + :type: OuterEnum + """ + + self._outer_enum = outer_enum + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py new file mode 100644 index 00000000000..139d1733b35 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/format_test.py @@ -0,0 +1,468 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class FormatTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + 'float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'str', + 'date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + 'float': 'float', + 'double': 'double', + 'string': 'string', + 'byte': 'byte', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'uuid': 'uuid', + 'password': 'password' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): + """ + FormatTest - a model defined in Swagger + """ + + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self._float = None + self._double = None + self._string = None + self._byte = None + self._binary = None + self._date = None + self._date_time = None + self._uuid = None + self._password = None + self.discriminator = None + + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if float is not None: + self.float = float + if double is not None: + self.double = double + if string is not None: + self.string = string + self.byte = byte + if binary is not None: + self.binary = binary + self.date = date + if date_time is not None: + self.date_time = date_time + if uuid is not None: + self.uuid = uuid + self.password = password + + @property + def integer(self): + """ + Gets the integer of this FormatTest. + + :return: The integer of this FormatTest. + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """ + Sets the integer of this FormatTest. + + :param integer: The integer of this FormatTest. + :type: int + """ + if integer is not None and integer > 100: + raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") + if integer is not None and integer < 10: + raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") + + self._integer = integer + + @property + def int32(self): + """ + Gets the int32 of this FormatTest. + + :return: The int32 of this FormatTest. + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """ + Sets the int32 of this FormatTest. + + :param int32: The int32 of this FormatTest. + :type: int + """ + if int32 is not None and int32 > 200: + raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") + if int32 is not None and int32 < 20: + raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") + + self._int32 = int32 + + @property + def int64(self): + """ + Gets the int64 of this FormatTest. + + :return: The int64 of this FormatTest. + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """ + Sets the int64 of this FormatTest. + + :param int64: The int64 of this FormatTest. + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """ + Gets the number of this FormatTest. + + :return: The number of this FormatTest. + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """ + Sets the number of this FormatTest. + + :param number: The number of this FormatTest. + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") + if number is not None and number > 543.2: + raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") + if number is not None and number < 32.1: + raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") + + self._number = number + + @property + def float(self): + """ + Gets the float of this FormatTest. + + :return: The float of this FormatTest. + :rtype: float + """ + return self._float + + @float.setter + def float(self, float): + """ + Sets the float of this FormatTest. + + :param float: The float of this FormatTest. + :type: float + """ + if float is not None and float > 987.6: + raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") + if float is not None and float < 54.3: + raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") + + self._float = float + + @property + def double(self): + """ + Gets the double of this FormatTest. + + :return: The double of this FormatTest. + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """ + Sets the double of this FormatTest. + + :param double: The double of this FormatTest. + :type: float + """ + if double is not None and double > 123.4: + raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") + if double is not None and double < 67.8: + raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") + + self._double = double + + @property + def string(self): + """ + Gets the string of this FormatTest. + + :return: The string of this FormatTest. + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """ + Sets the string of this FormatTest. + + :param string: The string of this FormatTest. + :type: str + """ + if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): + raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") + + self._string = string + + @property + def byte(self): + """ + Gets the byte of this FormatTest. + + :return: The byte of this FormatTest. + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """ + Sets the byte of this FormatTest. + + :param byte: The byte of this FormatTest. + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") + if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): + raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") + + self._byte = byte + + @property + def binary(self): + """ + Gets the binary of this FormatTest. + + :return: The binary of this FormatTest. + :rtype: str + """ + return self._binary + + @binary.setter + def binary(self, binary): + """ + Sets the binary of this FormatTest. + + :param binary: The binary of this FormatTest. + :type: str + """ + + self._binary = binary + + @property + def date(self): + """ + Gets the date of this FormatTest. + + :return: The date of this FormatTest. + :rtype: date + """ + return self._date + + @date.setter + def date(self, date): + """ + Sets the date of this FormatTest. + + :param date: The date of this FormatTest. + :type: date + """ + if date is None: + raise ValueError("Invalid value for `date`, must not be `None`") + + self._date = date + + @property + def date_time(self): + """ + Gets the date_time of this FormatTest. + + :return: The date_time of this FormatTest. + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """ + Sets the date_time of this FormatTest. + + :param date_time: The date_time of this FormatTest. + :type: datetime + """ + + self._date_time = date_time + + @property + def uuid(self): + """ + Gets the uuid of this FormatTest. + + :return: The uuid of this FormatTest. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """ + Sets the uuid of this FormatTest. + + :param uuid: The uuid of this FormatTest. + :type: str + """ + + self._uuid = uuid + + @property + def password(self): + """ + Gets the password of this FormatTest. + + :return: The password of this FormatTest. + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """ + Sets the password of this FormatTest. + + :param password: The password of this FormatTest. + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") + if password is not None and len(password) > 64: + raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") + if password is not None and len(password) < 10: + raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") + + self._password = password + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, FormatTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py new file mode 100644 index 00000000000..da0c14ec5b1 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/has_only_read_only.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class HasOnlyReadOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'foo': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'foo': 'foo' + } + + def __init__(self, bar=None, foo=None): + """ + HasOnlyReadOnly - a model defined in Swagger + """ + + self._bar = None + self._foo = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if foo is not None: + self.foo = foo + + @property + def bar(self): + """ + Gets the bar of this HasOnlyReadOnly. + + :return: The bar of this HasOnlyReadOnly. + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """ + Sets the bar of this HasOnlyReadOnly. + + :param bar: The bar of this HasOnlyReadOnly. + :type: str + """ + + self._bar = bar + + @property + def foo(self): + """ + Gets the foo of this HasOnlyReadOnly. + + :return: The foo of this HasOnlyReadOnly. + :rtype: str + """ + return self._foo + + @foo.setter + def foo(self, foo): + """ + Sets the foo of this HasOnlyReadOnly. + + :param foo: The foo of this HasOnlyReadOnly. + :type: str + """ + + self._foo = foo + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, HasOnlyReadOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/list.py b/samples/client/petstore/python-asyncio/petstore_api/models/list.py new file mode 100644 index 00000000000..2ac0e51fb12 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/list.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class List(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_123_list': 'str' + } + + attribute_map = { + '_123_list': '123-list' + } + + def __init__(self, _123_list=None): + """ + List - a model defined in Swagger + """ + + self.__123_list = None + self.discriminator = None + + if _123_list is not None: + self._123_list = _123_list + + @property + def _123_list(self): + """ + Gets the _123_list of this List. + + :return: The _123_list of this List. + :rtype: str + """ + return self.__123_list + + @_123_list.setter + def _123_list(self, _123_list): + """ + Sets the _123_list of this List. + + :param _123_list: The _123_list of this List. + :type: str + """ + + self.__123_list = _123_list + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, List): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py new file mode 100644 index 00000000000..3cb936e0db8 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/map_test.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class MapTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)' + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', + 'map_of_enum_string': 'map_of_enum_string' + } + + def __init__(self, map_map_of_string=None, map_of_enum_string=None): + """ + MapTest - a model defined in Swagger + """ + + self._map_map_of_string = None + self._map_of_enum_string = None + self.discriminator = None + + if map_map_of_string is not None: + self.map_map_of_string = map_map_of_string + if map_of_enum_string is not None: + self.map_of_enum_string = map_of_enum_string + + @property + def map_map_of_string(self): + """ + Gets the map_map_of_string of this MapTest. + + :return: The map_map_of_string of this MapTest. + :rtype: dict(str, dict(str, str)) + """ + return self._map_map_of_string + + @map_map_of_string.setter + def map_map_of_string(self, map_map_of_string): + """ + Sets the map_map_of_string of this MapTest. + + :param map_map_of_string: The map_map_of_string of this MapTest. + :type: dict(str, dict(str, str)) + """ + + self._map_map_of_string = map_map_of_string + + @property + def map_of_enum_string(self): + """ + Gets the map_of_enum_string of this MapTest. + + :return: The map_of_enum_string of this MapTest. + :rtype: dict(str, str) + """ + return self._map_of_enum_string + + @map_of_enum_string.setter + def map_of_enum_string(self, map_of_enum_string): + """ + Sets the map_of_enum_string of this MapTest. + + :param map_of_enum_string: The map_of_enum_string of this MapTest. + :type: dict(str, str) + """ + allowed_values = ["UPPER", "lower"] + if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" + .format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), + ", ".join(map(str, allowed_values))) + ) + + self._map_of_enum_string = map_of_enum_string + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, MapTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..4b773deacef --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class MixedPropertiesAndAdditionalPropertiesClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + + attribute_map = { + 'uuid': 'uuid', + 'date_time': 'dateTime', + 'map': 'map' + } + + def __init__(self, uuid=None, date_time=None, map=None): + """ + MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger + """ + + self._uuid = None + self._date_time = None + self._map = None + self.discriminator = None + + if uuid is not None: + self.uuid = uuid + if date_time is not None: + self.date_time = date_time + if map is not None: + self.map = map + + @property + def uuid(self): + """ + Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """ + Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + :type: str + """ + + self._uuid = uuid + + @property + def date_time(self): + """ + Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """ + Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + :type: datetime + """ + + self._date_time = date_time + + @property + def map(self): + """ + Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: dict(str, Animal) + """ + return self._map + + @map.setter + def map(self, map): + """ + Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. + :type: dict(str, Animal) + """ + + self._map = map + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py new file mode 100644 index 00000000000..2b6aeb090c0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model_200_response.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Model200Response(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + '_class': 'str' + } + + attribute_map = { + 'name': 'name', + '_class': 'class' + } + + def __init__(self, name=None, _class=None): + """ + Model200Response - a model defined in Swagger + """ + + self._name = None + self.__class = None + self.discriminator = None + + if name is not None: + self.name = name + if _class is not None: + self._class = _class + + @property + def name(self): + """ + Gets the name of this Model200Response. + + :return: The name of this Model200Response. + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Model200Response. + + :param name: The name of this Model200Response. + :type: int + """ + + self._name = name + + @property + def _class(self): + """ + Gets the _class of this Model200Response. + + :return: The _class of this Model200Response. + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """ + Sets the _class of this Model200Response. + + :param _class: The _class of this Model200Response. + :type: str + """ + + self.__class = _class + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Model200Response): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py new file mode 100644 index 00000000000..a2160d21dd1 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/model_return.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ModelReturn(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_return': 'int' + } + + attribute_map = { + '_return': 'return' + } + + def __init__(self, _return=None): + """ + ModelReturn - a model defined in Swagger + """ + + self.__return = None + self.discriminator = None + + if _return is not None: + self._return = _return + + @property + def _return(self): + """ + Gets the _return of this ModelReturn. + + :return: The _return of this ModelReturn. + :rtype: int + """ + return self.__return + + @_return.setter + def _return(self, _return): + """ + Sets the _return of this ModelReturn. + + :param _return: The _return of this ModelReturn. + :type: int + """ + + self.__return = _return + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ModelReturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/name.py b/samples/client/petstore/python-asyncio/petstore_api/models/name.py new file mode 100644 index 00000000000..52b51890dde --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/name.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Name(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } + + attribute_map = { + 'name': 'name', + 'snake_case': 'snake_case', + '_property': 'property', + '_123_number': '123Number' + } + + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): + """ + Name - a model defined in Swagger + """ + + self._name = None + self._snake_case = None + self.__property = None + self.__123_number = None + self.discriminator = None + + self.name = name + if snake_case is not None: + self.snake_case = snake_case + if _property is not None: + self._property = _property + if _123_number is not None: + self._123_number = _123_number + + @property + def name(self): + """ + Gets the name of this Name. + + :return: The name of this Name. + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Name. + + :param name: The name of this Name. + :type: int + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") + + self._name = name + + @property + def snake_case(self): + """ + Gets the snake_case of this Name. + + :return: The snake_case of this Name. + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """ + Sets the snake_case of this Name. + + :param snake_case: The snake_case of this Name. + :type: int + """ + + self._snake_case = snake_case + + @property + def _property(self): + """ + Gets the _property of this Name. + + :return: The _property of this Name. + :rtype: str + """ + return self.__property + + @_property.setter + def _property(self, _property): + """ + Sets the _property of this Name. + + :param _property: The _property of this Name. + :type: str + """ + + self.__property = _property + + @property + def _123_number(self): + """ + Gets the _123_number of this Name. + + :return: The _123_number of this Name. + :rtype: int + """ + return self.__123_number + + @_123_number.setter + def _123_number(self, _123_number): + """ + Sets the _123_number of this Name. + + :param _123_number: The _123_number of this Name. + :type: int + """ + + self.__123_number = _123_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Name): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py new file mode 100644 index 00000000000..b0e279b53a5 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class NumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_number': 'float' + } + + attribute_map = { + 'just_number': 'JustNumber' + } + + def __init__(self, just_number=None): + """ + NumberOnly - a model defined in Swagger + """ + + self._just_number = None + self.discriminator = None + + if just_number is not None: + self.just_number = just_number + + @property + def just_number(self): + """ + Gets the just_number of this NumberOnly. + + :return: The just_number of this NumberOnly. + :rtype: float + """ + return self._just_number + + @just_number.setter + def just_number(self, just_number): + """ + Sets the just_number of this NumberOnly. + + :param just_number: The just_number of this NumberOnly. + :type: float + """ + + self._just_number = just_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/order.py b/samples/client/petstore/python-asyncio/petstore_api/models/order.py new file mode 100644 index 00000000000..52c7b6c227e --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/order.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Order(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + + attribute_map = { + 'id': 'id', + 'pet_id': 'petId', + 'quantity': 'quantity', + 'ship_date': 'shipDate', + 'status': 'status', + 'complete': 'complete' + } + + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): + """ + Order - a model defined in Swagger + """ + + self._id = None + self._pet_id = None + self._quantity = None + self._ship_date = None + self._status = None + self._complete = None + self.discriminator = None + + if id is not None: + self.id = id + if pet_id is not None: + self.pet_id = pet_id + if quantity is not None: + self.quantity = quantity + if ship_date is not None: + self.ship_date = ship_date + if status is not None: + self.status = status + if complete is not None: + self.complete = complete + + @property + def id(self): + """ + Gets the id of this Order. + + :return: The id of this Order. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Order. + + :param id: The id of this Order. + :type: int + """ + + self._id = id + + @property + def pet_id(self): + """ + Gets the pet_id of this Order. + + :return: The pet_id of this Order. + :rtype: int + """ + return self._pet_id + + @pet_id.setter + def pet_id(self, pet_id): + """ + Sets the pet_id of this Order. + + :param pet_id: The pet_id of this Order. + :type: int + """ + + self._pet_id = pet_id + + @property + def quantity(self): + """ + Gets the quantity of this Order. + + :return: The quantity of this Order. + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """ + Sets the quantity of this Order. + + :param quantity: The quantity of this Order. + :type: int + """ + + self._quantity = quantity + + @property + def ship_date(self): + """ + Gets the ship_date of this Order. + + :return: The ship_date of this Order. + :rtype: datetime + """ + return self._ship_date + + @ship_date.setter + def ship_date(self, ship_date): + """ + Sets the ship_date of this Order. + + :param ship_date: The ship_date of this Order. + :type: datetime + """ + + self._ship_date = ship_date + + @property + def status(self): + """ + Gets the status of this Order. + Order Status + + :return: The status of this Order. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this Order. + Order Status + + :param status: The status of this Order. + :type: str + """ + allowed_values = ["placed", "approved", "delivered"] + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) + + self._status = status + + @property + def complete(self): + """ + Gets the complete of this Order. + + :return: The complete of this Order. + :rtype: bool + """ + return self._complete + + @complete.setter + def complete(self, complete): + """ + Sets the complete of this Order. + + :param complete: The complete of this Order. + :type: bool + """ + + self._complete = complete + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Order): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py new file mode 100644 index 00000000000..aa9aee11973 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_boolean.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterBoolean(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterBoolean - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterBoolean): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py new file mode 100644 index 00000000000..81611c17688 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_composite.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterComposite(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'my_number': 'OuterNumber', + 'my_string': 'OuterString', + 'my_boolean': 'OuterBoolean' + } + + attribute_map = { + 'my_number': 'my_number', + 'my_string': 'my_string', + 'my_boolean': 'my_boolean' + } + + def __init__(self, my_number=None, my_string=None, my_boolean=None): + """ + OuterComposite - a model defined in Swagger + """ + + self._my_number = None + self._my_string = None + self._my_boolean = None + self.discriminator = None + + if my_number is not None: + self.my_number = my_number + if my_string is not None: + self.my_string = my_string + if my_boolean is not None: + self.my_boolean = my_boolean + + @property + def my_number(self): + """ + Gets the my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. + :rtype: OuterNumber + """ + return self._my_number + + @my_number.setter + def my_number(self, my_number): + """ + Sets the my_number of this OuterComposite. + + :param my_number: The my_number of this OuterComposite. + :type: OuterNumber + """ + + self._my_number = my_number + + @property + def my_string(self): + """ + Gets the my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. + :rtype: OuterString + """ + return self._my_string + + @my_string.setter + def my_string(self, my_string): + """ + Sets the my_string of this OuterComposite. + + :param my_string: The my_string of this OuterComposite. + :type: OuterString + """ + + self._my_string = my_string + + @property + def my_boolean(self): + """ + Gets the my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. + :rtype: OuterBoolean + """ + return self._my_boolean + + @my_boolean.setter + def my_boolean(self, my_boolean): + """ + Sets the my_boolean of this OuterComposite. + + :param my_boolean: The my_boolean of this OuterComposite. + :type: OuterBoolean + """ + + self._my_boolean = my_boolean + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterComposite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py new file mode 100644 index 00000000000..8772472c655 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_enum.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterEnum(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PLACED = "placed" + APPROVED = "approved" + DELIVERED = "delivered" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterEnum - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py new file mode 100644 index 00000000000..04c44923fb0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_number.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterNumber(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterNumber - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py new file mode 100644 index 00000000000..fd2d7c7623e --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/outer_string.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterString(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterString - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/pet.py b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py new file mode 100644 index 00000000000..e1afa26f785 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/pet.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Pet(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'name': 'name', + 'photo_urls': 'photoUrls', + 'tags': 'tags', + 'status': 'status' + } + + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): + """ + Pet - a model defined in Swagger + """ + + self._id = None + self._category = None + self._name = None + self._photo_urls = None + self._tags = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if category is not None: + self.category = category + self.name = name + self.photo_urls = photo_urls + if tags is not None: + self.tags = tags + if status is not None: + self.status = status + + @property + def id(self): + """ + Gets the id of this Pet. + + :return: The id of this Pet. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Pet. + + :param id: The id of this Pet. + :type: int + """ + + self._id = id + + @property + def category(self): + """ + Gets the category of this Pet. + + :return: The category of this Pet. + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """ + Sets the category of this Pet. + + :param category: The category of this Pet. + :type: Category + """ + + self._category = category + + @property + def name(self): + """ + Gets the name of this Pet. + + :return: The name of this Pet. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Pet. + + :param name: The name of this Pet. + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") + + self._name = name + + @property + def photo_urls(self): + """ + Gets the photo_urls of this Pet. + + :return: The photo_urls of this Pet. + :rtype: list[str] + """ + return self._photo_urls + + @photo_urls.setter + def photo_urls(self, photo_urls): + """ + Sets the photo_urls of this Pet. + + :param photo_urls: The photo_urls of this Pet. + :type: list[str] + """ + if photo_urls is None: + raise ValueError("Invalid value for `photo_urls`, must not be `None`") + + self._photo_urls = photo_urls + + @property + def tags(self): + """ + Gets the tags of this Pet. + + :return: The tags of this Pet. + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """ + Sets the tags of this Pet. + + :param tags: The tags of this Pet. + :type: list[Tag] + """ + + self._tags = tags + + @property + def status(self): + """ + Gets the status of this Pet. + pet status in the store + + :return: The status of this Pet. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this Pet. + pet status in the store + + :param status: The status of this Pet. + :type: str + """ + allowed_values = ["available", "pending", "sold"] + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Pet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py new file mode 100644 index 00000000000..a26d1f33c87 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/read_only_first.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ReadOnlyFirst(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'baz': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'baz': 'baz' + } + + def __init__(self, bar=None, baz=None): + """ + ReadOnlyFirst - a model defined in Swagger + """ + + self._bar = None + self._baz = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if baz is not None: + self.baz = baz + + @property + def bar(self): + """ + Gets the bar of this ReadOnlyFirst. + + :return: The bar of this ReadOnlyFirst. + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """ + Sets the bar of this ReadOnlyFirst. + + :param bar: The bar of this ReadOnlyFirst. + :type: str + """ + + self._bar = bar + + @property + def baz(self): + """ + Gets the baz of this ReadOnlyFirst. + + :return: The baz of this ReadOnlyFirst. + :rtype: str + """ + return self._baz + + @baz.setter + def baz(self, baz): + """ + Sets the baz of this ReadOnlyFirst. + + :param baz: The baz of this ReadOnlyFirst. + :type: str + """ + + self._baz = baz + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ReadOnlyFirst): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py new file mode 100644 index 00000000000..6be888fb9e3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/special_model_name.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class SpecialModelName(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'special_property_name': 'int' + } + + attribute_map = { + 'special_property_name': '$special[property.name]' + } + + def __init__(self, special_property_name=None): + """ + SpecialModelName - a model defined in Swagger + """ + + self._special_property_name = None + self.discriminator = None + + if special_property_name is not None: + self.special_property_name = special_property_name + + @property + def special_property_name(self): + """ + Gets the special_property_name of this SpecialModelName. + + :return: The special_property_name of this SpecialModelName. + :rtype: int + """ + return self._special_property_name + + @special_property_name.setter + def special_property_name(self, special_property_name): + """ + Sets the special_property_name of this SpecialModelName. + + :param special_property_name: The special_property_name of this SpecialModelName. + :type: int + """ + + self._special_property_name = special_property_name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, SpecialModelName): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/tag.py b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py new file mode 100644 index 00000000000..d59a490a07d --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/tag.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Tag(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): + """ + Tag - a model defined in Swagger + """ + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """ + Gets the id of this Tag. + + :return: The id of this Tag. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Tag. + + :param id: The id of this Tag. + :type: int + """ + + self._id = id + + @property + def name(self): + """ + Gets the name of this Tag. + + :return: The name of this Tag. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Tag. + + :param name: The name of this Tag. + :type: str + """ + + self._name = name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Tag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/user.py b/samples/client/petstore/python-asyncio/petstore_api/models/user.py new file mode 100644 index 00000000000..21993e90521 --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/models/user.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class User(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email': 'email', + 'password': 'password', + 'phone': 'phone', + 'user_status': 'userStatus' + } + + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): + """ + User - a model defined in Swagger + """ + + self._id = None + self._username = None + self._first_name = None + self._last_name = None + self._email = None + self._password = None + self._phone = None + self._user_status = None + self.discriminator = None + + if id is not None: + self.id = id + if username is not None: + self.username = username + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if email is not None: + self.email = email + if password is not None: + self.password = password + if phone is not None: + self.phone = phone + if user_status is not None: + self.user_status = user_status + + @property + def id(self): + """ + Gets the id of this User. + + :return: The id of this User. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this User. + + :param id: The id of this User. + :type: int + """ + + self._id = id + + @property + def username(self): + """ + Gets the username of this User. + + :return: The username of this User. + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """ + Sets the username of this User. + + :param username: The username of this User. + :type: str + """ + + self._username = username + + @property + def first_name(self): + """ + Gets the first_name of this User. + + :return: The first_name of this User. + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """ + Sets the first_name of this User. + + :param first_name: The first_name of this User. + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """ + Gets the last_name of this User. + + :return: The last_name of this User. + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """ + Sets the last_name of this User. + + :param last_name: The last_name of this User. + :type: str + """ + + self._last_name = last_name + + @property + def email(self): + """ + Gets the email of this User. + + :return: The email of this User. + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """ + Sets the email of this User. + + :param email: The email of this User. + :type: str + """ + + self._email = email + + @property + def password(self): + """ + Gets the password of this User. + + :return: The password of this User. + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """ + Sets the password of this User. + + :param password: The password of this User. + :type: str + """ + + self._password = password + + @property + def phone(self): + """ + Gets the phone of this User. + + :return: The phone of this User. + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """ + Sets the phone of this User. + + :param phone: The phone of this User. + :type: str + """ + + self._phone = phone + + @property + def user_status(self): + """ + Gets the user_status of this User. + User Status + + :return: The user_status of this User. + :rtype: int + """ + return self._user_status + + @user_status.setter + def user_status(self, user_status): + """ + Sets the user_status of this User. + User Status + + :param user_status: The user_status of this User. + :type: int + """ + + self._user_status = user_status + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-asyncio/petstore_api/rest.py b/samples/client/petstore/python-asyncio/petstore_api/rest.py new file mode 100644 index 00000000000..8cb130e035b --- /dev/null +++ b/samples/client/petstore/python-asyncio/petstore_api/rest.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import aiohttp +import io +import json +import ssl +import certifi +import logging +import re + +# python 2 and python 3 compatibility library +from six import PY3 +from six.moves.urllib.parse import urlencode + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp, data): + self.aiohttp_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = data + + def getheaders(self): + """ + Returns a CIMultiDictProxy of the response headers. + """ + return self.aiohttp_response.headers + + def getheader(self, name, default=None): + """ + Returns a given response header. + """ + return self.aiohttp_response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration, pools_size=4, maxsize=4): + # maxsize is the number of requests to host that are allowed in parallel + # ca_certs vs cert_file vs key_file + # http://stackoverflow.com/a/23957365/2985775 + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + ssl_context = ssl.SSLContext() + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + connector = aiohttp.TCPConnector( + limit=maxsize, + verify_ssl=configuration.verify_ssl + ) + + # https pool manager + if configuration.proxy: + self.pool_manager = aiohttp.ClientSession( + connector=connector, + proxy=configuration.proxy + ) + else: + self.pool_manager = aiohttp.ClientSession( + connector=connector + ) + + async def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, _request_timeout=None): + """ + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: this is a non-applicable field for the AiohttpClient. + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + timeout = _request_timeout or 5 * 60 + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body is not None: + body = json.dumps(body) + args["data"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + data = aiohttp.FormData() + for k, v in post_params.items(): + data.add_field(k, v) + args["data"] = data + elif headers['Content-Type'] == 'multipart/form-data': + args["data"] = post_params + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided arguments. + Please check that your arguments match declared content type.""" + raise ApiException(status=0, reason=msg) + else: + args["data"] = query_params + + async with self.pool_manager.request(**args) as r: + data = await r.text() + r = RESTResponse(r, data) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + async def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return (await self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params)) + + async def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return (await self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params)) + + async def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + return (await self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body)) + + async def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): + return (await self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body)) + + async def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + return (await self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body)) + + async def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + return (await self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body)) + + async def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + return (await self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body)) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """ + Custom error messages for exception + """ + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format(self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/samples/client/petstore/python-asyncio/requirements.txt b/samples/client/petstore/python-asyncio/requirements.txt new file mode 100644 index 00000000000..bafdc07532f --- /dev/null +++ b/samples/client/petstore/python-asyncio/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/client/petstore/python-asyncio/setup.py b/samples/client/petstore/python-asyncio/setup.py new file mode 100644 index 00000000000..b04ac0abe10 --- /dev/null +++ b/samples/client/petstore/python-asyncio/setup.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import sys +from setuptools import setup, find_packages + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES.append("aiohttp") + +setup( + name=NAME, + version=VERSION, + description="Swagger Petstore", + author_email="apiteam@swagger.io", + url="", + keywords=["Swagger", "Swagger Petstore"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_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: \" \\ + """ +) diff --git a/samples/client/petstore/python-asyncio/test-requirements.txt b/samples/client/petstore/python-asyncio/test-requirements.txt new file mode 100644 index 00000000000..2702246c0e6 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test-requirements.txt @@ -0,0 +1,5 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/samples/client/petstore/python-asyncio/test/__init__.py b/samples/client/petstore/python-asyncio/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py new file mode 100644 index 00000000000..e90e5f92efc --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_additional_properties_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """ AdditionalPropertiesClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """ + Test AdditionalPropertiesClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_animal.py b/samples/client/petstore/python-asyncio/test/test_animal.py new file mode 100644 index 00000000000..c675d583ccc --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_animal.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal import Animal + + +class TestAnimal(unittest.TestCase): + """ Animal unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """ + Test Animal + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.animal.Animal() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_animal_farm.py b/samples/client/petstore/python-asyncio/test/test_animal_farm.py new file mode 100644 index 00000000000..e459318a948 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_animal_farm.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal_farm import AnimalFarm + + +class TestAnimalFarm(unittest.TestCase): + """ AnimalFarm unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimalFarm(self): + """ + Test AnimalFarm + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.animal_farm.AnimalFarm() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_another_fake_api.py b/samples/client/petstore/python-asyncio/test/test_another_fake_api.py new file mode 100644 index 00000000000..9f562fe1134 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_another_fake_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.another_fake_api import AnotherFakeApi + + +class TestAnotherFakeApi(unittest.TestCase): + """ AnotherFakeApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.another_fake_api.AnotherFakeApi() + + def tearDown(self): + pass + + def test_test_special_tags(self): + """ + Test case for test_special_tags + + To test special tags + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_api_response.py b/samples/client/petstore/python-asyncio/test/test_api_response.py new file mode 100644 index 00000000000..928af048b43 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_api_response.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.api_response import ApiResponse + + +class TestApiResponse(unittest.TestCase): + """ ApiResponse unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """ + Test ApiResponse + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.api_response.ApiResponse() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..740e45cbafd --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_array_of_array_of_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ ArrayOfArrayOfNumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """ + Test ArrayOfArrayOfNumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py b/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py new file mode 100644 index 00000000000..6da67a490b6 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_array_of_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ ArrayOfNumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """ + Test ArrayOfNumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_array_test.py b/samples/client/petstore/python-asyncio/test/test_array_test.py new file mode 100644 index 00000000000..dcf8cc111c0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_array_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_test import ArrayTest + + +class TestArrayTest(unittest.TestCase): + """ ArrayTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """ + Test ArrayTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_test.ArrayTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_capitalization.py b/samples/client/petstore/python-asyncio/test/test_capitalization.py new file mode 100644 index 00000000000..4ea6d2e3fd0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_capitalization.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.capitalization import Capitalization + + +class TestCapitalization(unittest.TestCase): + """ Capitalization unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """ + Test Capitalization + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.capitalization.Capitalization() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_cat.py b/samples/client/petstore/python-asyncio/test/test_cat.py new file mode 100644 index 00000000000..9d9fbc50ab3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_cat.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.cat import Cat + + +class TestCat(unittest.TestCase): + """ Cat unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """ + Test Cat + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.cat.Cat() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_category.py b/samples/client/petstore/python-asyncio/test/test_category.py new file mode 100644 index 00000000000..6ded8f0f1ac --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_category.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.category import Category + + +class TestCategory(unittest.TestCase): + """ Category unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """ + Test Category + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.category.Category() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_class_model.py b/samples/client/petstore/python-asyncio/test/test_class_model.py new file mode 100644 index 00000000000..85d56bbe52a --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_class_model.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.class_model import ClassModel + + +class TestClassModel(unittest.TestCase): + """ ClassModel unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """ + Test ClassModel + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.class_model.ClassModel() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_client.py b/samples/client/petstore/python-asyncio/test/test_client.py new file mode 100644 index 00000000000..363ced2923c --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_client.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.client import Client + + +class TestClient(unittest.TestCase): + """ Client unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """ + Test Client + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.client.Client() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_dog.py b/samples/client/petstore/python-asyncio/test/test_dog.py new file mode 100644 index 00000000000..b0428646591 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_dog.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.dog import Dog + + +class TestDog(unittest.TestCase): + """ Dog unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """ + Test Dog + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.dog.Dog() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_arrays.py b/samples/client/petstore/python-asyncio/test/test_enum_arrays.py new file mode 100644 index 00000000000..2803f17aede --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_enum_arrays.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_arrays import EnumArrays + + +class TestEnumArrays(unittest.TestCase): + """ EnumArrays unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """ + Test EnumArrays + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_arrays.EnumArrays() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_class.py b/samples/client/petstore/python-asyncio/test/test_enum_class.py new file mode 100644 index 00000000000..f673e741f84 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_enum_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_class import EnumClass + + +class TestEnumClass(unittest.TestCase): + """ EnumClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """ + Test EnumClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_class.EnumClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_enum_test.py b/samples/client/petstore/python-asyncio/test/test_enum_test.py new file mode 100644 index 00000000000..e27c0107fd2 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_enum_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_test import EnumTest + + +class TestEnumTest(unittest.TestCase): + """ EnumTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """ + Test EnumTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_test.EnumTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_fake_api.py b/samples/client/petstore/python-asyncio/test/test_fake_api.py new file mode 100644 index 00000000000..55a02cf899c --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_fake_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.fake_api import FakeApi + + +class TestFakeApi(unittest.TestCase): + """ FakeApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.fake_api.FakeApi() + + def tearDown(self): + pass + + def test_fake_outer_boolean_serialize(self): + """ + Test case for fake_outer_boolean_serialize + + + """ + pass + + def test_fake_outer_composite_serialize(self): + """ + Test case for fake_outer_composite_serialize + + + """ + pass + + def test_fake_outer_number_serialize(self): + """ + Test case for fake_outer_number_serialize + + + """ + pass + + def test_fake_outer_string_serialize(self): + """ + Test case for fake_outer_string_serialize + + + """ + pass + + def test_test_client_model(self): + """ + Test case for test_client_model + + To test \"client\" model + """ + pass + + def test_test_endpoint_parameters(self): + """ + Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + """ + pass + + def test_test_enum_parameters(self): + """ + Test case for test_enum_parameters + + To test enum parameters + """ + pass + + def test_test_json_form_data(self): + """ + Test case for test_json_form_data + + test json serialization of form data + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py new file mode 100644 index 00000000000..7a11a2378bf --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.fake_classname_tags_123_api import FakeClassnameTags123Api + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """ FakeClassnameTags123Api unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.fake_classname_tags_123_api.FakeClassnameTags123Api() + + def tearDown(self): + pass + + def test_test_classname(self): + """ + Test case for test_classname + + To test class name in snake case + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_format_test.py b/samples/client/petstore/python-asyncio/test/test_format_test.py new file mode 100644 index 00000000000..ad028c0b431 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_format_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.format_test import FormatTest + + +class TestFormatTest(unittest.TestCase): + """ FormatTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """ + Test FormatTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.format_test.FormatTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py b/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py new file mode 100644 index 00000000000..af029f26814 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_has_only_read_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.has_only_read_only import HasOnlyReadOnly + + +class TestHasOnlyReadOnly(unittest.TestCase): + """ HasOnlyReadOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """ + Test HasOnlyReadOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_list.py b/samples/client/petstore/python-asyncio/test/test_list.py new file mode 100644 index 00000000000..14400e35281 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_list.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.list import List + + +class TestList(unittest.TestCase): + """ List unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """ + Test List + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.list.List() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_map_test.py b/samples/client/petstore/python-asyncio/test/test_map_test.py new file mode 100644 index 00000000000..c4b2092f0ce --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_map_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.map_test import MapTest + + +class TestMapTest(unittest.TestCase): + """ MapTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """ + Test MapTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.map_test.MapTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..f614d36da8a --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """ MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """ + Test MixedPropertiesAndAdditionalPropertiesClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_model_200_response.py b/samples/client/petstore/python-asyncio/test/test_model_200_response.py new file mode 100644 index 00000000000..f202a2d454f --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_model_200_response.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_200_response import Model200Response + + +class TestModel200Response(unittest.TestCase): + """ Model200Response unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """ + Test Model200Response + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.model_200_response.Model200Response() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_model_return.py b/samples/client/petstore/python-asyncio/test/test_model_return.py new file mode 100644 index 00000000000..347c8e4d7cb --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_model_return.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_return import ModelReturn + + +class TestModelReturn(unittest.TestCase): + """ ModelReturn unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """ + Test ModelReturn + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.model_return.ModelReturn() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_name.py b/samples/client/petstore/python-asyncio/test/test_name.py new file mode 100644 index 00000000000..c06e35427f6 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.name import Name + + +class TestName(unittest.TestCase): + """ Name unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """ + Test Name + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.name.Name() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_number_only.py b/samples/client/petstore/python-asyncio/test/test_number_only.py new file mode 100644 index 00000000000..db3197a9e5b --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.number_only import NumberOnly + + +class TestNumberOnly(unittest.TestCase): + """ NumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """ + Test NumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.number_only.NumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_order.py b/samples/client/petstore/python-asyncio/test/test_order.py new file mode 100644 index 00000000000..d911487ce97 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_order.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.order import Order + + +class TestOrder(unittest.TestCase): + """ Order unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """ + Test Order + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.order.Order() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_boolean.py b/samples/client/petstore/python-asyncio/test/test_outer_boolean.py new file mode 100644 index 00000000000..9474ab76968 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_outer_boolean.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_boolean import OuterBoolean + + +class TestOuterBoolean(unittest.TestCase): + """ OuterBoolean unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterBoolean(self): + """ + Test OuterBoolean + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_boolean.OuterBoolean() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_composite.py b/samples/client/petstore/python-asyncio/test/test_outer_composite.py new file mode 100644 index 00000000000..ebbd9d03e6f --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_outer_composite.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_composite import OuterComposite + + +class TestOuterComposite(unittest.TestCase): + """ OuterComposite unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """ + Test OuterComposite + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_composite.OuterComposite() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_enum.py b/samples/client/petstore/python-asyncio/test/test_outer_enum.py new file mode 100644 index 00000000000..c6e1f030ef1 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_outer_enum.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_enum import OuterEnum + + +class TestOuterEnum(unittest.TestCase): + """ OuterEnum unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """ + Test OuterEnum + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_enum.OuterEnum() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_number.py b/samples/client/petstore/python-asyncio/test/test_outer_number.py new file mode 100644 index 00000000000..9f97b407047 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_outer_number.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_number import OuterNumber + + +class TestOuterNumber(unittest.TestCase): + """ OuterNumber unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterNumber(self): + """ + Test OuterNumber + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_number.OuterNumber() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_outer_string.py b/samples/client/petstore/python-asyncio/test/test_outer_string.py new file mode 100644 index 00000000000..b0ac85ed934 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_outer_string.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_string import OuterString + + +class TestOuterString(unittest.TestCase): + """ OuterString unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterString(self): + """ + Test OuterString + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_string.OuterString() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_pet.py b/samples/client/petstore/python-asyncio/test/test_pet.py new file mode 100644 index 00000000000..c3e8191bec3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_pet.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.pet import Pet + + +class TestPet(unittest.TestCase): + """ Pet unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """ + Test Pet + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.pet.Pet() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_pet_api.py b/samples/client/petstore/python-asyncio/test/test_pet_api.py new file mode 100644 index 00000000000..1eafc35b28c --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_pet_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.pet_api import PetApi + + +class TestPetApi(unittest.TestCase): + """ PetApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.pet_api.PetApi() + + def tearDown(self): + pass + + def test_add_pet(self): + """ + Test case for add_pet + + Add a new pet to the store + """ + pass + + def test_delete_pet(self): + """ + Test case for delete_pet + + Deletes a pet + """ + pass + + def test_find_pets_by_status(self): + """ + Test case for find_pets_by_status + + Finds Pets by status + """ + pass + + def test_find_pets_by_tags(self): + """ + Test case for find_pets_by_tags + + Finds Pets by tags + """ + pass + + def test_get_pet_by_id(self): + """ + Test case for get_pet_by_id + + Find pet by ID + """ + pass + + def test_update_pet(self): + """ + Test case for update_pet + + Update an existing pet + """ + pass + + def test_update_pet_with_form(self): + """ + Test case for update_pet_with_form + + Updates a pet in the store with form data + """ + pass + + def test_upload_file(self): + """ + Test case for upload_file + + uploads an image + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_read_only_first.py b/samples/client/petstore/python-asyncio/test/test_read_only_first.py new file mode 100644 index 00000000000..c89d5d3b6a1 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_read_only_first.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.read_only_first import ReadOnlyFirst + + +class TestReadOnlyFirst(unittest.TestCase): + """ ReadOnlyFirst unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """ + Test ReadOnlyFirst + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.read_only_first.ReadOnlyFirst() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_special_model_name.py b/samples/client/petstore/python-asyncio/test/test_special_model_name.py new file mode 100644 index 00000000000..d9fa392c36b --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_special_model_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.special_model_name import SpecialModelName + + +class TestSpecialModelName(unittest.TestCase): + """ SpecialModelName unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """ + Test SpecialModelName + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.special_model_name.SpecialModelName() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_store_api.py b/samples/client/petstore/python-asyncio/test/test_store_api.py new file mode 100644 index 00000000000..f131b6068b2 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_store_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.store_api import StoreApi + + +class TestStoreApi(unittest.TestCase): + """ StoreApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.store_api.StoreApi() + + def tearDown(self): + pass + + def test_delete_order(self): + """ + Test case for delete_order + + Delete purchase order by ID + """ + pass + + def test_get_inventory(self): + """ + Test case for get_inventory + + Returns pet inventories by status + """ + pass + + def test_get_order_by_id(self): + """ + Test case for get_order_by_id + + Find purchase order by ID + """ + pass + + def test_place_order(self): + """ + Test case for place_order + + Place an order for a pet + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_tag.py b/samples/client/petstore/python-asyncio/test/test_tag.py new file mode 100644 index 00000000000..76f79932c96 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_tag.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.tag import Tag + + +class TestTag(unittest.TestCase): + """ Tag unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """ + Test Tag + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.tag.Tag() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_user.py b/samples/client/petstore/python-asyncio/test/test_user.py new file mode 100644 index 00000000000..82f5d9058b0 --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_user.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.user import User + + +class TestUser(unittest.TestCase): + """ User unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """ + Test User + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.user.User() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/test/test_user_api.py b/samples/client/petstore/python-asyncio/test/test_user_api.py new file mode 100644 index 00000000000..3e0be964a2d --- /dev/null +++ b/samples/client/petstore/python-asyncio/test/test_user_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.user_api import UserApi + + +class TestUserApi(unittest.TestCase): + """ UserApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.user_api.UserApi() + + def tearDown(self): + pass + + def test_create_user(self): + """ + Test case for create_user + + Create user + """ + pass + + def test_create_users_with_array_input(self): + """ + Test case for create_users_with_array_input + + Creates list of users with given input array + """ + pass + + def test_create_users_with_list_input(self): + """ + Test case for create_users_with_list_input + + Creates list of users with given input array + """ + pass + + def test_delete_user(self): + """ + Test case for delete_user + + Delete user + """ + pass + + def test_get_user_by_name(self): + """ + Test case for get_user_by_name + + Get user by user name + """ + pass + + def test_login_user(self): + """ + Test case for login_user + + Logs user into the system + """ + pass + + def test_logout_user(self): + """ + Test case for logout_user + + Logs out current logged in user session + """ + pass + + def test_update_user(self): + """ + Test case for update_user + + Updated user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-asyncio/tox.ini b/samples/client/petstore/python-asyncio/tox.ini new file mode 100644 index 00000000000..1cf0829dc93 --- /dev/null +++ b/samples/client/petstore/python-asyncio/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.gitignore b/samples/client/petstore/python-tornado/.gitignore new file mode 100644 index 00000000000..a655050c263 --- /dev/null +++ b/samples/client/petstore/python-tornado/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/client/petstore/python-tornado/.swagger-codegen-ignore b/samples/client/petstore/python-tornado/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/python-tornado/.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/python-tornado/.swagger-codegen/VERSION b/samples/client/petstore/python-tornado/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/python-tornado/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.travis.yml b/samples/client/petstore/python-tornado/.travis.yml new file mode 100644 index 00000000000..86211e2d4a2 --- /dev/null +++ b/samples/client/petstore/python-tornado/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md new file mode 100644 index 00000000000..87f80990fc5 --- /dev/null +++ b/samples/client/petstore/python-tornado/README.md @@ -0,0 +1,176 @@ +# petstore-api +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +# create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + - [Cat](docs/Cat.md) + - [Dog](docs/Dog.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + +apiteam@swagger.io + diff --git a/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..ea12f270f02 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **dict(str, str)** | | [optional] +**map_of_map_property** | [**dict(str, dict(str, str))**](dict.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Animal.md b/samples/client/petstore/python-tornado/docs/Animal.md new file mode 100644 index 00000000000..7ed4ba541fa --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/AnimalFarm.md b/samples/client/petstore/python-tornado/docs/AnimalFarm.md new file mode 100644 index 00000000000..df6bab21dae --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/AnimalFarm.md @@ -0,0 +1,9 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..b78fcf86f43 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md @@ -0,0 +1,57 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **test_special_tags** +> Client test_special_tags(body) + +To test special tags + +To test special tags + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/docs/ApiResponse.md b/samples/client/petstore/python-tornado/docs/ApiResponse.md new file mode 100644 index 00000000000..8fc302305ab --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..aa3988ab167 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **list[list[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..2c3de967aec --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **list[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/ArrayTest.md b/samples/client/petstore/python-tornado/docs/ArrayTest.md new file mode 100644 index 00000000000..6ab0d137806 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **list[str]** | | [optional] +**array_array_of_integer** | **list[list[int]]** | | [optional] +**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Capitalization.md b/samples/client/petstore/python-tornado/docs/Capitalization.md new file mode 100644 index 00000000000..85d88d239ee --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Cat.md b/samples/client/petstore/python-tornado/docs/Cat.md new file mode 100644 index 00000000000..8d30565d014 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Cat.md @@ -0,0 +1,10 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Category.md b/samples/client/petstore/python-tornado/docs/Category.md new file mode 100644 index 00000000000..7f453539bf8 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/ClassModel.md b/samples/client/petstore/python-tornado/docs/ClassModel.md new file mode 100644 index 00000000000..7f6f6d17211 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ClassModel.md @@ -0,0 +1,10 @@ +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Client.md b/samples/client/petstore/python-tornado/docs/Client.md new file mode 100644 index 00000000000..88e99384f92 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Dog.md b/samples/client/petstore/python-tornado/docs/Dog.md new file mode 100644 index 00000000000..f727487975c --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Dog.md @@ -0,0 +1,10 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/EnumArrays.md b/samples/client/petstore/python-tornado/docs/EnumArrays.md new file mode 100644 index 00000000000..e15a5f1fd04 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/EnumClass.md b/samples/client/petstore/python-tornado/docs/EnumClass.md new file mode 100644 index 00000000000..67f017becd0 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/EnumClass.md @@ -0,0 +1,9 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/EnumTest.md b/samples/client/petstore/python-tornado/docs/EnumTest.md new file mode 100644 index 00000000000..94dd4864629 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/EnumTest.md @@ -0,0 +1,13 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md new file mode 100644 index 00000000000..eb669540e53 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -0,0 +1,440 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data + + +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(body=body) + + + +Test serialization of outer boolean types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(body=body) + + + +Test serialization of object with outer number type + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(body=body) + + + +Test serialization of outer number types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(body=body) + + + +Test serialization of outer string types + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterString() # OuterString | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> Client test_client_model(body) + +To test \"client\" model + +To test \"client\" model + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.Client() # Client | client model + +try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 1.2 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 789 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = 'B' # str | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **str**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double) + +To test enum parameters + +To test enum parameters + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_form_string_array = ['enum_form_string_array_example'] # list[str] | Form parameter enum test (string array) (optional) +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to -efg) +enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to -efg) +enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to -efg) +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 1.2 # float | Query parameter enum test (double) (optional) + +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to -efg] + **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to -efg] + **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to -efg] + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..a103a4ee327 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(body) + +To test class name in snake case + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key_query +configuration = petstore_api.Configuration() +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +body = petstore_api.Client() # Client | client model + +try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/docs/FormatTest.md b/samples/client/petstore/python-tornado/docs/FormatTest.md new file mode 100644 index 00000000000..3e489e863fa --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/FormatTest.md @@ -0,0 +1,22 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **float** | | +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**byte** | **str** | | +**binary** | **str** | | [optional] +**date** | **date** | | +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**password** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..44ad450b52c --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**foo** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/List.md b/samples/client/petstore/python-tornado/docs/List.md new file mode 100644 index 00000000000..11f4f3a05f3 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/List.md @@ -0,0 +1,10 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/MapTest.md b/samples/client/petstore/python-tornado/docs/MapTest.md new file mode 100644 index 00000000000..63cdab0374a --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/MapTest.md @@ -0,0 +1,11 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | [**dict(str, dict(str, str))**](dict.md) | | [optional] +**map_of_enum_string** | **dict(str, str)** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..b9808d5275e --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**dict(str, Animal)**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Model200Response.md b/samples/client/petstore/python-tornado/docs/Model200Response.md new file mode 100644 index 00000000000..30f47cae521 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Model200Response.md @@ -0,0 +1,11 @@ +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/ModelReturn.md b/samples/client/petstore/python-tornado/docs/ModelReturn.md new file mode 100644 index 00000000000..2b03798e301 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ModelReturn.md @@ -0,0 +1,10 @@ +# ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Name.md b/samples/client/petstore/python-tornado/docs/Name.md new file mode 100644 index 00000000000..542da3f0476 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Name.md @@ -0,0 +1,13 @@ +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/NumberOnly.md b/samples/client/petstore/python-tornado/docs/NumberOnly.md new file mode 100644 index 00000000000..93a0fde7b93 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Order.md b/samples/client/petstore/python-tornado/docs/Order.md new file mode 100644 index 00000000000..b5f7b22d34c --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to False] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/OuterBoolean.md b/samples/client/petstore/python-tornado/docs/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/OuterComposite.md b/samples/client/petstore/python-tornado/docs/OuterComposite.md new file mode 100644 index 00000000000..159e67b48ee --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/OuterEnum.md b/samples/client/petstore/python-tornado/docs/OuterEnum.md new file mode 100644 index 00000000000..06d413b0168 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/OuterEnum.md @@ -0,0 +1,9 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/OuterNumber.md b/samples/client/petstore/python-tornado/docs/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/OuterString.md b/samples/client/petstore/python-tornado/docs/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/Pet.md b/samples/client/petstore/python-tornado/docs/Pet.md new file mode 100644 index 00000000000..9e15090300f --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **str** | | +**photo_urls** | **list[str]** | | +**tags** | [**list[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md new file mode 100644 index 00000000000..74c6a5196fd --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/PetApi.md @@ -0,0 +1,440 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **add_pet** +> add_pet(body) + +Add a new pet to the store + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Add a new pet to the store + api_instance.add_pet(body) +except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pet** +> delete_pet(pet_id, api_key=api_key) + +Deletes a pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_status** +> list[Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # list[str] | Status values that need to be considered for filter + +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_tags** +> list[Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # list[str] | Tags to filter by + +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**list[str]**](str.md)| Tags to filter by | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = petstore_api.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to return + +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet** +> update_pet(body) + +Update an existing pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Update an existing pet + api_instance.update_pet(body) +except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_with_form** +> update_pet_with_form(pet_id, name=name, status=status) + +Updates a pet in the store with form data + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file** +> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) + +uploads an image + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = '/path/to/file.txt' # file | file to upload (optional) + +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md b/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..93fed253d01 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/SpecialModelName.md b/samples/client/petstore/python-tornado/docs/SpecialModelName.md new file mode 100644 index 00000000000..022ee19169c --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md new file mode 100644 index 00000000000..a75113975ef --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/StoreApi.md @@ -0,0 +1,205 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_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 + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inventory** +> dict(str, int) get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = petstore_api.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**dict(str, int)** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 789 # int | ID of pet that needs to be fetched + +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **place_order** +> Order place_order(body) + +Place an order for a pet + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.StoreApi() +body = petstore_api.Order() # Order | order placed for purchasing the pet + +try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/docs/Tag.md b/samples/client/petstore/python-tornado/docs/Tag.md new file mode 100644 index 00000000000..243cd98eda6 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/User.md b/samples/client/petstore/python-tornado/docs/User.md new file mode 100644 index 00000000000..443ac123fdc --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md new file mode 100644 index 00000000000..5b73179dce3 --- /dev/null +++ b/samples/client/petstore/python-tornado/docs/UserApi.md @@ -0,0 +1,394 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(body) + +Create user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = petstore_api.User() # User | Created user object + +try: + # Create user + api_instance.create_user(body) +except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_array_input** +> create_users_with_array_input(body) + +Creates list of users with given input array + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_list_input** +> create_users_with_list_input(body) + +Creates list of users with given input array + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +body = [petstore_api.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +try: + # Delete user + api_instance.delete_user(username) +except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() + +try: + # Logs out current logged in user session + api_instance.logout_user() +except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> update_user(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +body = petstore_api.User() # User | Updated user object + +try: + # Updated user + api_instance.update_user(username, body) +except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python-tornado/git_push.sh b/samples/client/petstore/python-tornado/git_push.sh new file mode 100644 index 00000000000..ed374619b13 --- /dev/null +++ b/samples/client/petstore/python-tornado/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/python-tornado/petstore_api/__init__.py b/samples/client/petstore/python-tornado/petstore_api/__init__.py new file mode 100644 index 00000000000..cad09e2691c --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/__init__.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into sdk package +from .models.additional_properties_class import AdditionalPropertiesClass +from .models.animal import Animal +from .models.animal_farm import AnimalFarm +from .models.api_response import ApiResponse +from .models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from .models.array_of_number_only import ArrayOfNumberOnly +from .models.array_test import ArrayTest +from .models.capitalization import Capitalization +from .models.category import Category +from .models.class_model import ClassModel +from .models.client import Client +from .models.enum_arrays import EnumArrays +from .models.enum_class import EnumClass +from .models.enum_test import EnumTest +from .models.format_test import FormatTest +from .models.has_only_read_only import HasOnlyReadOnly +from .models.list import List +from .models.map_test import MapTest +from .models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from .models.model_200_response import Model200Response +from .models.model_return import ModelReturn +from .models.name import Name +from .models.number_only import NumberOnly +from .models.order import Order +from .models.outer_boolean import OuterBoolean +from .models.outer_composite import OuterComposite +from .models.outer_enum import OuterEnum +from .models.outer_number import OuterNumber +from .models.outer_string import OuterString +from .models.pet import Pet +from .models.read_only_first import ReadOnlyFirst +from .models.special_model_name import SpecialModelName +from .models.tag import Tag +from .models.user import User +from .models.cat import Cat +from .models.dog import Dog + +# import apis into sdk package +from .apis.another_fake_api import AnotherFakeApi +from .apis.fake_api import FakeApi +from .apis.fake_classname_tags_123_api import FakeClassnameTags123Api +from .apis.pet_api import PetApi +from .apis.store_api import StoreApi +from .apis.user_api import UserApi + +# import ApiClient +from .api_client import ApiClient + +from .configuration import Configuration diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py new file mode 100644 index 00000000000..c30b14130a9 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -0,0 +1,630 @@ +# coding: utf-8 +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import re +import json +import mimetypes +import tempfile +import tornado.gen +from multiprocessing.pool import ThreadPool + +from datetime import date, datetime + +# python 2 and python 3 compatibility library +from six import PY3, integer_types, iteritems, text_type +from six.moves.urllib.parse import quote + +from . import models +from .configuration import Configuration +from .rest import ApiException, RESTClientObject + + +class ApiClient(object): + """ + Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param host: The base path for the server to call. + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to the API. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if PY3 else long, + 'float': float, + 'str': str, + 'bool': bool, + 'date': date, + 'datetime': datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """ + Gets user agent. + """ + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + """ + Sets user agent. + """ + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + @tornado.gen.coroutine + def __call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, _preload_content=True, + _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param)) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = yield self.request(method, url, + query_params=query_params, + headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """ + Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """ + Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """ + Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match('list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == date: + return self.__deserialize_date(data) + elif klass == datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async=None, + _return_http_data_only=None, collection_formats=None, _preload_content=True, + _request_timeout=None): + """ + Makes the HTTP request (synchronous) and return the deserialized data. + To make an async request, set the async parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async bool: execute request asynchronously + :param _return_http_data_only: response data without head status code and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without + reading/decoding response data. Default is True. + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :return: + If async parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async is False or missing, + then the method will return the response directly. + """ + if not async: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, method, + path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, _request_timeout=None): + """ + Makes the HTTP request using RESTClient. + """ + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """ + Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in iteritems(params) if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """ + Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = mimetypes.\ + guess_type(filename)[0] or 'application/octet-stream' + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """ + Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """ + Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """ + Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """ + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.\ + search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\ + group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "w") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """ + Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return unicode(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """ + Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """ + Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise ApiException( + status=0, + reason="Failed to parse `{0}` into a date object".format(string) + ) + + def __deserialize_datatime(self, string): + """ + Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise ApiException( + status=0, + reason=( + "Failed to parse `{0}` into a datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """ + Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in iteritems(klass.swagger_types): + if data is not None \ + and klass.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py b/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py new file mode 100644 index 00000000000..b4b975ca8e0 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/__init__.py @@ -0,0 +1,9 @@ +from __future__ import absolute_import + +# import apis into api package +from .another_fake_api import AnotherFakeApi +from .fake_api import FakeApi +from .fake_classname_tags_123_api import FakeClassnameTags123Api +from .pet_api import PetApi +from .store_api import StoreApi +from .user_api import UserApi diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py new file mode 100644 index 00000000000..8fb991ff3df --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/another_fake_api.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class AnotherFakeApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_special_tags(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_special_tags_with_http_info(body, **kwargs) + else: + (data) = self.test_special_tags_with_http_info(body, **kwargs) + return data + + def test_special_tags_with_http_info(self, body, **kwargs): + """ + To test special tags + To test special tags + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_special_tags_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_special_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py new file mode 100644 index 00000000000..46fb22f7290 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/fake_api.py @@ -0,0 +1,886 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class FakeApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def fake_outer_boolean_serialize(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_boolean_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return data + + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_boolean_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_boolean_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_composite_serialize(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_composite_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_composite_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + return data + + def fake_outer_composite_serialize_with_http_info(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_composite_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_composite_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_number_serialize(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_number_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_number_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + return data + + def fake_outer_number_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_number_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_number_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_string_serialize(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_string_serialize(async=True) + >>> result = thread.get() + + :param async bool + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.fake_outer_string_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + return data + + def fake_outer_string_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.fake_outer_string_serialize_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_string_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_client_model(self, body, **kwargs): + """ + To test \"client\" model + To test \"client\" model + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_client_model(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_client_model_with_http_info(body, **kwargs) + else: + (data) = self.test_client_model_with_http_info(body, **kwargs) + return data + + def test_client_model_with_http_info(self, body, **kwargs): + """ + To test \"client\" model + To test \"client\" model + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_client_model_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_client_model" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async=True) + >>> result = thread.get() + + :param async bool + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param str binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + else: + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) + return data + + def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async=True) + >>> result = thread.get() + + :param async bool + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param str binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['number', 'double', 'pattern_without_delimiter', 'byte', 'integer', 'int32', 'int64', 'float', 'string', 'binary', 'date', 'date_time', 'password', 'param_callback'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_endpoint_parameters" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'number' is set + if ('number' not in params) or (params['number'] is None): + raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") + # verify the required parameter 'double' is set + if ('double' not in params) or (params['double'] is None): + raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") + # verify the required parameter 'pattern_without_delimiter' is set + if ('pattern_without_delimiter' not in params) or (params['pattern_without_delimiter'] is None): + raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") + # verify the required parameter 'byte' is set + if ('byte' not in params) or (params['byte'] is None): + raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") + + if 'number' in params and params['number'] > 543.2: + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") + if 'number' in params and params['number'] < 32.1: + raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") + if 'double' in params and params['double'] > 123.4: + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") + if 'double' in params and params['double'] < 67.8: + raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") + if 'pattern_without_delimiter' in params and not re.search('^[A-Z].*', params['pattern_without_delimiter']): + raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") + if 'integer' in params and params['integer'] > 100: + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") + if 'integer' in params and params['integer'] < 10: + raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") + if 'int32' in params and params['int32'] > 200: + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") + if 'int32' in params and params['int32'] < 20: + raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") + if 'float' in params and params['float'] > 987.6: + raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") + if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): + raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") + if 'password' in params and len(params['password']) > 64: + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") + if 'password' in params and len(params['password']) < 10: + raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'integer' in params: + form_params.append(('integer', params['integer'])) + if 'int32' in params: + form_params.append(('int32', params['int32'])) + if 'int64' in params: + form_params.append(('int64', params['int64'])) + if 'number' in params: + form_params.append(('number', params['number'])) + if 'float' in params: + form_params.append(('float', params['float'])) + if 'double' in params: + form_params.append(('double', params['double'])) + if 'string' in params: + form_params.append(('string', params['string'])) + if 'pattern_without_delimiter' in params: + form_params.append(('pattern_without_delimiter', params['pattern_without_delimiter'])) + if 'byte' in params: + form_params.append(('byte', params['byte'])) + if 'binary' in params: + form_params.append(('binary', params['binary'])) + if 'date' in params: + form_params.append(('date', params['date'])) + if 'date_time' in params: + form_params.append(('dateTime', params['date_time'])) + if 'password' in params: + form_params.append(('password', params['password'])) + if 'param_callback' in params: + form_params.append(('callback', params['param_callback'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8']) + + # Authentication setting + auth_settings = ['http_basic_test'] + + return self.api_client.call_api('/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_enum_parameters(self, **kwargs): + """ + To test enum parameters + To test enum parameters + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_enum_parameters(async=True) + >>> result = thread.get() + + :param async bool + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_enum_parameters_with_http_info(**kwargs) + else: + (data) = self.test_enum_parameters_with_http_info(**kwargs) + return data + + def test_enum_parameters_with_http_info(self, **kwargs): + """ + To test enum parameters + To test enum parameters + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_enum_parameters_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param list[str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['enum_form_string_array', 'enum_form_string', 'enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer', 'enum_query_double'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_enum_parameters" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'enum_query_string_array' in params: + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) + collection_formats['enum_query_string_array'] = 'csv' + if 'enum_query_string' in params: + query_params.append(('enum_query_string', params['enum_query_string'])) + if 'enum_query_integer' in params: + query_params.append(('enum_query_integer', params['enum_query_integer'])) + + header_params = {} + if 'enum_header_string_array' in params: + header_params['enum_header_string_array'] = params['enum_header_string_array'] + collection_formats['enum_header_string_array'] = 'csv' + if 'enum_header_string' in params: + header_params['enum_header_string'] = params['enum_header_string'] + + form_params = [] + local_var_files = {} + if 'enum_form_string_array' in params: + form_params.append(('enum_form_string_array', params['enum_form_string_array'])) + collection_formats['enum_form_string_array'] = 'csv' + if 'enum_form_string' in params: + form_params.append(('enum_form_string', params['enum_form_string'])) + if 'enum_query_double' in params: + form_params.append(('enum_query_double', params['enum_query_double'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['*/*']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['*/*']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, param, param2, **kwargs): + """ + test json serialization of form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_json_form_data(param, param2, async=True) + >>> result = thread.get() + + :param async bool + :param str param: field1 (required) + :param str param2: field2 (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_json_form_data_with_http_info(param, param2, **kwargs) + else: + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) + return data + + def test_json_form_data_with_http_info(self, param, param2, **kwargs): + """ + test json serialization of form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_json_form_data_with_http_info(param, param2, async=True) + >>> result = thread.get() + + :param async bool + :param str param: field1 (required) + :param str param2: field2 (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['param', 'param2'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_json_form_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in params) or (params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") + # verify the required parameter 'param2' is set + if ('param2' not in params) or (params['param2'] is None): + raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'param' in params: + form_params.append(('param', params['param'])) + if 'param2' in params: + form_params.append(('param2', params['param2'])) + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/jsonFormData', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py new file mode 100644 index 00000000000..da75ad3cccd --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/fake_classname_tags_123_api.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class FakeClassnameTags123Api(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): + """ + To test class name in snake case + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_classname(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_classname_with_http_info(body, **kwargs) + else: + (data) = self.test_classname_with_http_info(body, **kwargs) + return data + + def test_classname_with_http_info(self, body, **kwargs): + """ + To test class name in snake case + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_classname_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['api_key_query'] + + return self.api_client.call_api('/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py new file mode 100644 index 00000000000..51b6ce82540 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/pet_api.py @@ -0,0 +1,826 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class PetApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_pet(self, body, **kwargs): + """ + Add a new pet to the store + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.add_pet(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.add_pet_with_http_info(body, **kwargs) + else: + (data) = self.add_pet_with_http_info(body, **kwargs) + return data + + def add_pet_with_http_info(self, body, **kwargs): + """ + Add a new pet to the store + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.add_pet_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_pet(self, pet_id, **kwargs): + """ + Deletes a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_pet(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_pet_with_http_info(pet_id, **kwargs) + else: + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): + """ + Deletes a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_pet_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_status(self, status, **kwargs): + """ + Finds Pets by status + Multiple status values can be provided with comma separated strings + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_status(status, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.find_pets_by_status_with_http_info(status, **kwargs) + else: + (data) = self.find_pets_by_status_with_http_info(status, **kwargs) + return data + + def find_pets_by_status_with_http_info(self, status, **kwargs): + """ + Finds Pets by status + Multiple status values can be provided with comma separated strings + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_status_with_http_info(status, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'status' is set + if ('status' not in params) or (params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in params: + query_params.append(('status', params['status'])) + collection_formats['status'] = 'csv' + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_tags(self, tags, **kwargs): + """ + Finds Pets by tags + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_tags(tags, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.find_pets_by_tags_with_http_info(tags, **kwargs) + else: + (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) + return data + + def find_pets_by_tags_with_http_info(self, tags, **kwargs): + """ + Finds Pets by tags + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.find_pets_by_tags_with_http_info(tags, async=True) + >>> result = thread.get() + + :param async bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tags'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tags' is set + if ('tags' not in params) or (params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tags' in params: + query_params.append(('tags', params['tags'])) + collection_formats['tags'] = 'csv' + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_pet_by_id(self, pet_id, **kwargs): + """ + Find pet by ID + Returns a single pet + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_pet_by_id(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) + else: + (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) + return data + + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): + """ + Find pet by ID + Returns a single pet + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_pet_by_id_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = ['api_key'] + + return self.api_client.call_api('/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet(self, body, **kwargs): + """ + Update an existing pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_pet_with_http_info(body, **kwargs) + else: + (data) = self.update_pet_with_http_info(body, **kwargs) + return data + + def update_pet_with_http_info(self, body, **kwargs): + """ + Update an existing pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet_with_form(self, pet_id, **kwargs): + """ + Updates a pet in the store with form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_form(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) + else: + (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) + return data + + def update_pet_with_form_with_http_info(self, pet_id, **kwargs): + """ + Updates a pet in the store with form data + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_pet_with_form_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'name', 'status'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet_with_form" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in params: + form_params.append(('name', params['name'])) + if 'status' in params: + form_params.append(('status', params['status'])) + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/x-www-form-urlencoded']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_file(self, pet_id, **kwargs): + """ + uploads an image + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.upload_file(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.upload_file_with_http_info(pet_id, **kwargs) + else: + (data) = self.upload_file_with_http_info(pet_id, **kwargs) + return data + + def upload_file_with_http_info(self, pet_id, **kwargs): + """ + uploads an image + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.upload_file_with_http_info(pet_id, async=True) + >>> result = thread.get() + + :param async bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'additional_metadata', 'file'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_file" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") + + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'additional_metadata' in params: + form_params.append(('additionalMetadata', params['additional_metadata'])) + if 'file' in params: + local_var_files['file'] = params['file'] + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['multipart/form-data']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api('/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/store_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/store_api.py new file mode 100644 index 00000000000..e9d9599c363 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/store_api.py @@ -0,0 +1,408 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class StoreApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_order(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_order(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_order_with_http_info(order_id, **kwargs) + else: + (data) = self.delete_order_with_http_info(order_id, **kwargs) + return data + + def delete_order_with_http_info(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_order_with_http_info(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_inventory(self, **kwargs): + """ + Returns pet inventories by status + Returns a map of status codes to quantities + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_inventory(async=True) + >>> result = thread.get() + + :param async bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_inventory_with_http_info(**kwargs) + else: + (data) = self.get_inventory_with_http_info(**kwargs) + return data + + def get_inventory_with_http_info(self, **kwargs): + """ + Returns pet inventories by status + Returns a map of status codes to quantities + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_inventory_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_inventory" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # Authentication setting + auth_settings = ['api_key'] + + return self.api_client.call_api('/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_order_by_id(self, order_id, **kwargs): + """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_order_by_id(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_order_by_id_with_http_info(order_id, **kwargs) + else: + (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) + return data + + def get_order_by_id_with_http_info(self, order_id, **kwargs): + """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_order_by_id_with_http_info(order_id, async=True) + >>> result = thread.get() + + :param async bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_order_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") + + if 'order_id' in params and params['order_id'] > 5: + raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") + if 'order_id' in params and params['order_id'] < 1: + raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def place_order(self, body, **kwargs): + """ + Place an order for a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.place_order(body, async=True) + >>> result = thread.get() + + :param async bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.place_order_with_http_info(body, **kwargs) + else: + (data) = self.place_order_with_http_info(body, **kwargs) + return data + + def place_order_with_http_info(self, body, **kwargs): + """ + Place an order for a pet + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.place_order_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method place_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/apis/user_api.py b/samples/client/petstore/python-tornado/petstore_api/apis/user_api.py new file mode 100644 index 00000000000..ffdad2dd60f --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/apis/user_api.py @@ -0,0 +1,794 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import sys +import os +import re + +# python 2 and python 3 compatibility library +from six import iteritems + +from ..api_client import ApiClient + + +class UserApi(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_user(self, body, **kwargs): + """ + Create user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_user(body, async=True) + >>> result = thread.get() + + :param async bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_user_with_http_info(body, **kwargs) + else: + (data) = self.create_user_with_http_info(body, **kwargs) + return data + + def create_user_with_http_info(self, body, **kwargs): + """ + Create user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_user_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_array_input(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_array_input(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_users_with_array_input_with_http_info(body, **kwargs) + else: + (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) + return data + + def create_users_with_array_input_with_http_info(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_array_input_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_array_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_list_input(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_list_input(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.create_users_with_list_input_with_http_info(body, **kwargs) + else: + (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) + return data + + def create_users_with_list_input_with_http_info(self, body, **kwargs): + """ + Creates list of users with given input array + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.create_users_with_list_input_with_http_info(body, async=True) + >>> result = thread.get() + + :param async bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_list_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_user(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.delete_user_with_http_info(username, **kwargs) + else: + (data) = self.delete_user_with_http_info(username, **kwargs) + return data + + def delete_user_with_http_info(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.delete_user_with_http_info(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_by_name(self, username, **kwargs): + """ + Get user by user name + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_user_by_name(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_user_by_name_with_http_info(username, **kwargs) + else: + (data) = self.get_user_by_name_with_http_info(username, **kwargs) + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): + """ + Get user by user name + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_user_by_name_with_http_info(username, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def login_user(self, username, password, **kwargs): + """ + Logs user into the system + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.login_user(username, password, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.login_user_with_http_info(username, password, **kwargs) + else: + (data) = self.login_user_with_http_info(username, password, **kwargs) + return data + + def login_user_with_http_info(self, username, password, **kwargs): + """ + Logs user into the system + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.login_user_with_http_info(username, password, async=True) + >>> result = thread.get() + + :param async bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username', 'password'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method login_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") + # verify the required parameter 'password' is set + if ('password' not in params) or (params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'username' in params: + query_params.append(('username', params['username'])) + if 'password' in params: + query_params.append(('password', params['password'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def logout_user(self, **kwargs): + """ + Logs out current logged in user session + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.logout_user(async=True) + >>> result = thread.get() + + :param async bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.logout_user_with_http_info(**kwargs) + else: + (data) = self.logout_user_with_http_info(**kwargs) + return data + + def logout_user_with_http_info(self, **kwargs): + """ + Logs out current logged in user session + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.logout_user_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method logout_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_user(self, username, body, **kwargs): + """ + Updated user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_user(username, body, async=True) + >>> result = thread.get() + + :param async bool + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.update_user_with_http_info(username, body, **kwargs) + else: + (data) = self.update_user_with_http_info(username, body, **kwargs) + return data + + def update_user_with_http_info(self, username, body, **kwargs): + """ + Updated user + This can only be done by the logged in user. + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.update_user_with_http_info(username, body, async=True) + >>> result = thread.get() + + :param async bool + :param str username: name that need to be deleted (required) + :param User body: Updated user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username', 'body'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") + # verify the required parameter 'body' is set + if ('body' not in params) or (params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") + + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/xml', 'application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py new file mode 100644 index 00000000000..9e1fcf24089 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import urllib3 + +import logging +import multiprocessing +import sys + +from six import iteritems +from six.moves import http_client as httplib + + +class Configuration(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """ + Constructor + """ + # Default Base url + self.host = "http://petstore.swagger.io:80/v2" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # access token for OAuth + self.access_token = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """ + Gets the logger_file. + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """ + Sets the logger_file. + + If the logger_file is None, then add stream handler and remove file handler. + Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """ + Gets the debug status. + """ + return self.__debug + + @debug.setter + def debug(self, value): + """ + Sets the debug status. + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """ + Gets the logger_format. + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """ + Sets the logger_format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """ + Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.api_key.get(identifier) and self.api_key_prefix.get(identifier): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """ + Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\ + .get('authorization') + + def auth_settings(self): + """ + Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + + } + + def to_debug_report(self): + """ + Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/samples/client/petstore/python-tornado/petstore_api/models/__init__.py b/samples/client/petstore/python-tornado/petstore_api/models/__init__.py new file mode 100644 index 00000000000..21b5d20fa3c --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/__init__.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into model package +from .additional_properties_class import AdditionalPropertiesClass +from .animal import Animal +from .animal_farm import AnimalFarm +from .api_response import ApiResponse +from .array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from .array_of_number_only import ArrayOfNumberOnly +from .array_test import ArrayTest +from .capitalization import Capitalization +from .category import Category +from .class_model import ClassModel +from .client import Client +from .enum_arrays import EnumArrays +from .enum_class import EnumClass +from .enum_test import EnumTest +from .format_test import FormatTest +from .has_only_read_only import HasOnlyReadOnly +from .list import List +from .map_test import MapTest +from .mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from .model_200_response import Model200Response +from .model_return import ModelReturn +from .name import Name +from .number_only import NumberOnly +from .order import Order +from .outer_boolean import OuterBoolean +from .outer_composite import OuterComposite +from .outer_enum import OuterEnum +from .outer_number import OuterNumber +from .outer_string import OuterString +from .pet import Pet +from .read_only_first import ReadOnlyFirst +from .special_model_name import SpecialModelName +from .tag import Tag +from .user import User +from .cat import Cat +from .dog import Dog diff --git a/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py new file mode 100644 index 00000000000..a5329b411cd --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/additional_properties_class.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class AdditionalPropertiesClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_property': 'dict(str, str)', + 'map_of_map_property': 'dict(str, dict(str, str))' + } + + attribute_map = { + 'map_property': 'map_property', + 'map_of_map_property': 'map_of_map_property' + } + + def __init__(self, map_property=None, map_of_map_property=None): + """ + AdditionalPropertiesClass - a model defined in Swagger + """ + + self._map_property = None + self._map_of_map_property = None + self.discriminator = None + + if map_property is not None: + self.map_property = map_property + if map_of_map_property is not None: + self.map_of_map_property = map_of_map_property + + @property + def map_property(self): + """ + Gets the map_property of this AdditionalPropertiesClass. + + :return: The map_property of this AdditionalPropertiesClass. + :rtype: dict(str, str) + """ + return self._map_property + + @map_property.setter + def map_property(self, map_property): + """ + Sets the map_property of this AdditionalPropertiesClass. + + :param map_property: The map_property of this AdditionalPropertiesClass. + :type: dict(str, str) + """ + + self._map_property = map_property + + @property + def map_of_map_property(self): + """ + Gets the map_of_map_property of this AdditionalPropertiesClass. + + :return: The map_of_map_property of this AdditionalPropertiesClass. + :rtype: dict(str, dict(str, str)) + """ + return self._map_of_map_property + + @map_of_map_property.setter + def map_of_map_property(self, map_of_map_property): + """ + Sets the map_of_map_property of this AdditionalPropertiesClass. + + :param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. + :type: dict(str, dict(str, str)) + """ + + self._map_of_map_property = map_of_map_property + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, AdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py new file mode 100644 index 00000000000..13d8276713d --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Animal(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color' + } + + discriminator_value_class_map = { + '': 'Dog', + '': 'Cat' + } + + def __init__(self, class_name=None, color='red'): + """ + Animal - a model defined in Swagger + """ + + self._class_name = None + self._color = None + self.discriminator = 'className' + + self.class_name = class_name + if color is not None: + self.color = color + + @property + def class_name(self): + """ + Gets the class_name of this Animal. + + :return: The class_name of this Animal. + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """ + Sets the class_name of this Animal. + + :param class_name: The class_name of this Animal. + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") + + self._class_name = class_name + + @property + def color(self): + """ + Gets the color of this Animal. + + :return: The color of this Animal. + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """ + Sets the color of this Animal. + + :param color: The color of this Animal. + :type: str + """ + + self._color = color + + def get_real_child_model(self, data): + """ + Returns the real base class specified by the discriminator + """ + discriminator_value = data[self.discriminator].lower() + if self.discriminator_value_class_map.has_key(discriminator_value): + return self.discriminator_value_class_map[discriminator_value] + else: + return None + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Animal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py new file mode 100644 index 00000000000..fa47d63f881 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal_farm.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class AnimalFarm(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + AnimalFarm - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, AnimalFarm): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/api_response.py b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py new file mode 100644 index 00000000000..b2d784d8020 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/api_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ApiResponse(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'type': 'type', + 'message': 'message' + } + + def __init__(self, code=None, type=None, message=None): + """ + ApiResponse - a model defined in Swagger + """ + + self._code = None + self._type = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if type is not None: + self.type = type + if message is not None: + self.message = message + + @property + def code(self): + """ + Gets the code of this ApiResponse. + + :return: The code of this ApiResponse. + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """ + Sets the code of this ApiResponse. + + :param code: The code of this ApiResponse. + :type: int + """ + + self._code = code + + @property + def type(self): + """ + Gets the type of this ApiResponse. + + :return: The type of this ApiResponse. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """ + Sets the type of this ApiResponse. + + :param type: The type of this ApiResponse. + :type: str + """ + + self._type = type + + @property + def message(self): + """ + Gets the message of this ApiResponse. + + :return: The message of this ApiResponse. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """ + Sets the message of this ApiResponse. + + :param message: The message of this ApiResponse. + :type: str + """ + + self._message = message + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ApiResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 00000000000..0792f5a8a23 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayOfArrayOfNumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_array_number': 'list[list[float]]' + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' + } + + def __init__(self, array_array_number=None): + """ + ArrayOfArrayOfNumberOnly - a model defined in Swagger + """ + + self._array_array_number = None + self.discriminator = None + + if array_array_number is not None: + self.array_array_number = array_array_number + + @property + def array_array_number(self): + """ + Gets the array_array_number of this ArrayOfArrayOfNumberOnly. + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. + :rtype: list[list[float]] + """ + return self._array_array_number + + @array_array_number.setter + def array_array_number(self, array_array_number): + """ + Sets the array_array_number of this ArrayOfArrayOfNumberOnly. + + :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. + :type: list[list[float]] + """ + + self._array_array_number = array_array_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py new file mode 100644 index 00000000000..9d00e1b37a2 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_of_number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayOfNumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_number': 'list[float]' + } + + attribute_map = { + 'array_number': 'ArrayNumber' + } + + def __init__(self, array_number=None): + """ + ArrayOfNumberOnly - a model defined in Swagger + """ + + self._array_number = None + self.discriminator = None + + if array_number is not None: + self.array_number = array_number + + @property + def array_number(self): + """ + Gets the array_number of this ArrayOfNumberOnly. + + :return: The array_number of this ArrayOfNumberOnly. + :rtype: list[float] + """ + return self._array_number + + @array_number.setter + def array_number(self, array_number): + """ + Sets the array_number of this ArrayOfNumberOnly. + + :param array_number: The array_number of this ArrayOfNumberOnly. + :type: list[float] + """ + + self._array_number = array_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/array_test.py b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py new file mode 100644 index 00000000000..ac3079087c8 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/array_test.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ArrayTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + + attribute_map = { + 'array_of_string': 'array_of_string', + 'array_array_of_integer': 'array_array_of_integer', + 'array_array_of_model': 'array_array_of_model' + } + + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): + """ + ArrayTest - a model defined in Swagger + """ + + self._array_of_string = None + self._array_array_of_integer = None + self._array_array_of_model = None + self.discriminator = None + + if array_of_string is not None: + self.array_of_string = array_of_string + if array_array_of_integer is not None: + self.array_array_of_integer = array_array_of_integer + if array_array_of_model is not None: + self.array_array_of_model = array_array_of_model + + @property + def array_of_string(self): + """ + Gets the array_of_string of this ArrayTest. + + :return: The array_of_string of this ArrayTest. + :rtype: list[str] + """ + return self._array_of_string + + @array_of_string.setter + def array_of_string(self, array_of_string): + """ + Sets the array_of_string of this ArrayTest. + + :param array_of_string: The array_of_string of this ArrayTest. + :type: list[str] + """ + + self._array_of_string = array_of_string + + @property + def array_array_of_integer(self): + """ + Gets the array_array_of_integer of this ArrayTest. + + :return: The array_array_of_integer of this ArrayTest. + :rtype: list[list[int]] + """ + return self._array_array_of_integer + + @array_array_of_integer.setter + def array_array_of_integer(self, array_array_of_integer): + """ + Sets the array_array_of_integer of this ArrayTest. + + :param array_array_of_integer: The array_array_of_integer of this ArrayTest. + :type: list[list[int]] + """ + + self._array_array_of_integer = array_array_of_integer + + @property + def array_array_of_model(self): + """ + Gets the array_array_of_model of this ArrayTest. + + :return: The array_array_of_model of this ArrayTest. + :rtype: list[list[ReadOnlyFirst]] + """ + return self._array_array_of_model + + @array_array_of_model.setter + def array_array_of_model(self, array_array_of_model): + """ + Sets the array_array_of_model of this ArrayTest. + + :param array_array_of_model: The array_array_of_model of this ArrayTest. + :type: list[list[ReadOnlyFirst]] + """ + + self._array_array_of_model = array_array_of_model + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ArrayTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py new file mode 100644 index 00000000000..c9be6ed4d15 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/capitalization.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Capitalization(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + + attribute_map = { + 'small_camel': 'smallCamel', + 'capital_camel': 'CapitalCamel', + 'small_snake': 'small_Snake', + 'capital_snake': 'Capital_Snake', + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', + 'att_name': 'ATT_NAME' + } + + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): + """ + Capitalization - a model defined in Swagger + """ + + self._small_camel = None + self._capital_camel = None + self._small_snake = None + self._capital_snake = None + self._sca_eth_flow_points = None + self._att_name = None + self.discriminator = None + + if small_camel is not None: + self.small_camel = small_camel + if capital_camel is not None: + self.capital_camel = capital_camel + if small_snake is not None: + self.small_snake = small_snake + if capital_snake is not None: + self.capital_snake = capital_snake + if sca_eth_flow_points is not None: + self.sca_eth_flow_points = sca_eth_flow_points + if att_name is not None: + self.att_name = att_name + + @property + def small_camel(self): + """ + Gets the small_camel of this Capitalization. + + :return: The small_camel of this Capitalization. + :rtype: str + """ + return self._small_camel + + @small_camel.setter + def small_camel(self, small_camel): + """ + Sets the small_camel of this Capitalization. + + :param small_camel: The small_camel of this Capitalization. + :type: str + """ + + self._small_camel = small_camel + + @property + def capital_camel(self): + """ + Gets the capital_camel of this Capitalization. + + :return: The capital_camel of this Capitalization. + :rtype: str + """ + return self._capital_camel + + @capital_camel.setter + def capital_camel(self, capital_camel): + """ + Sets the capital_camel of this Capitalization. + + :param capital_camel: The capital_camel of this Capitalization. + :type: str + """ + + self._capital_camel = capital_camel + + @property + def small_snake(self): + """ + Gets the small_snake of this Capitalization. + + :return: The small_snake of this Capitalization. + :rtype: str + """ + return self._small_snake + + @small_snake.setter + def small_snake(self, small_snake): + """ + Sets the small_snake of this Capitalization. + + :param small_snake: The small_snake of this Capitalization. + :type: str + """ + + self._small_snake = small_snake + + @property + def capital_snake(self): + """ + Gets the capital_snake of this Capitalization. + + :return: The capital_snake of this Capitalization. + :rtype: str + """ + return self._capital_snake + + @capital_snake.setter + def capital_snake(self, capital_snake): + """ + Sets the capital_snake of this Capitalization. + + :param capital_snake: The capital_snake of this Capitalization. + :type: str + """ + + self._capital_snake = capital_snake + + @property + def sca_eth_flow_points(self): + """ + Gets the sca_eth_flow_points of this Capitalization. + + :return: The sca_eth_flow_points of this Capitalization. + :rtype: str + """ + return self._sca_eth_flow_points + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, sca_eth_flow_points): + """ + Sets the sca_eth_flow_points of this Capitalization. + + :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. + :type: str + """ + + self._sca_eth_flow_points = sca_eth_flow_points + + @property + def att_name(self): + """ + Gets the att_name of this Capitalization. + Name of the pet + + :return: The att_name of this Capitalization. + :rtype: str + """ + return self._att_name + + @att_name.setter + def att_name(self, att_name): + """ + Sets the att_name of this Capitalization. + Name of the pet + + :param att_name: The att_name of this Capitalization. + :type: str + """ + + self._att_name = att_name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Capitalization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/cat.py b/samples/client/petstore/python-tornado/petstore_api/models/cat.py new file mode 100644 index 00000000000..76dfdc0e5b1 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/cat.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Cat(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'declawed': 'bool' + } + + attribute_map = { + 'declawed': 'declawed' + } + + def __init__(self, declawed=None): + """ + Cat - a model defined in Swagger + """ + + self._declawed = None + self.discriminator = None + + if declawed is not None: + self.declawed = declawed + + @property + def declawed(self): + """ + Gets the declawed of this Cat. + + :return: The declawed of this Cat. + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """ + Sets the declawed of this Cat. + + :param declawed: The declawed of this Cat. + :type: bool + """ + + self._declawed = declawed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Cat): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py new file mode 100644 index 00000000000..859283a3f77 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/category.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Category(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): + """ + Category - a model defined in Swagger + """ + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """ + Gets the id of this Category. + + :return: The id of this Category. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Category. + + :param id: The id of this Category. + :type: int + """ + + self._id = id + + @property + def name(self): + """ + Gets the name of this Category. + + :return: The name of this Category. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Category. + + :param name: The name of this Category. + :type: str + """ + + self._name = name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Category): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/class_model.py b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py new file mode 100644 index 00000000000..7b39d38abe9 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/class_model.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ClassModel(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_class': 'str' + } + + attribute_map = { + '_class': '_class' + } + + def __init__(self, _class=None): + """ + ClassModel - a model defined in Swagger + """ + + self.__class = None + self.discriminator = None + + if _class is not None: + self._class = _class + + @property + def _class(self): + """ + Gets the _class of this ClassModel. + + :return: The _class of this ClassModel. + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """ + Sets the _class of this ClassModel. + + :param _class: The _class of this ClassModel. + :type: str + """ + + self.__class = _class + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ClassModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/client.py b/samples/client/petstore/python-tornado/petstore_api/models/client.py new file mode 100644 index 00000000000..395f77913cc --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/client.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Client(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client': 'str' + } + + attribute_map = { + 'client': 'client' + } + + def __init__(self, client=None): + """ + Client - a model defined in Swagger + """ + + self._client = None + self.discriminator = None + + if client is not None: + self.client = client + + @property + def client(self): + """ + Gets the client of this Client. + + :return: The client of this Client. + :rtype: str + """ + return self._client + + @client.setter + def client(self, client): + """ + Sets the client of this Client. + + :param client: The client of this Client. + :type: str + """ + + self._client = client + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Client): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/dog.py b/samples/client/petstore/python-tornado/petstore_api/models/dog.py new file mode 100644 index 00000000000..3c159ad0d6f --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/dog.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Dog(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'breed': 'str' + } + + attribute_map = { + 'breed': 'breed' + } + + def __init__(self, breed=None): + """ + Dog - a model defined in Swagger + """ + + self._breed = None + self.discriminator = None + + if breed is not None: + self.breed = breed + + @property + def breed(self): + """ + Gets the breed of this Dog. + + :return: The breed of this Dog. + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """ + Sets the breed of this Dog. + + :param breed: The breed of this Dog. + :type: str + """ + + self._breed = breed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Dog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py new file mode 100644 index 00000000000..893085ea235 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_arrays.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumArrays(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + + attribute_map = { + 'just_symbol': 'just_symbol', + 'array_enum': 'array_enum' + } + + def __init__(self, just_symbol=None, array_enum=None): + """ + EnumArrays - a model defined in Swagger + """ + + self._just_symbol = None + self._array_enum = None + self.discriminator = None + + if just_symbol is not None: + self.just_symbol = just_symbol + if array_enum is not None: + self.array_enum = array_enum + + @property + def just_symbol(self): + """ + Gets the just_symbol of this EnumArrays. + + :return: The just_symbol of this EnumArrays. + :rtype: str + """ + return self._just_symbol + + @just_symbol.setter + def just_symbol(self, just_symbol): + """ + Sets the just_symbol of this EnumArrays. + + :param just_symbol: The just_symbol of this EnumArrays. + :type: str + """ + allowed_values = [">=", "$"] + if just_symbol not in allowed_values: + raise ValueError( + "Invalid value for `just_symbol` ({0}), must be one of {1}" + .format(just_symbol, allowed_values) + ) + + self._just_symbol = just_symbol + + @property + def array_enum(self): + """ + Gets the array_enum of this EnumArrays. + + :return: The array_enum of this EnumArrays. + :rtype: list[str] + """ + return self._array_enum + + @array_enum.setter + def array_enum(self, array_enum): + """ + Sets the array_enum of this EnumArrays. + + :param array_enum: The array_enum of this EnumArrays. + :type: list[str] + """ + allowed_values = ["fish", "crab"] + if not set(array_enum).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" + .format(", ".join(map(str, set(array_enum)-set(allowed_values))), + ", ".join(map(str, allowed_values))) + ) + + self._array_enum = array_enum + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumArrays): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py new file mode 100644 index 00000000000..d9e0b771a7d --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_class.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _ABC = "_abc" + _EFG = "-efg" + _XYZ_ = "(xyz)" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + EnumClass - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py new file mode 100644 index 00000000000..6d7caa1f4bc --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class EnumTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enum_string': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } + + attribute_map = { + 'enum_string': 'enum_string', + 'enum_integer': 'enum_integer', + 'enum_number': 'enum_number', + 'outer_enum': 'outerEnum' + } + + def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): + """ + EnumTest - a model defined in Swagger + """ + + self._enum_string = None + self._enum_integer = None + self._enum_number = None + self._outer_enum = None + self.discriminator = None + + if enum_string is not None: + self.enum_string = enum_string + if enum_integer is not None: + self.enum_integer = enum_integer + if enum_number is not None: + self.enum_number = enum_number + if outer_enum is not None: + self.outer_enum = outer_enum + + @property + def enum_string(self): + """ + Gets the enum_string of this EnumTest. + + :return: The enum_string of this EnumTest. + :rtype: str + """ + return self._enum_string + + @enum_string.setter + def enum_string(self, enum_string): + """ + Sets the enum_string of this EnumTest. + + :param enum_string: The enum_string of this EnumTest. + :type: str + """ + allowed_values = ["UPPER", "lower", ""] + if enum_string not in allowed_values: + raise ValueError( + "Invalid value for `enum_string` ({0}), must be one of {1}" + .format(enum_string, allowed_values) + ) + + self._enum_string = enum_string + + @property + def enum_integer(self): + """ + Gets the enum_integer of this EnumTest. + + :return: The enum_integer of this EnumTest. + :rtype: int + """ + return self._enum_integer + + @enum_integer.setter + def enum_integer(self, enum_integer): + """ + Sets the enum_integer of this EnumTest. + + :param enum_integer: The enum_integer of this EnumTest. + :type: int + """ + allowed_values = [1, -1] + if enum_integer not in allowed_values: + raise ValueError( + "Invalid value for `enum_integer` ({0}), must be one of {1}" + .format(enum_integer, allowed_values) + ) + + self._enum_integer = enum_integer + + @property + def enum_number(self): + """ + Gets the enum_number of this EnumTest. + + :return: The enum_number of this EnumTest. + :rtype: float + """ + return self._enum_number + + @enum_number.setter + def enum_number(self, enum_number): + """ + Sets the enum_number of this EnumTest. + + :param enum_number: The enum_number of this EnumTest. + :type: float + """ + allowed_values = [1.1, -1.2] + if enum_number not in allowed_values: + raise ValueError( + "Invalid value for `enum_number` ({0}), must be one of {1}" + .format(enum_number, allowed_values) + ) + + self._enum_number = enum_number + + @property + def outer_enum(self): + """ + Gets the outer_enum of this EnumTest. + + :return: The outer_enum of this EnumTest. + :rtype: OuterEnum + """ + return self._outer_enum + + @outer_enum.setter + def outer_enum(self, outer_enum): + """ + Sets the outer_enum of this EnumTest. + + :param outer_enum: The outer_enum of this EnumTest. + :type: OuterEnum + """ + + self._outer_enum = outer_enum + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, EnumTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/format_test.py b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py new file mode 100644 index 00000000000..139d1733b35 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/format_test.py @@ -0,0 +1,468 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class FormatTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + 'float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'str', + 'date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + 'float': 'float', + 'double': 'double', + 'string': 'string', + 'byte': 'byte', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'uuid': 'uuid', + 'password': 'password' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): + """ + FormatTest - a model defined in Swagger + """ + + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self._float = None + self._double = None + self._string = None + self._byte = None + self._binary = None + self._date = None + self._date_time = None + self._uuid = None + self._password = None + self.discriminator = None + + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if float is not None: + self.float = float + if double is not None: + self.double = double + if string is not None: + self.string = string + self.byte = byte + if binary is not None: + self.binary = binary + self.date = date + if date_time is not None: + self.date_time = date_time + if uuid is not None: + self.uuid = uuid + self.password = password + + @property + def integer(self): + """ + Gets the integer of this FormatTest. + + :return: The integer of this FormatTest. + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """ + Sets the integer of this FormatTest. + + :param integer: The integer of this FormatTest. + :type: int + """ + if integer is not None and integer > 100: + raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") + if integer is not None and integer < 10: + raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") + + self._integer = integer + + @property + def int32(self): + """ + Gets the int32 of this FormatTest. + + :return: The int32 of this FormatTest. + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """ + Sets the int32 of this FormatTest. + + :param int32: The int32 of this FormatTest. + :type: int + """ + if int32 is not None and int32 > 200: + raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") + if int32 is not None and int32 < 20: + raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") + + self._int32 = int32 + + @property + def int64(self): + """ + Gets the int64 of this FormatTest. + + :return: The int64 of this FormatTest. + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """ + Sets the int64 of this FormatTest. + + :param int64: The int64 of this FormatTest. + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """ + Gets the number of this FormatTest. + + :return: The number of this FormatTest. + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """ + Sets the number of this FormatTest. + + :param number: The number of this FormatTest. + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") + if number is not None and number > 543.2: + raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") + if number is not None and number < 32.1: + raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") + + self._number = number + + @property + def float(self): + """ + Gets the float of this FormatTest. + + :return: The float of this FormatTest. + :rtype: float + """ + return self._float + + @float.setter + def float(self, float): + """ + Sets the float of this FormatTest. + + :param float: The float of this FormatTest. + :type: float + """ + if float is not None and float > 987.6: + raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") + if float is not None and float < 54.3: + raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") + + self._float = float + + @property + def double(self): + """ + Gets the double of this FormatTest. + + :return: The double of this FormatTest. + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """ + Sets the double of this FormatTest. + + :param double: The double of this FormatTest. + :type: float + """ + if double is not None and double > 123.4: + raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") + if double is not None and double < 67.8: + raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") + + self._double = double + + @property + def string(self): + """ + Gets the string of this FormatTest. + + :return: The string of this FormatTest. + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """ + Sets the string of this FormatTest. + + :param string: The string of this FormatTest. + :type: str + """ + if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): + raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") + + self._string = string + + @property + def byte(self): + """ + Gets the byte of this FormatTest. + + :return: The byte of this FormatTest. + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """ + Sets the byte of this FormatTest. + + :param byte: The byte of this FormatTest. + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") + if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): + raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") + + self._byte = byte + + @property + def binary(self): + """ + Gets the binary of this FormatTest. + + :return: The binary of this FormatTest. + :rtype: str + """ + return self._binary + + @binary.setter + def binary(self, binary): + """ + Sets the binary of this FormatTest. + + :param binary: The binary of this FormatTest. + :type: str + """ + + self._binary = binary + + @property + def date(self): + """ + Gets the date of this FormatTest. + + :return: The date of this FormatTest. + :rtype: date + """ + return self._date + + @date.setter + def date(self, date): + """ + Sets the date of this FormatTest. + + :param date: The date of this FormatTest. + :type: date + """ + if date is None: + raise ValueError("Invalid value for `date`, must not be `None`") + + self._date = date + + @property + def date_time(self): + """ + Gets the date_time of this FormatTest. + + :return: The date_time of this FormatTest. + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """ + Sets the date_time of this FormatTest. + + :param date_time: The date_time of this FormatTest. + :type: datetime + """ + + self._date_time = date_time + + @property + def uuid(self): + """ + Gets the uuid of this FormatTest. + + :return: The uuid of this FormatTest. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """ + Sets the uuid of this FormatTest. + + :param uuid: The uuid of this FormatTest. + :type: str + """ + + self._uuid = uuid + + @property + def password(self): + """ + Gets the password of this FormatTest. + + :return: The password of this FormatTest. + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """ + Sets the password of this FormatTest. + + :param password: The password of this FormatTest. + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") + if password is not None and len(password) > 64: + raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") + if password is not None and len(password) < 10: + raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") + + self._password = password + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, FormatTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py new file mode 100644 index 00000000000..da0c14ec5b1 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/has_only_read_only.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class HasOnlyReadOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'foo': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'foo': 'foo' + } + + def __init__(self, bar=None, foo=None): + """ + HasOnlyReadOnly - a model defined in Swagger + """ + + self._bar = None + self._foo = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if foo is not None: + self.foo = foo + + @property + def bar(self): + """ + Gets the bar of this HasOnlyReadOnly. + + :return: The bar of this HasOnlyReadOnly. + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """ + Sets the bar of this HasOnlyReadOnly. + + :param bar: The bar of this HasOnlyReadOnly. + :type: str + """ + + self._bar = bar + + @property + def foo(self): + """ + Gets the foo of this HasOnlyReadOnly. + + :return: The foo of this HasOnlyReadOnly. + :rtype: str + """ + return self._foo + + @foo.setter + def foo(self, foo): + """ + Sets the foo of this HasOnlyReadOnly. + + :param foo: The foo of this HasOnlyReadOnly. + :type: str + """ + + self._foo = foo + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, HasOnlyReadOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/list.py b/samples/client/petstore/python-tornado/petstore_api/models/list.py new file mode 100644 index 00000000000..2ac0e51fb12 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/list.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class List(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_123_list': 'str' + } + + attribute_map = { + '_123_list': '123-list' + } + + def __init__(self, _123_list=None): + """ + List - a model defined in Swagger + """ + + self.__123_list = None + self.discriminator = None + + if _123_list is not None: + self._123_list = _123_list + + @property + def _123_list(self): + """ + Gets the _123_list of this List. + + :return: The _123_list of this List. + :rtype: str + """ + return self.__123_list + + @_123_list.setter + def _123_list(self, _123_list): + """ + Sets the _123_list of this List. + + :param _123_list: The _123_list of this List. + :type: str + """ + + self.__123_list = _123_list + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, List): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/map_test.py b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py new file mode 100644 index 00000000000..3cb936e0db8 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/map_test.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class MapTest(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)' + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', + 'map_of_enum_string': 'map_of_enum_string' + } + + def __init__(self, map_map_of_string=None, map_of_enum_string=None): + """ + MapTest - a model defined in Swagger + """ + + self._map_map_of_string = None + self._map_of_enum_string = None + self.discriminator = None + + if map_map_of_string is not None: + self.map_map_of_string = map_map_of_string + if map_of_enum_string is not None: + self.map_of_enum_string = map_of_enum_string + + @property + def map_map_of_string(self): + """ + Gets the map_map_of_string of this MapTest. + + :return: The map_map_of_string of this MapTest. + :rtype: dict(str, dict(str, str)) + """ + return self._map_map_of_string + + @map_map_of_string.setter + def map_map_of_string(self, map_map_of_string): + """ + Sets the map_map_of_string of this MapTest. + + :param map_map_of_string: The map_map_of_string of this MapTest. + :type: dict(str, dict(str, str)) + """ + + self._map_map_of_string = map_map_of_string + + @property + def map_of_enum_string(self): + """ + Gets the map_of_enum_string of this MapTest. + + :return: The map_of_enum_string of this MapTest. + :rtype: dict(str, str) + """ + return self._map_of_enum_string + + @map_of_enum_string.setter + def map_of_enum_string(self, map_of_enum_string): + """ + Sets the map_of_enum_string of this MapTest. + + :param map_of_enum_string: The map_of_enum_string of this MapTest. + :type: dict(str, str) + """ + allowed_values = ["UPPER", "lower"] + if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" + .format(", ".join(map(str, set(map_of_enum_string.keys())-set(allowed_values))), + ", ".join(map(str, allowed_values))) + ) + + self._map_of_enum_string = map_of_enum_string + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, MapTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..4b773deacef --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class MixedPropertiesAndAdditionalPropertiesClass(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + + attribute_map = { + 'uuid': 'uuid', + 'date_time': 'dateTime', + 'map': 'map' + } + + def __init__(self, uuid=None, date_time=None, map=None): + """ + MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger + """ + + self._uuid = None + self._date_time = None + self._map = None + self.discriminator = None + + if uuid is not None: + self.uuid = uuid + if date_time is not None: + self.date_time = date_time + if map is not None: + self.map = map + + @property + def uuid(self): + """ + Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """ + Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. + :type: str + """ + + self._uuid = uuid + + @property + def date_time(self): + """ + Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """ + Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. + :type: datetime + """ + + self._date_time = date_time + + @property + def map(self): + """ + Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. + :rtype: dict(str, Animal) + """ + return self._map + + @map.setter + def map(self, map): + """ + Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. + :type: dict(str, Animal) + """ + + self._map = map + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py b/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py new file mode 100644 index 00000000000..2b6aeb090c0 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/model_200_response.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Model200Response(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + '_class': 'str' + } + + attribute_map = { + 'name': 'name', + '_class': 'class' + } + + def __init__(self, name=None, _class=None): + """ + Model200Response - a model defined in Swagger + """ + + self._name = None + self.__class = None + self.discriminator = None + + if name is not None: + self.name = name + if _class is not None: + self._class = _class + + @property + def name(self): + """ + Gets the name of this Model200Response. + + :return: The name of this Model200Response. + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Model200Response. + + :param name: The name of this Model200Response. + :type: int + """ + + self._name = name + + @property + def _class(self): + """ + Gets the _class of this Model200Response. + + :return: The _class of this Model200Response. + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """ + Sets the _class of this Model200Response. + + :param _class: The _class of this Model200Response. + :type: str + """ + + self.__class = _class + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Model200Response): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/model_return.py b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py new file mode 100644 index 00000000000..a2160d21dd1 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/model_return.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ModelReturn(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_return': 'int' + } + + attribute_map = { + '_return': 'return' + } + + def __init__(self, _return=None): + """ + ModelReturn - a model defined in Swagger + """ + + self.__return = None + self.discriminator = None + + if _return is not None: + self._return = _return + + @property + def _return(self): + """ + Gets the _return of this ModelReturn. + + :return: The _return of this ModelReturn. + :rtype: int + """ + return self.__return + + @_return.setter + def _return(self, _return): + """ + Sets the _return of this ModelReturn. + + :param _return: The _return of this ModelReturn. + :type: int + """ + + self.__return = _return + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ModelReturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/name.py b/samples/client/petstore/python-tornado/petstore_api/models/name.py new file mode 100644 index 00000000000..52b51890dde --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/name.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Name(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } + + attribute_map = { + 'name': 'name', + 'snake_case': 'snake_case', + '_property': 'property', + '_123_number': '123Number' + } + + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): + """ + Name - a model defined in Swagger + """ + + self._name = None + self._snake_case = None + self.__property = None + self.__123_number = None + self.discriminator = None + + self.name = name + if snake_case is not None: + self.snake_case = snake_case + if _property is not None: + self._property = _property + if _123_number is not None: + self._123_number = _123_number + + @property + def name(self): + """ + Gets the name of this Name. + + :return: The name of this Name. + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Name. + + :param name: The name of this Name. + :type: int + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") + + self._name = name + + @property + def snake_case(self): + """ + Gets the snake_case of this Name. + + :return: The snake_case of this Name. + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """ + Sets the snake_case of this Name. + + :param snake_case: The snake_case of this Name. + :type: int + """ + + self._snake_case = snake_case + + @property + def _property(self): + """ + Gets the _property of this Name. + + :return: The _property of this Name. + :rtype: str + """ + return self.__property + + @_property.setter + def _property(self, _property): + """ + Sets the _property of this Name. + + :param _property: The _property of this Name. + :type: str + """ + + self.__property = _property + + @property + def _123_number(self): + """ + Gets the _123_number of this Name. + + :return: The _123_number of this Name. + :rtype: int + """ + return self.__123_number + + @_123_number.setter + def _123_number(self, _123_number): + """ + Sets the _123_number of this Name. + + :param _123_number: The _123_number of this Name. + :type: int + """ + + self.__123_number = _123_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Name): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/number_only.py b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py new file mode 100644 index 00000000000..b0e279b53a5 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/number_only.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class NumberOnly(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_number': 'float' + } + + attribute_map = { + 'just_number': 'JustNumber' + } + + def __init__(self, just_number=None): + """ + NumberOnly - a model defined in Swagger + """ + + self._just_number = None + self.discriminator = None + + if just_number is not None: + self.just_number = just_number + + @property + def just_number(self): + """ + Gets the just_number of this NumberOnly. + + :return: The just_number of this NumberOnly. + :rtype: float + """ + return self._just_number + + @just_number.setter + def just_number(self, just_number): + """ + Sets the just_number of this NumberOnly. + + :param just_number: The just_number of this NumberOnly. + :type: float + """ + + self._just_number = just_number + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/order.py b/samples/client/petstore/python-tornado/petstore_api/models/order.py new file mode 100644 index 00000000000..52c7b6c227e --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/order.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Order(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + + attribute_map = { + 'id': 'id', + 'pet_id': 'petId', + 'quantity': 'quantity', + 'ship_date': 'shipDate', + 'status': 'status', + 'complete': 'complete' + } + + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): + """ + Order - a model defined in Swagger + """ + + self._id = None + self._pet_id = None + self._quantity = None + self._ship_date = None + self._status = None + self._complete = None + self.discriminator = None + + if id is not None: + self.id = id + if pet_id is not None: + self.pet_id = pet_id + if quantity is not None: + self.quantity = quantity + if ship_date is not None: + self.ship_date = ship_date + if status is not None: + self.status = status + if complete is not None: + self.complete = complete + + @property + def id(self): + """ + Gets the id of this Order. + + :return: The id of this Order. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Order. + + :param id: The id of this Order. + :type: int + """ + + self._id = id + + @property + def pet_id(self): + """ + Gets the pet_id of this Order. + + :return: The pet_id of this Order. + :rtype: int + """ + return self._pet_id + + @pet_id.setter + def pet_id(self, pet_id): + """ + Sets the pet_id of this Order. + + :param pet_id: The pet_id of this Order. + :type: int + """ + + self._pet_id = pet_id + + @property + def quantity(self): + """ + Gets the quantity of this Order. + + :return: The quantity of this Order. + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """ + Sets the quantity of this Order. + + :param quantity: The quantity of this Order. + :type: int + """ + + self._quantity = quantity + + @property + def ship_date(self): + """ + Gets the ship_date of this Order. + + :return: The ship_date of this Order. + :rtype: datetime + """ + return self._ship_date + + @ship_date.setter + def ship_date(self, ship_date): + """ + Sets the ship_date of this Order. + + :param ship_date: The ship_date of this Order. + :type: datetime + """ + + self._ship_date = ship_date + + @property + def status(self): + """ + Gets the status of this Order. + Order Status + + :return: The status of this Order. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this Order. + Order Status + + :param status: The status of this Order. + :type: str + """ + allowed_values = ["placed", "approved", "delivered"] + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) + + self._status = status + + @property + def complete(self): + """ + Gets the complete of this Order. + + :return: The complete of this Order. + :rtype: bool + """ + return self._complete + + @complete.setter + def complete(self, complete): + """ + Sets the complete of this Order. + + :param complete: The complete of this Order. + :type: bool + """ + + self._complete = complete + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Order): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py new file mode 100644 index 00000000000..aa9aee11973 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_boolean.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterBoolean(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterBoolean - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterBoolean): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py new file mode 100644 index 00000000000..81611c17688 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_composite.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterComposite(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'my_number': 'OuterNumber', + 'my_string': 'OuterString', + 'my_boolean': 'OuterBoolean' + } + + attribute_map = { + 'my_number': 'my_number', + 'my_string': 'my_string', + 'my_boolean': 'my_boolean' + } + + def __init__(self, my_number=None, my_string=None, my_boolean=None): + """ + OuterComposite - a model defined in Swagger + """ + + self._my_number = None + self._my_string = None + self._my_boolean = None + self.discriminator = None + + if my_number is not None: + self.my_number = my_number + if my_string is not None: + self.my_string = my_string + if my_boolean is not None: + self.my_boolean = my_boolean + + @property + def my_number(self): + """ + Gets the my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. + :rtype: OuterNumber + """ + return self._my_number + + @my_number.setter + def my_number(self, my_number): + """ + Sets the my_number of this OuterComposite. + + :param my_number: The my_number of this OuterComposite. + :type: OuterNumber + """ + + self._my_number = my_number + + @property + def my_string(self): + """ + Gets the my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. + :rtype: OuterString + """ + return self._my_string + + @my_string.setter + def my_string(self, my_string): + """ + Sets the my_string of this OuterComposite. + + :param my_string: The my_string of this OuterComposite. + :type: OuterString + """ + + self._my_string = my_string + + @property + def my_boolean(self): + """ + Gets the my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. + :rtype: OuterBoolean + """ + return self._my_boolean + + @my_boolean.setter + def my_boolean(self, my_boolean): + """ + Sets the my_boolean of this OuterComposite. + + :param my_boolean: The my_boolean of this OuterComposite. + :type: OuterBoolean + """ + + self._my_boolean = my_boolean + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterComposite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py new file mode 100644 index 00000000000..8772472c655 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_enum.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterEnum(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PLACED = "placed" + APPROVED = "approved" + DELIVERED = "delivered" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterEnum - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py new file mode 100644 index 00000000000..04c44923fb0 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_number.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterNumber(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterNumber - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py new file mode 100644 index 00000000000..fd2d7c7623e --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/outer_string.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterString(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + + def __init__(self): + """ + OuterString - a model defined in Swagger + """ + + self.discriminator = None + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/pet.py b/samples/client/petstore/python-tornado/petstore_api/models/pet.py new file mode 100644 index 00000000000..e1afa26f785 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/pet.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Pet(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'name': 'name', + 'photo_urls': 'photoUrls', + 'tags': 'tags', + 'status': 'status' + } + + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): + """ + Pet - a model defined in Swagger + """ + + self._id = None + self._category = None + self._name = None + self._photo_urls = None + self._tags = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if category is not None: + self.category = category + self.name = name + self.photo_urls = photo_urls + if tags is not None: + self.tags = tags + if status is not None: + self.status = status + + @property + def id(self): + """ + Gets the id of this Pet. + + :return: The id of this Pet. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Pet. + + :param id: The id of this Pet. + :type: int + """ + + self._id = id + + @property + def category(self): + """ + Gets the category of this Pet. + + :return: The category of this Pet. + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """ + Sets the category of this Pet. + + :param category: The category of this Pet. + :type: Category + """ + + self._category = category + + @property + def name(self): + """ + Gets the name of this Pet. + + :return: The name of this Pet. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Pet. + + :param name: The name of this Pet. + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") + + self._name = name + + @property + def photo_urls(self): + """ + Gets the photo_urls of this Pet. + + :return: The photo_urls of this Pet. + :rtype: list[str] + """ + return self._photo_urls + + @photo_urls.setter + def photo_urls(self, photo_urls): + """ + Sets the photo_urls of this Pet. + + :param photo_urls: The photo_urls of this Pet. + :type: list[str] + """ + if photo_urls is None: + raise ValueError("Invalid value for `photo_urls`, must not be `None`") + + self._photo_urls = photo_urls + + @property + def tags(self): + """ + Gets the tags of this Pet. + + :return: The tags of this Pet. + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """ + Sets the tags of this Pet. + + :param tags: The tags of this Pet. + :type: list[Tag] + """ + + self._tags = tags + + @property + def status(self): + """ + Gets the status of this Pet. + pet status in the store + + :return: The status of this Pet. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """ + Sets the status of this Pet. + pet status in the store + + :param status: The status of this Pet. + :type: str + """ + allowed_values = ["available", "pending", "sold"] + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Pet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py new file mode 100644 index 00000000000..a26d1f33c87 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/read_only_first.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class ReadOnlyFirst(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'baz': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'baz': 'baz' + } + + def __init__(self, bar=None, baz=None): + """ + ReadOnlyFirst - a model defined in Swagger + """ + + self._bar = None + self._baz = None + self.discriminator = None + + if bar is not None: + self.bar = bar + if baz is not None: + self.baz = baz + + @property + def bar(self): + """ + Gets the bar of this ReadOnlyFirst. + + :return: The bar of this ReadOnlyFirst. + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """ + Sets the bar of this ReadOnlyFirst. + + :param bar: The bar of this ReadOnlyFirst. + :type: str + """ + + self._bar = bar + + @property + def baz(self): + """ + Gets the baz of this ReadOnlyFirst. + + :return: The baz of this ReadOnlyFirst. + :rtype: str + """ + return self._baz + + @baz.setter + def baz(self, baz): + """ + Sets the baz of this ReadOnlyFirst. + + :param baz: The baz of this ReadOnlyFirst. + :type: str + """ + + self._baz = baz + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, ReadOnlyFirst): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py new file mode 100644 index 00000000000..6be888fb9e3 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/special_model_name.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class SpecialModelName(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'special_property_name': 'int' + } + + attribute_map = { + 'special_property_name': '$special[property.name]' + } + + def __init__(self, special_property_name=None): + """ + SpecialModelName - a model defined in Swagger + """ + + self._special_property_name = None + self.discriminator = None + + if special_property_name is not None: + self.special_property_name = special_property_name + + @property + def special_property_name(self): + """ + Gets the special_property_name of this SpecialModelName. + + :return: The special_property_name of this SpecialModelName. + :rtype: int + """ + return self._special_property_name + + @special_property_name.setter + def special_property_name(self, special_property_name): + """ + Sets the special_property_name of this SpecialModelName. + + :param special_property_name: The special_property_name of this SpecialModelName. + :type: int + """ + + self._special_property_name = special_property_name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, SpecialModelName): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/tag.py b/samples/client/petstore/python-tornado/petstore_api/models/tag.py new file mode 100644 index 00000000000..d59a490a07d --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/tag.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class Tag(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): + """ + Tag - a model defined in Swagger + """ + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """ + Gets the id of this Tag. + + :return: The id of this Tag. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this Tag. + + :param id: The id of this Tag. + :type: int + """ + + self._id = id + + @property + def name(self): + """ + Gets the name of this Tag. + + :return: The name of this Tag. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this Tag. + + :param name: The name of this Tag. + :type: str + """ + + self._name = name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Tag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/models/user.py b/samples/client/petstore/python-tornado/petstore_api/models/user.py new file mode 100644 index 00000000000..21993e90521 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/models/user.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class User(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email': 'email', + 'password': 'password', + 'phone': 'phone', + 'user_status': 'userStatus' + } + + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): + """ + User - a model defined in Swagger + """ + + self._id = None + self._username = None + self._first_name = None + self._last_name = None + self._email = None + self._password = None + self._phone = None + self._user_status = None + self.discriminator = None + + if id is not None: + self.id = id + if username is not None: + self.username = username + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if email is not None: + self.email = email + if password is not None: + self.password = password + if phone is not None: + self.phone = phone + if user_status is not None: + self.user_status = user_status + + @property + def id(self): + """ + Gets the id of this User. + + :return: The id of this User. + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """ + Sets the id of this User. + + :param id: The id of this User. + :type: int + """ + + self._id = id + + @property + def username(self): + """ + Gets the username of this User. + + :return: The username of this User. + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """ + Sets the username of this User. + + :param username: The username of this User. + :type: str + """ + + self._username = username + + @property + def first_name(self): + """ + Gets the first_name of this User. + + :return: The first_name of this User. + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """ + Sets the first_name of this User. + + :param first_name: The first_name of this User. + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """ + Gets the last_name of this User. + + :return: The last_name of this User. + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """ + Sets the last_name of this User. + + :param last_name: The last_name of this User. + :type: str + """ + + self._last_name = last_name + + @property + def email(self): + """ + Gets the email of this User. + + :return: The email of this User. + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """ + Sets the email of this User. + + :param email: The email of this User. + :type: str + """ + + self._email = email + + @property + def password(self): + """ + Gets the password of this User. + + :return: The password of this User. + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """ + Sets the password of this User. + + :param password: The password of this User. + :type: str + """ + + self._password = password + + @property + def phone(self): + """ + Gets the phone of this User. + + :return: The phone of this User. + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """ + Sets the phone of this User. + + :param phone: The phone of this User. + :type: str + """ + + self._phone = phone + + @property + def user_status(self): + """ + Gets the user_status of this User. + User Status + + :return: The user_status of this User. + :rtype: int + """ + return self._user_status + + @user_status.setter + def user_status(self, user_status): + """ + Sets the user_status of this User. + User Status + + :param user_status: The user_status of this User. + :type: int + """ + + self._user_status = user_status + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python-tornado/petstore_api/rest.py b/samples/client/petstore/python-tornado/petstore_api/rest.py new file mode 100644 index 00000000000..dc76fcdb917 --- /dev/null +++ b/samples/client/petstore/python-tornado/petstore_api/rest.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import io +import json +import ssl +import certifi +import logging +import re +import tornado +import tornado.gen +from tornado.httpclient import AsyncHTTPClient, HTTPRequest + +# python 2 and python 3 compatibility library +from six import PY3 +from six.moves.urllib.parse import urlencode +from urllib3.filepost import encode_multipart_formdata + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp, data): + self.tornado_response = resp + self.status = resp.code + self.reason = resp.reason + self.data = data + + def getheaders(self): + """ + Returns a CIMultiDictProxy of the response headers. + """ + return self.tornado_response.headers + + def getheader(self, name, default=None): + """ + Returns a given response header. + """ + return self.tornado_response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration, pools_size=4, maxsize=4): + # maxsize is the number of requests to host that are allowed in parallel + # ca_certs vs cert_file vs key_file + # http://stackoverflow.com/a/23957365/2985775 + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + self.ssl_context = ssl_context = ssl.SSLContext() + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + self.proxy_port = self.proxy_host = None + + # https pool manager + if configuration.proxy: + self.proxy_port = 80 + self.proxy_host = configuration.proxy + + self.pool_manager = AsyncHTTPClient() + + @tornado.gen.coroutine + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, _request_timeout=None): + """ + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: this is a non-applicable field for the AiohttpClient. + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + request = HTTPRequest(url) + request.ssl_context = self.ssl_context + request.proxy_host = self.proxy_host + request.proxy_port = self.proxy_port + request.method = method + if headers: + request.headers = headers + if 'Content-Type' not in headers: + request.headers['Content-Type'] = 'application/json' + request.request_timeout = _request_timeout or 5 * 60 + + + post_params = post_params or {} + + if query_params: + request.url += '?' + urlencode(query_params) + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body: + body = json.dumps(body) + request.body = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + request.body = urlencode(post_params) + # TODO: transform to multipart form + elif headers['Content-Type'] == 'multipart/form-data': + request.body = encode_multipart_formdata(post_params) + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, bytes): + request.body = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided arguments. + Please check that your arguments match declared content type.""" + raise ApiException(status=0, reason=msg) + + r = yield self.pool_manager.fetch(request) + r = RESTResponse(r, r.body) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + @tornado.gen.coroutine + def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + result = yield self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + result = yield self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + result = yield self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): + result = yield self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + result = yield self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + result = yield self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + raise tornado.gen.Return(result) + + @tornado.gen.coroutine + def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True, + _request_timeout=None): + result = yield self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + raise tornado.gen.Return(result) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """ + Custom error messages for exception + """ + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format(self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/samples/client/petstore/python-tornado/requirements.txt b/samples/client/petstore/python-tornado/requirements.txt new file mode 100644 index 00000000000..bafdc07532f --- /dev/null +++ b/samples/client/petstore/python-tornado/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py new file mode 100644 index 00000000000..7373560db31 --- /dev/null +++ b/samples/client/petstore/python-tornado/setup.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import sys +from setuptools import setup, find_packages + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES.append("tornado") + +setup( + name=NAME, + version=VERSION, + description="Swagger Petstore", + author_email="apiteam@swagger.io", + url="", + keywords=["Swagger", "Swagger Petstore"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_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: \" \\ + """ +) diff --git a/samples/client/petstore/python-tornado/test-requirements.txt b/samples/client/petstore/python-tornado/test-requirements.txt new file mode 100644 index 00000000000..2702246c0e6 --- /dev/null +++ b/samples/client/petstore/python-tornado/test-requirements.txt @@ -0,0 +1,5 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/samples/client/petstore/python-tornado/test/__init__.py b/samples/client/petstore/python-tornado/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/python-tornado/test/test_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_additional_properties_class.py new file mode 100644 index 00000000000..e90e5f92efc --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_additional_properties_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """ AdditionalPropertiesClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """ + Test AdditionalPropertiesClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_animal.py b/samples/client/petstore/python-tornado/test/test_animal.py new file mode 100644 index 00000000000..c675d583ccc --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_animal.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal import Animal + + +class TestAnimal(unittest.TestCase): + """ Animal unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """ + Test Animal + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.animal.Animal() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_animal_farm.py b/samples/client/petstore/python-tornado/test/test_animal_farm.py new file mode 100644 index 00000000000..e459318a948 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_animal_farm.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.animal_farm import AnimalFarm + + +class TestAnimalFarm(unittest.TestCase): + """ AnimalFarm unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimalFarm(self): + """ + Test AnimalFarm + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.animal_farm.AnimalFarm() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_another_fake_api.py b/samples/client/petstore/python-tornado/test/test_another_fake_api.py new file mode 100644 index 00000000000..9f562fe1134 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_another_fake_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.another_fake_api import AnotherFakeApi + + +class TestAnotherFakeApi(unittest.TestCase): + """ AnotherFakeApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.another_fake_api.AnotherFakeApi() + + def tearDown(self): + pass + + def test_test_special_tags(self): + """ + Test case for test_special_tags + + To test special tags + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_api_response.py b/samples/client/petstore/python-tornado/test/test_api_response.py new file mode 100644 index 00000000000..928af048b43 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_api_response.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.api_response import ApiResponse + + +class TestApiResponse(unittest.TestCase): + """ ApiResponse unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """ + Test ApiResponse + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.api_response.ApiResponse() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..740e45cbafd --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_array_of_array_of_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ ArrayOfArrayOfNumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """ + Test ArrayOfArrayOfNumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_of_number_only.py b/samples/client/petstore/python-tornado/test/test_array_of_number_only.py new file mode 100644 index 00000000000..6da67a490b6 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_array_of_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ ArrayOfNumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """ + Test ArrayOfNumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_array_test.py b/samples/client/petstore/python-tornado/test/test_array_test.py new file mode 100644 index 00000000000..dcf8cc111c0 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_array_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.array_test import ArrayTest + + +class TestArrayTest(unittest.TestCase): + """ ArrayTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """ + Test ArrayTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.array_test.ArrayTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_capitalization.py b/samples/client/petstore/python-tornado/test/test_capitalization.py new file mode 100644 index 00000000000..4ea6d2e3fd0 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_capitalization.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.capitalization import Capitalization + + +class TestCapitalization(unittest.TestCase): + """ Capitalization unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """ + Test Capitalization + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.capitalization.Capitalization() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_cat.py b/samples/client/petstore/python-tornado/test/test_cat.py new file mode 100644 index 00000000000..9d9fbc50ab3 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_cat.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.cat import Cat + + +class TestCat(unittest.TestCase): + """ Cat unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """ + Test Cat + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.cat.Cat() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_category.py b/samples/client/petstore/python-tornado/test/test_category.py new file mode 100644 index 00000000000..6ded8f0f1ac --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_category.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.category import Category + + +class TestCategory(unittest.TestCase): + """ Category unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """ + Test Category + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.category.Category() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_class_model.py b/samples/client/petstore/python-tornado/test/test_class_model.py new file mode 100644 index 00000000000..85d56bbe52a --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_class_model.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.class_model import ClassModel + + +class TestClassModel(unittest.TestCase): + """ ClassModel unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """ + Test ClassModel + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.class_model.ClassModel() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_client.py b/samples/client/petstore/python-tornado/test/test_client.py new file mode 100644 index 00000000000..363ced2923c --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_client.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.client import Client + + +class TestClient(unittest.TestCase): + """ Client unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """ + Test Client + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.client.Client() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_dog.py b/samples/client/petstore/python-tornado/test/test_dog.py new file mode 100644 index 00000000000..b0428646591 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_dog.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.dog import Dog + + +class TestDog(unittest.TestCase): + """ Dog unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """ + Test Dog + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.dog.Dog() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_arrays.py b/samples/client/petstore/python-tornado/test/test_enum_arrays.py new file mode 100644 index 00000000000..2803f17aede --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_enum_arrays.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_arrays import EnumArrays + + +class TestEnumArrays(unittest.TestCase): + """ EnumArrays unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """ + Test EnumArrays + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_arrays.EnumArrays() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_class.py b/samples/client/petstore/python-tornado/test/test_enum_class.py new file mode 100644 index 00000000000..f673e741f84 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_enum_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_class import EnumClass + + +class TestEnumClass(unittest.TestCase): + """ EnumClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """ + Test EnumClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_class.EnumClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_enum_test.py b/samples/client/petstore/python-tornado/test/test_enum_test.py new file mode 100644 index 00000000000..e27c0107fd2 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_enum_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.enum_test import EnumTest + + +class TestEnumTest(unittest.TestCase): + """ EnumTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """ + Test EnumTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.enum_test.EnumTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_fake_api.py b/samples/client/petstore/python-tornado/test/test_fake_api.py new file mode 100644 index 00000000000..55a02cf899c --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_fake_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.fake_api import FakeApi + + +class TestFakeApi(unittest.TestCase): + """ FakeApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.fake_api.FakeApi() + + def tearDown(self): + pass + + def test_fake_outer_boolean_serialize(self): + """ + Test case for fake_outer_boolean_serialize + + + """ + pass + + def test_fake_outer_composite_serialize(self): + """ + Test case for fake_outer_composite_serialize + + + """ + pass + + def test_fake_outer_number_serialize(self): + """ + Test case for fake_outer_number_serialize + + + """ + pass + + def test_fake_outer_string_serialize(self): + """ + Test case for fake_outer_string_serialize + + + """ + pass + + def test_test_client_model(self): + """ + Test case for test_client_model + + To test \"client\" model + """ + pass + + def test_test_endpoint_parameters(self): + """ + Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + """ + pass + + def test_test_enum_parameters(self): + """ + Test case for test_enum_parameters + + To test enum parameters + """ + pass + + def test_test_json_form_data(self): + """ + Test case for test_json_form_data + + test json serialization of form data + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py new file mode 100644 index 00000000000..7a11a2378bf --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.fake_classname_tags_123_api import FakeClassnameTags123Api + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """ FakeClassnameTags123Api unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.fake_classname_tags_123_api.FakeClassnameTags123Api() + + def tearDown(self): + pass + + def test_test_classname(self): + """ + Test case for test_classname + + To test class name in snake case + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_format_test.py b/samples/client/petstore/python-tornado/test/test_format_test.py new file mode 100644 index 00000000000..ad028c0b431 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_format_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.format_test import FormatTest + + +class TestFormatTest(unittest.TestCase): + """ FormatTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """ + Test FormatTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.format_test.FormatTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_has_only_read_only.py b/samples/client/petstore/python-tornado/test/test_has_only_read_only.py new file mode 100644 index 00000000000..af029f26814 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_has_only_read_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.has_only_read_only import HasOnlyReadOnly + + +class TestHasOnlyReadOnly(unittest.TestCase): + """ HasOnlyReadOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """ + Test HasOnlyReadOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_list.py b/samples/client/petstore/python-tornado/test/test_list.py new file mode 100644 index 00000000000..14400e35281 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_list.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.list import List + + +class TestList(unittest.TestCase): + """ List unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """ + Test List + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.list.List() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_map_test.py b/samples/client/petstore/python-tornado/test/test_map_test.py new file mode 100644 index 00000000000..c4b2092f0ce --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_map_test.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.map_test import MapTest + + +class TestMapTest(unittest.TestCase): + """ MapTest unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """ + Test MapTest + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.map_test.MapTest() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..f614d36da8a --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """ MixedPropertiesAndAdditionalPropertiesClass unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """ + Test MixedPropertiesAndAdditionalPropertiesClass + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_model_200_response.py b/samples/client/petstore/python-tornado/test/test_model_200_response.py new file mode 100644 index 00000000000..f202a2d454f --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_model_200_response.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_200_response import Model200Response + + +class TestModel200Response(unittest.TestCase): + """ Model200Response unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """ + Test Model200Response + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.model_200_response.Model200Response() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_model_return.py b/samples/client/petstore/python-tornado/test/test_model_return.py new file mode 100644 index 00000000000..347c8e4d7cb --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_model_return.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.model_return import ModelReturn + + +class TestModelReturn(unittest.TestCase): + """ ModelReturn unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """ + Test ModelReturn + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.model_return.ModelReturn() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_name.py b/samples/client/petstore/python-tornado/test/test_name.py new file mode 100644 index 00000000000..c06e35427f6 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.name import Name + + +class TestName(unittest.TestCase): + """ Name unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """ + Test Name + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.name.Name() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_number_only.py b/samples/client/petstore/python-tornado/test/test_number_only.py new file mode 100644 index 00000000000..db3197a9e5b --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_number_only.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.number_only import NumberOnly + + +class TestNumberOnly(unittest.TestCase): + """ NumberOnly unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """ + Test NumberOnly + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.number_only.NumberOnly() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_order.py b/samples/client/petstore/python-tornado/test/test_order.py new file mode 100644 index 00000000000..d911487ce97 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_order.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.order import Order + + +class TestOrder(unittest.TestCase): + """ Order unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """ + Test Order + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.order.Order() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_boolean.py b/samples/client/petstore/python-tornado/test/test_outer_boolean.py new file mode 100644 index 00000000000..9474ab76968 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_outer_boolean.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_boolean import OuterBoolean + + +class TestOuterBoolean(unittest.TestCase): + """ OuterBoolean unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterBoolean(self): + """ + Test OuterBoolean + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_boolean.OuterBoolean() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_composite.py b/samples/client/petstore/python-tornado/test/test_outer_composite.py new file mode 100644 index 00000000000..ebbd9d03e6f --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_outer_composite.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_composite import OuterComposite + + +class TestOuterComposite(unittest.TestCase): + """ OuterComposite unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """ + Test OuterComposite + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_composite.OuterComposite() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_enum.py b/samples/client/petstore/python-tornado/test/test_outer_enum.py new file mode 100644 index 00000000000..c6e1f030ef1 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_outer_enum.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_enum import OuterEnum + + +class TestOuterEnum(unittest.TestCase): + """ OuterEnum unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """ + Test OuterEnum + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_enum.OuterEnum() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_number.py b/samples/client/petstore/python-tornado/test/test_outer_number.py new file mode 100644 index 00000000000..9f97b407047 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_outer_number.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_number import OuterNumber + + +class TestOuterNumber(unittest.TestCase): + """ OuterNumber unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterNumber(self): + """ + Test OuterNumber + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_number.OuterNumber() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_outer_string.py b/samples/client/petstore/python-tornado/test/test_outer_string.py new file mode 100644 index 00000000000..b0ac85ed934 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_outer_string.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_string import OuterString + + +class TestOuterString(unittest.TestCase): + """ OuterString unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterString(self): + """ + Test OuterString + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.outer_string.OuterString() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_pet.py b/samples/client/petstore/python-tornado/test/test_pet.py new file mode 100644 index 00000000000..c3e8191bec3 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_pet.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.pet import Pet + + +class TestPet(unittest.TestCase): + """ Pet unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """ + Test Pet + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.pet.Pet() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_pet_api.py b/samples/client/petstore/python-tornado/test/test_pet_api.py new file mode 100644 index 00000000000..1eafc35b28c --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_pet_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.pet_api import PetApi + + +class TestPetApi(unittest.TestCase): + """ PetApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.pet_api.PetApi() + + def tearDown(self): + pass + + def test_add_pet(self): + """ + Test case for add_pet + + Add a new pet to the store + """ + pass + + def test_delete_pet(self): + """ + Test case for delete_pet + + Deletes a pet + """ + pass + + def test_find_pets_by_status(self): + """ + Test case for find_pets_by_status + + Finds Pets by status + """ + pass + + def test_find_pets_by_tags(self): + """ + Test case for find_pets_by_tags + + Finds Pets by tags + """ + pass + + def test_get_pet_by_id(self): + """ + Test case for get_pet_by_id + + Find pet by ID + """ + pass + + def test_update_pet(self): + """ + Test case for update_pet + + Update an existing pet + """ + pass + + def test_update_pet_with_form(self): + """ + Test case for update_pet_with_form + + Updates a pet in the store with form data + """ + pass + + def test_upload_file(self): + """ + Test case for upload_file + + uploads an image + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_read_only_first.py b/samples/client/petstore/python-tornado/test/test_read_only_first.py new file mode 100644 index 00000000000..c89d5d3b6a1 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_read_only_first.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.read_only_first import ReadOnlyFirst + + +class TestReadOnlyFirst(unittest.TestCase): + """ ReadOnlyFirst unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """ + Test ReadOnlyFirst + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.read_only_first.ReadOnlyFirst() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_special_model_name.py b/samples/client/petstore/python-tornado/test/test_special_model_name.py new file mode 100644 index 00000000000..d9fa392c36b --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_special_model_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.special_model_name import SpecialModelName + + +class TestSpecialModelName(unittest.TestCase): + """ SpecialModelName unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """ + Test SpecialModelName + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.special_model_name.SpecialModelName() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_store_api.py b/samples/client/petstore/python-tornado/test/test_store_api.py new file mode 100644 index 00000000000..f131b6068b2 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_store_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.store_api import StoreApi + + +class TestStoreApi(unittest.TestCase): + """ StoreApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.store_api.StoreApi() + + def tearDown(self): + pass + + def test_delete_order(self): + """ + Test case for delete_order + + Delete purchase order by ID + """ + pass + + def test_get_inventory(self): + """ + Test case for get_inventory + + Returns pet inventories by status + """ + pass + + def test_get_order_by_id(self): + """ + Test case for get_order_by_id + + Find purchase order by ID + """ + pass + + def test_place_order(self): + """ + Test case for place_order + + Place an order for a pet + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_tag.py b/samples/client/petstore/python-tornado/test/test_tag.py new file mode 100644 index 00000000000..76f79932c96 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_tag.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.tag import Tag + + +class TestTag(unittest.TestCase): + """ Tag unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """ + Test Tag + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.tag.Tag() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_user.py b/samples/client/petstore/python-tornado/test/test_user.py new file mode 100644 index 00000000000..82f5d9058b0 --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_user.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.user import User + + +class TestUser(unittest.TestCase): + """ User unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """ + Test User + """ + # FIXME: construct object with mandatory attributes with example values + #model = petstore_api.models.user.User() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/test/test_user_api.py b/samples/client/petstore/python-tornado/test/test_user_api.py new file mode 100644 index 00000000000..3e0be964a2d --- /dev/null +++ b/samples/client/petstore/python-tornado/test/test_user_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.apis.user_api import UserApi + + +class TestUserApi(unittest.TestCase): + """ UserApi unit test stubs """ + + def setUp(self): + self.api = petstore_api.apis.user_api.UserApi() + + def tearDown(self): + pass + + def test_create_user(self): + """ + Test case for create_user + + Create user + """ + pass + + def test_create_users_with_array_input(self): + """ + Test case for create_users_with_array_input + + Creates list of users with given input array + """ + pass + + def test_create_users_with_list_input(self): + """ + Test case for create_users_with_list_input + + Creates list of users with given input array + """ + pass + + def test_delete_user(self): + """ + Test case for delete_user + + Delete user + """ + pass + + def test_get_user_by_name(self): + """ + Test case for get_user_by_name + + Get user by user name + """ + pass + + def test_login_user(self): + """ + Test case for login_user + + Logs user into the system + """ + pass + + def test_logout_user(self): + """ + Test case for logout_user + + Logs out current logged in user session + """ + pass + + def test_update_user(self): + """ + Test case for update_user + + Updated user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-tornado/tox.ini b/samples/client/petstore/python-tornado/tox.ini new file mode 100644 index 00000000000..1cf0829dc93 --- /dev/null +++ b/samples/client/petstore/python-tornado/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index a5dea6bf6c5..ff29a063d8c 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -283,7 +283,7 @@ def call_api(self, resource_path, method, _request_timeout=None): """ Makes the HTTP request (synchronous) and return the deserialized data. - To make an async request, define a function for callback. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. :param method: Method to call. @@ -307,10 +307,10 @@ def call_api(self, resource_path, method, :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: - If provide parameter callback, + If async parameter is True, the request will be called asynchronously. The method will return the request thread. - If parameter callback is None, + If parameter async is False or missing, then the method will return the response directly. """ if not async: diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index eed041d0211..9e1fcf24089 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -15,8 +15,9 @@ import urllib3 -import sys import logging +import multiprocessing +import sys from six import iteritems from six.moves import http_client as httplib @@ -75,6 +76,16 @@ def __init__(self): self.cert_file = None # client key file self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + # Proxy URL self.proxy = None diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index e7e38352886..c0807c2fb19 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -56,7 +56,7 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=4): + def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 @@ -76,6 +76,16 @@ def __init__(self, configuration, pools_size=4, maxsize=4): # if not set certificate file, use Mozilla's root certificates. ca_certs = certifi.where() + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = config.assert_hostname + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + # https pool manager if configuration.proxy: self.pool_manager = urllib3.ProxyManager( @@ -85,7 +95,8 @@ def __init__(self, configuration, pools_size=4, maxsize=4): ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, - proxy_url=configuration.proxy + proxy_url=configuration.proxy, + **addition_pool_args ) else: self.pool_manager = urllib3.PoolManager( @@ -94,7 +105,8 @@ def __init__(self, configuration, pools_size=4, maxsize=4): cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, - key_file=configuration.key_file + key_file=configuration.key_file, + **addition_pool_args ) def request(self, method, url, query_params=None, headers=None, From 5443c0a94c67e84fe98aa642a16b9a56c4c1624a Mon Sep 17 00:00:00 2001 From: stkrwork Date: Tue, 19 Sep 2017 03:31:53 +0200 Subject: [PATCH 029/197] [QT5][CPP] Fixing issue with maps in models (#6479) * [QT5][CPP] Fixing issue with maps in models - Adjusted init function to init map correctly - Adjusted cleanup function to cleanup maps correctly * Fixed formatting for samples --- .../java/io/swagger/codegen/languages/Qt5CPPGenerator.java | 3 +++ .../src/main/resources/qt5cpp/model-body.mustache | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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 a2a7c9d559d..378cfad99e3 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 @@ -317,6 +317,9 @@ public String toDefaultValue(Property p) { } else if (p instanceof MapProperty) { MapProperty ap = (MapProperty) p; String inner = getSwaggerType(ap.getAdditionalProperties()); + if (!languageSpecificPrimitives.contains(inner)) { + inner += "*"; + } return "new QMap()"; } else if (p instanceof ArrayProperty) { ArrayProperty ap = (ArrayProperty) p; 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 ba23d2e61f3..14c15270042 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -37,7 +37,7 @@ void {{classname}}::cleanup() { {{#vars}}{{#complexType}} if({{name}} != nullptr) { - {{#isContainer}}QList<{{complexType}}*>* arr = {{name}}; + {{#isContainer}}{{#isListContainer}}QList<{{complexType}}*>* arr = {{name}};{{/isListContainer}}{{#isMapContainer}}QMap* arr = {{name}};{{/isMapContainer}} foreach({{complexType}}* o, *arr) { delete o; } From 146b10777413d022f642900082cf84314d3edebe Mon Sep 17 00:00:00 2001 From: ehyche Date: Mon, 18 Sep 2017 21:46:27 -0400 Subject: [PATCH 030/197] Eliminate all Java compilation warnings for swift4 codegen module (#6467) --- .../codegen/languages/Swift4Codegen.java | 309 ++++++++++++------ 1 file changed, 200 insertions(+), 109 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 89d879344f4..fa5f8e20c1c 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 @@ -3,7 +3,16 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -import io.swagger.codegen.*; + +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.CodegenType; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.codegen.SupportingFile; + import io.swagger.models.Model; import io.swagger.models.ModelImpl; import io.swagger.models.Operation; @@ -13,15 +22,22 @@ import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; + import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; -import javax.annotation.Nullable; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.annotation.Nullable; public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; @@ -68,15 +84,19 @@ public String getHelp() { } @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, ModelImpl swaggerModel) { + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, + ModelImpl swaggerModel) { final Property additionalProperties = swaggerModel.getAdditionalProperties(); - if(additionalProperties != null) { + if (additionalProperties != null) { codegenModel.additionalPropertiesType = getSwaggerType(additionalProperties); } } + /** + * Constructor for the swift4 language codegen module. + */ public Swift4Codegen() { super(); outputFolder = "generated-code" + File.separator + "swift"; @@ -120,14 +140,18 @@ public Swift4Codegen() { "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", "Type", "unowned", "weak", "Data", "Codable", "Encodable", "Decodable") + "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", "Type", "unowned", "weak", + "Data", "Codable", "Encodable", "Decodable") ); typeMapping = new HashMap<>(); @@ -157,11 +181,17 @@ public Swift4Codegen() { importMapping = new HashMap<>(); cliOptions.add(new CliOption(PROJECT_NAME, "Project name in Xcode")); - cliOptions.add(new CliOption(RESPONSE_AS, "Optionally use libraries to manage response. Currently " + - StringUtils.join(RESPONSE_LIBRARIES, ", ") + " are available.")); - cliOptions.add(new CliOption(UNWRAP_REQUIRED, "Treat 'required' properties in response as non-optional " + - "(which would crash the app if api returns null as opposed to required option specified in json schema")); - cliOptions.add(new CliOption(OBJC_COMPATIBLE, "Add additional properties and methods for Objective-C compatibility (default: false)")); + cliOptions.add(new CliOption(RESPONSE_AS, + "Optionally use libraries to manage response. Currently " + + StringUtils.join(RESPONSE_LIBRARIES, ", ") + + " are available.")); + cliOptions.add(new CliOption(UNWRAP_REQUIRED, + "Treat 'required' properties in response as non-optional " + + "(which would crash the app if api returns null as opposed " + + "to required option specified in json schema")); + cliOptions.add(new CliOption(OBJC_COMPATIBLE, + "Add additional properties and methods for Objective-C " + + "compatibility (default: false)")); cliOptions.add(new CliOption(POD_SOURCE, "Source information used for Podspec")); cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "Version used for Podspec")); cliOptions.add(new CliOption(POD_AUTHORS, "Authors used for Podspec")); @@ -172,11 +202,17 @@ public Swift4Codegen() { cliOptions.add(new CliOption(POD_SUMMARY, "Summary used for Podspec")); cliOptions.add(new CliOption(POD_DESCRIPTION, "Description used for Podspec")); cliOptions.add(new CliOption(POD_SCREENSHOTS, "Screenshots used for Podspec")); - cliOptions.add(new CliOption(POD_DOCUMENTATION_URL, "Documentation URL used for Podspec")); - cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, "Flag to make all the API classes inner-class of {{projectName}}API")); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated") + cliOptions.add(new CliOption(POD_DOCUMENTATION_URL, + "Documentation URL used for Podspec")); + cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, + "Flag to make all the API classes inner-class " + + "of {{projectName}}API")); + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, + "hides the timestamp when files were generated") .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(LENIENT_TYPE_CAST, "Accept and cast values for simple types (string->bool, string->int, int->string)") + cliOptions.add(new CliOption(LENIENT_TYPE_CAST, + "Accept and cast values for simple types (string->bool, " + + "string->int, int->string)") .defaultValue(Boolean.FALSE.toString())); } @@ -186,10 +222,13 @@ public void processOpts() { // default HIDE_GENERATION_TIMESTAMP to true if (!additionalProperties.containsKey(CodegenConstants.HIDE_GENERATION_TIMESTAMP)) { - additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, Boolean.TRUE.toString()); - } else { additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, - Boolean.valueOf(additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP).toString())); + Boolean.TRUE.toString()); + } else { + Boolean hide = Boolean.valueOf(additionalProperties() + .get(CodegenConstants.HIDE_GENERATION_TIMESTAMP) + .toString()); + additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, hide); } // Setup project name @@ -200,13 +239,15 @@ public void processOpts() { } sourceFolder = projectName + File.separator + sourceFolder; - // Setup unwrapRequired option, which makes all the properties with "required" non-optional + // Setup unwrapRequired option, which makes all the + // properties with "required" non-optional if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); } additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); - // Setup objcCompatible option, which adds additional properties and methods for Objective-C compatibility + // Setup objcCompatible option, which adds additional properties + // and methods for Objective-C compatibility if (additionalProperties.containsKey(OBJC_COMPATIBLE)) { setObjcCompatible(convertPropertyToBooleanAndWriteBack(OBJC_COMPATIBLE)); } @@ -229,7 +270,8 @@ public void processOpts() { additionalProperties.put("useRxSwift", true); } - // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API + // Setup swiftUseApiNamespace option, which makes all the API + // classes inner-class of {{projectName}}API if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); } @@ -240,20 +282,45 @@ public void processOpts() { setLenientTypeCast(convertPropertyToBooleanAndWriteBack(LENIENT_TYPE_CAST)); - supportingFiles.add(new SupportingFile("Podspec.mustache", "", projectName + ".podspec")); - supportingFiles.add(new SupportingFile("Cartfile.mustache", "", "Cartfile")); - supportingFiles.add(new SupportingFile("APIHelper.mustache", sourceFolder, "APIHelper.swift")); - supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", sourceFolder, - "AlamofireImplementations.swift")); - supportingFiles.add(new SupportingFile("Configuration.mustache", sourceFolder, "Configuration.swift")); - supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift")); - supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift")); - supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift")); - supportingFiles.add(new SupportingFile("CodableHelper.mustache", sourceFolder, "CodableHelper.swift")); - supportingFiles.add(new SupportingFile("JSONEncodableEncoding.mustache", sourceFolder, "JSONEncodableEncoding.swift")); - supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache", sourceFolder, "JSONEncodingHelper.swift")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("Podspec.mustache", + "", + projectName + ".podspec")); + supportingFiles.add(new SupportingFile("Cartfile.mustache", + "", + "Cartfile")); + supportingFiles.add(new SupportingFile("APIHelper.mustache", + sourceFolder, + "APIHelper.swift")); + supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", + sourceFolder, + "AlamofireImplementations.swift")); + supportingFiles.add(new SupportingFile("Configuration.mustache", + sourceFolder, + "Configuration.swift")); + supportingFiles.add(new SupportingFile("Extensions.mustache", + sourceFolder, + "Extensions.swift")); + supportingFiles.add(new SupportingFile("Models.mustache", + sourceFolder, + "Models.swift")); + supportingFiles.add(new SupportingFile("APIs.mustache", + sourceFolder, + "APIs.swift")); + supportingFiles.add(new SupportingFile("CodableHelper.mustache", + sourceFolder, + "CodableHelper.swift")); + supportingFiles.add(new SupportingFile("JSONEncodableEncoding.mustache", + sourceFolder, + "JSONEncodableEncoding.swift")); + supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache", + sourceFolder, + "JSONEncodingHelper.swift")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", + "", + "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore.mustache", + "", + ".gitignore")); } @@ -264,7 +331,7 @@ protected boolean isReservedWord(String word) { @Override public String escapeReservedWord(String name) { - if(this.reservedWordsMappings().containsKey(name)) { + if (this.reservedWordsMappings().containsKey(name)) { return this.reservedWordsMappings().get(name); } return "_" + name; // add an underscore to the name @@ -272,38 +339,42 @@ public String escapeReservedWord(String name) { @Override public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + modelPackage().replace('.', File.separatorChar); + return outputFolder + File.separator + sourceFolder + + modelPackage().replace('.', File.separatorChar); } @Override public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + apiPackage().replace('.', File.separatorChar); + return outputFolder + File.separator + sourceFolder + + apiPackage().replace('.', File.separatorChar); } @Override - public String getTypeDeclaration(Property p) { - if (p instanceof ArrayProperty) { - ArrayProperty ap = (ArrayProperty) p; + public String getTypeDeclaration(Property prop) { + if (prop instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) prop; Property inner = ap.getItems(); return "[" + getTypeDeclaration(inner) + "]"; - } else if (p instanceof MapProperty) { - MapProperty mp = (MapProperty) p; + } else if (prop instanceof MapProperty) { + MapProperty mp = (MapProperty) prop; Property inner = mp.getAdditionalProperties(); return "[String:" + getTypeDeclaration(inner) + "]"; } - return super.getTypeDeclaration(p); + return super.getTypeDeclaration(prop); } @Override - public String getSwaggerType(Property p) { - String swaggerType = super.getSwaggerType(p); + public String getSwaggerType(Property prop) { + String swaggerType = super.getSwaggerType(prop); String type; if (typeMapping.containsKey(swaggerType)) { type = typeMapping.get(swaggerType); - if (languageSpecificPrimitives.contains(type) || defaultIncludes.contains(type)) + if (languageSpecificPrimitives.contains(type) || defaultIncludes.contains(type)) { return type; - } else + } + } else { type = swaggerType; + } return toModelName(type); } @@ -318,14 +389,15 @@ public boolean isDataTypeBinary(final String dataType) { } /** - * Output the proper model name (capitalized) + * Output the proper model name (capitalized). * * @param name the name of the model * @return capitalized model name */ @Override public String toModelName(String name) { - name = sanitizeName(name); // FIXME parameter should not be assigned. Also declare it as "final" + // FIXME parameter should not be assigned. Also declare it as "final" + name = sanitizeName(name); if (!StringUtils.isEmpty(modelNameSuffix)) { // set model suffix name = name + "_" + modelNameSuffix; @@ -342,14 +414,18 @@ public String toModelName(String name) { // model name cannot use reserved keyword, e.g. return if (isReservedWord(name)) { String modelName = "Model" + name; - LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + + modelName); return modelName; } // model name starts with number if (name.matches("^\\d.*")) { - String modelName = "Model" + name; // e.g. 200Response => Model200Response (after camelize) - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); + // e.g. 200Response => Model200Response (after camelize) + String modelName = "Model" + name; + LOGGER.warn(name + + " (model name starts with number) cannot be used as model name." + + " Renamed to " + modelName); return modelName; } @@ -357,7 +433,7 @@ public String toModelName(String name) { } /** - * Return the capitalized file name of the model + * Return the capitalized file name of the model. * * @param name the model name * @return the file name of the model @@ -369,19 +445,19 @@ public String toModelFilename(String name) { } @Override - public String toDefaultValue(Property p) { + public String toDefaultValue(Property prop) { // nil return null; } @Override - public String toInstantiationType(Property p) { - if (p instanceof MapProperty) { - MapProperty ap = (MapProperty) p; + public String toInstantiationType(Property prop) { + if (prop instanceof MapProperty) { + MapProperty ap = (MapProperty) prop; String inner = getSwaggerType(ap.getAdditionalProperties()); return inner; - } else if (p instanceof ArrayProperty) { - ArrayProperty ap = (ArrayProperty) p; + } else if (prop instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) prop; String inner = getSwaggerType(ap.getItems()); return "[" + inner + "]"; } @@ -390,8 +466,9 @@ public String toInstantiationType(Property p) { @Override public String toApiName(String name) { - if (name.length() == 0) + if (name.length() == 0) { return "DefaultAPI"; + } return initialCaps(name) + "API"; } @@ -399,7 +476,8 @@ public String toApiName(String name) { public String toOperationId(String operationId) { operationId = camelize(sanitizeName(operationId), true); - // throw exception if method name is empty. This should not happen but keep the check just in case + // Throw exception if method name is empty. + // This should not happen but keep the check just in case if (StringUtils.isEmpty(operationId)) { throw new RuntimeException("Empty method name (operationId) not allowed"); } @@ -407,7 +485,8 @@ public String toOperationId(String operationId) { // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { String newOperationId = camelize(("call_" + operationId), true); - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId); + LOGGER.warn(operationId + " (reserved word) cannot be used as method name." + + " Renamed to " + newOperationId); return newOperationId; } @@ -464,21 +543,23 @@ public String toParamName(String name) { @Override public CodegenModel fromModel(String name, Model model, Map allDefinitions) { CodegenModel codegenModel = super.fromModel(name, model, allDefinitions); - if(codegenModel.description != null) { + if (codegenModel.description != null) { codegenModel.imports.add("ApiModel"); } if (allDefinitions != null) { - String parentSchema = codegenModel.parentSchema; - - // multilevel inheritance: reconcile properties of all the parents - while (parentSchema != null) { - final Model parentModel = allDefinitions.get(parentSchema); - final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel, allDefinitions); - codegenModel = Swift4Codegen.reconcileProperties(codegenModel, parentCodegenModel); - - // get the next parent - parentSchema = parentCodegenModel.parentSchema; - } + String parentSchema = codegenModel.parentSchema; + + // multilevel inheritance: reconcile properties of all the parents + while (parentSchema != null) { + final Model parentModel = allDefinitions.get(parentSchema); + final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, + parentModel, + allDefinitions); + codegenModel = Swift4Codegen.reconcileProperties(codegenModel, parentCodegenModel); + + // get the next parent + parentSchema = parentCodegenModel.parentSchema; + } } return codegenModel; @@ -552,8 +633,8 @@ public String toEnumVarName(String name, String datatype) { } // Check for numerical conversions - if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) || - "Float".equals(datatype) || "Double".equals(datatype)) { + if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) + || "Float".equals(datatype) || "Double".equals(datatype)) { String varName = "number" + camelize(name); varName = varName.replaceAll("-", "minus"); varName = varName.replaceAll("\\+", "plus"); @@ -568,7 +649,9 @@ public String toEnumVarName(String name, String datatype) { } char[] separators = {'-', '_', ' ', ':', '(', ')'}; - return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators).replaceAll("[-_ :\\(\\)]", ""), true); + return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) + .replaceAll("[-_ :\\(\\)]", ""), + true); } @Override @@ -578,11 +661,13 @@ public String toEnumName(CodegenProperty property) { // Ensure that the enum type doesn't match a reserved word or // the variable name doesn't match the generated enum type or the // Swift compiler will generate an error - if (isReservedWord(property.datatypeWithEnum) || toVarName(property.name).equals(property.datatypeWithEnum)) { + if (isReservedWord(property.datatypeWithEnum) + || toVarName(property.name).equals(property.datatypeWithEnum)) { enumName = property.datatypeWithEnum + "Enum"; } - // TODO: toModelName already does something for names starting with number, so this code is probably never called + // TODO: toModelName already does something for names starting with number, + // so this code is probably never called if (enumName.matches("\\d.*")) { // starts with number return "_" + enumName; } else { @@ -600,9 +685,11 @@ public Map postProcessModels(Map objs) { public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); - // The default template code has the following logic for assigning a type as Swift Optional: + // The default template code has the following logic for + // assigning a type as Swift Optional: // - // {{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}} + // {{^unwrapRequired}}?{{/unwrapRequired}} + // {{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}} // // which means: // @@ -611,7 +698,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // We can drop the check for unwrapRequired in (unwrapRequired && !property.required) // due to short-circuit evaluation of the || operator. boolean isSwiftOptional = !unwrapRequired || !property.required; - boolean isSwiftScalarType = property.isInteger || property.isLong || property.isFloat || property.isDouble || property.isBoolean; + boolean isSwiftScalarType = property.isInteger || property.isLong || property.isFloat + || property.isDouble || property.isBoolean; if (isSwiftOptional && isSwiftScalarType) { // Optional scalar types like Int?, Int64?, Float?, Double?, and Bool? // do not translate to Objective-C. So we want to flag those @@ -632,11 +720,13 @@ public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } - private static CodegenModel reconcileProperties(CodegenModel codegenModel, CodegenModel parentCodegenModel) { + private static CodegenModel reconcileProperties(CodegenModel codegenModel, + CodegenModel parentCodegenModel) { // To support inheritance in this generator, we will analyze // the parent and child models, look for properties that match, and remove // them from the child models and leave them in the parent. - // Because the child models extend the parents, the properties will be available via the parent. + // Because the child models extend the parents, the properties + // will be available via the parent. // Get the properties for the parent and child models final List parentModelCodegenProperties = parentCodegenModel.vars; @@ -648,24 +738,25 @@ private static CodegenModel reconcileProperties(CodegenModel codegenModel, Codeg boolean removedChildProperty = false; for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) { - // Now that we have found a prop in the parent class, - // and search the child class for the same prop. - Iterator iterator = codegenProperties.iterator(); - while (iterator.hasNext()) { - CodegenProperty codegenProperty = iterator.next(); - if (codegenProperty.baseName == parentModelCodegenProperty.baseName) { - // We found a property in the child class that is - // a duplicate of the one in the parent, so remove it. - iterator.remove(); - removedChildProperty = true; - } - } - } - - if(removedChildProperty) { + // Now that we have found a prop in the parent class, + // and search the child class for the same prop. + Iterator iterator = codegenProperties.iterator(); + while (iterator.hasNext()) { + CodegenProperty codegenProperty = iterator.next(); + if (codegenProperty.baseName == parentModelCodegenProperty.baseName) { + // We found a property in the child class that is + // a duplicate of the one in the parent, so remove it. + iterator.remove(); + removedChildProperty = true; + } + } + } + + if (removedChildProperty) { // If we removed an entry from this model's vars, we need to ensure hasMore is updated - int count = 0, numVars = codegenProperties.size(); - for(CodegenProperty codegenProperty : codegenProperties) { + int count = 0; + int numVars = codegenProperties.size(); + for (CodegenProperty codegenProperty : codegenProperties) { count += 1; codegenProperty.hasMore = (count < numVars) ? true : false; } From 65d788396b7e92ae26766e29e10d01c79d44aee0 Mon Sep 17 00:00:00 2001 From: Larry Bordowitz Date: Mon, 18 Sep 2017 19:11:38 -0700 Subject: [PATCH 031/197] [6313] Add imports to perl objects. (#6500) --- .../src/main/resources/perl/object.mustache | 4 + .../petstore-security-test/perl/README.md | 24 +-- .../perl/deep_module_test/README.md | 24 +-- .../perl/deep_module_test/docs/FakeApi.md | 4 +- .../lib/Something/Deep/ApiClient.pm | 33 ++-- .../lib/Something/Deep/ApiFactory.pm | 27 ++-- .../lib/Something/Deep/Configuration.pm | 141 +++++++++++++----- .../lib/Something/Deep/FakeApi.pm | 23 ++- .../lib/Something/Deep/Object/ModelReturn.pm | 1 + .../lib/Something/Deep/Role.pm | 23 ++- .../perl/docs/FakeApi.md | 4 +- .../perl/lib/WWW/SwaggerClient/ApiClient.pm | 33 ++-- .../perl/lib/WWW/SwaggerClient/ApiFactory.pm | 27 ++-- .../lib/WWW/SwaggerClient/Configuration.pm | 141 +++++++++++++----- .../perl/lib/WWW/SwaggerClient/FakeApi.pm | 23 ++- .../WWW/SwaggerClient/Object/ModelReturn.pm | 1 + .../perl/lib/WWW/SwaggerClient/Role.pm | 23 ++- .../petstore/perl/.swagger-codegen/VERSION | 2 +- samples/client/petstore/perl/README.md | 10 ++ .../petstore/perl/docs/AnotherfakeApi.md | 60 ++++++++ samples/client/petstore/perl/docs/FakeApi.md | 50 ++++++- .../perl/docs/FakeClassnameTags123Api.md | 7 +- .../lib/WWW/SwaggerClient/AnotherfakeApi.pm | 116 ++++++++++++++ .../perl/lib/WWW/SwaggerClient/ApiClient.pm | 7 + .../perl/lib/WWW/SwaggerClient/FakeApi.pm | 77 ++++++++++ .../SwaggerClient/FakeClassnameTags123Api.pm | 2 +- .../Object/AdditionalPropertiesClass.pm | 1 + .../lib/WWW/SwaggerClient/Object/Animal.pm | 1 + .../WWW/SwaggerClient/Object/AnimalFarm.pm | 2 + .../WWW/SwaggerClient/Object/ApiResponse.pm | 1 + .../Object/ArrayOfArrayOfNumberOnly.pm | 2 + .../SwaggerClient/Object/ArrayOfNumberOnly.pm | 2 + .../lib/WWW/SwaggerClient/Object/ArrayTest.pm | 2 + .../SwaggerClient/Object/Capitalization.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/Cat.pm | 2 + .../lib/WWW/SwaggerClient/Object/Category.pm | 1 + .../WWW/SwaggerClient/Object/ClassModel.pm | 1 + .../lib/WWW/SwaggerClient/Object/Client.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/Dog.pm | 2 + .../WWW/SwaggerClient/Object/EnumArrays.pm | 1 + .../lib/WWW/SwaggerClient/Object/EnumClass.pm | 1 + .../lib/WWW/SwaggerClient/Object/EnumTest.pm | 2 + .../WWW/SwaggerClient/Object/FormatTest.pm | 3 + .../SwaggerClient/Object/HasOnlyReadOnly.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/List.pm | 1 + .../lib/WWW/SwaggerClient/Object/MapTest.pm | 1 + ...dPropertiesAndAdditionalPropertiesClass.pm | 3 + .../SwaggerClient/Object/Model200Response.pm | 1 + .../WWW/SwaggerClient/Object/ModelReturn.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/Name.pm | 1 + .../WWW/SwaggerClient/Object/NumberOnly.pm | 2 + .../lib/WWW/SwaggerClient/Object/Order.pm | 1 + .../WWW/SwaggerClient/Object/OuterBoolean.pm | 1 + .../SwaggerClient/Object/OuterComposite.pm | 4 + .../lib/WWW/SwaggerClient/Object/OuterEnum.pm | 1 + .../WWW/SwaggerClient/Object/OuterNumber.pm | 1 + .../WWW/SwaggerClient/Object/OuterString.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/Pet.pm | 3 + .../WWW/SwaggerClient/Object/ReadOnlyFirst.pm | 1 + .../SwaggerClient/Object/SpecialModelName.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/Tag.pm | 1 + .../perl/lib/WWW/SwaggerClient/Object/User.pm | 1 + .../petstore/perl/t/AnotherfakeApiTest.t | 41 +++++ 63 files changed, 781 insertions(+), 200 deletions(-) create mode 100644 samples/client/petstore/perl/docs/AnotherfakeApi.md create mode 100644 samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm create mode 100644 samples/client/petstore/perl/t/AnotherfakeApiTest.t diff --git a/modules/swagger-codegen/src/main/resources/perl/object.mustache b/modules/swagger-codegen/src/main/resources/perl/object.mustache index bb19479c61d..d5d8fdd8f40 100644 --- a/modules/swagger-codegen/src/main/resources/perl/object.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/object.mustache @@ -19,6 +19,10 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +{{#imports}} +use {{moduleName}}::Object::{{.}}; +{{/imports}} + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore-security-test/perl/README.md b/samples/client/petstore-security-test/perl/README.md index 18e4b925509..c60bcf8bc30 100644 --- a/samples/client/petstore-security-test/perl/README.md +++ b/samples/client/petstore-security-test/perl/README.md @@ -88,37 +88,37 @@ you are accessing. Usually `prefix` and `in` will be determined by the code gene the spec and you will not need to set them at run time. If not, `in` will default to 'head' and `prefix` to the empty string. -The tokens will be placed in the `WWW::SwaggerClient::Configuration` namespace +The tokens will be placed in a L instance as follows, but you don't need to know about this. -- `$WWW::SwaggerClient::Configuration::username` +- `$cfg->{username}` String. The username for basic auth. -- `$WWW::SwaggerClient::Configuration::password` +- `$cfg->{password}` String. The password for basic auth. -- `$WWW::SwaggerClient::Configuration::api_key` +- `$cfg->{api_key}` Hashref. Keyed on the name of each key (there can be multiple tokens). - $WWW::SwaggerClient::Configuration::api_key = { + $cfg->{api_key} = { secretKey => 'aaaabbbbccccdddd', anotherKey => '1111222233334444', }; -- `$WWW::SwaggerClient::Configuration::api_key_prefix` +- `$cfg->{api_key_prefix}` Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. - $WWW::SwaggerClient::Configuration::api_key_prefix = { + $cfg->{api_key_prefix} = { secretKey => 'string', anotherKey => 'same or some other string', }; -- `$WWW::SwaggerClient::Configuration::access_token` +- `$cfg->{access_token}` String. The OAuth access token. @@ -127,8 +127,7 @@ as follows, but you don't need to know about this. ## `base_url` The generated code has the `base_url` already set as a default value. This method -returns (and optionally sets, but only if the API client has not been -created yet) the current value of `base_url`. +returns the current value of `base_url`. ## `api_factory` @@ -247,10 +246,11 @@ use WWW::SwaggerClient::Object::ModelReturn; # for displaying the API response data use Data::Dumper; -use WWW::SwaggerClient::Configuration; use WWW::SwaggerClient::; -my $api_instance = WWW::SwaggerClient::FakeApi->new(); +my $api_instance = WWW::SwaggerClient::->new( +); + my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { diff --git a/samples/client/petstore-security-test/perl/deep_module_test/README.md b/samples/client/petstore-security-test/perl/deep_module_test/README.md index 148bc2cf017..dfbd75f4abc 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/README.md +++ b/samples/client/petstore-security-test/perl/deep_module_test/README.md @@ -88,37 +88,37 @@ you are accessing. Usually `prefix` and `in` will be determined by the code gene the spec and you will not need to set them at run time. If not, `in` will default to 'head' and `prefix` to the empty string. -The tokens will be placed in the `Something::Deep::Configuration` namespace +The tokens will be placed in a L instance as follows, but you don't need to know about this. -- `$Something::Deep::Configuration::username` +- `$cfg->{username}` String. The username for basic auth. -- `$Something::Deep::Configuration::password` +- `$cfg->{password}` String. The password for basic auth. -- `$Something::Deep::Configuration::api_key` +- `$cfg->{api_key}` Hashref. Keyed on the name of each key (there can be multiple tokens). - $Something::Deep::Configuration::api_key = { + $cfg->{api_key} = { secretKey => 'aaaabbbbccccdddd', anotherKey => '1111222233334444', }; -- `$Something::Deep::Configuration::api_key_prefix` +- `$cfg->{api_key_prefix}` Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. - $Something::Deep::Configuration::api_key_prefix = { + $cfg->{api_key_prefix} = { secretKey => 'string', anotherKey => 'same or some other string', }; -- `$Something::Deep::Configuration::access_token` +- `$cfg->{access_token}` String. The OAuth access token. @@ -127,8 +127,7 @@ as follows, but you don't need to know about this. ## `base_url` The generated code has the `base_url` already set as a default value. This method -returns (and optionally sets, but only if the API client has not been -created yet) the current value of `base_url`. +returns the current value of `base_url`. ## `api_factory` @@ -247,10 +246,11 @@ use Something::Deep::Object::ModelReturn; # for displaying the API response data use Data::Dumper; -use Something::Deep::Configuration; use Something::Deep::; -my $api_instance = Something::Deep::FakeApi->new(); +my $api_instance = Something::Deep::->new( +); + my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { diff --git a/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md b/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md index ec4678ea49c..35f56434164 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md +++ b/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md @@ -20,10 +20,10 @@ To test code injection */ ' \" =_end -- \\r\\n \\n \\r ### Example ```perl use Data::Dumper; -use Something::Deep::Configuration; use Something::Deep::FakeApi; +my $api_instance = Something::Deep::FakeApi->new( +); -my $api_instance = Something::Deep::FakeApi->new(); my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiClient.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiClient.pm index 205df200d63..91025c6df55 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiClient.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiClient.pm @@ -39,22 +39,25 @@ use Module::Runtime qw(use_module); use Something::Deep::Configuration; -use base 'Class::Singleton'; -sub _new_instance -{ +sub new { my $class = shift; + + my $config; + if ( $_[0] && ref $_[0] && ref $_[0] eq 'Something::Deep::Configuration' ) { + $config = $_[0]; + } else { + $config = Something::Deep::Configuration->new(@_); + } + my (%args) = ( 'ua' => LWP::UserAgent->new, - 'base_url' => 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r', - @_ + 'config' => $config, ); return bless \%args, $class; } -sub _cfg {'Something::Deep::Configuration'} - # Set the user agent of the API client # # @param string $user_agent The user agent of the API client @@ -91,7 +94,7 @@ sub call_api { $self->update_params_for_auth($header_params, $query_params, $auth_settings); - my $_url = $self->{base_url} . $resource_path; + my $_url = $self->{config}{base_url} . $resource_path; # build query if (%$query_params) { @@ -138,8 +141,8 @@ sub call_api { else { } - $self->{ua}->timeout($self->{http_timeout} || $Something::Deep::Configuration::http_timeout); - $self->{ua}->agent($self->{http_user_agent} || $Something::Deep::Configuration::http_user_agent); + $self->{ua}->timeout($self->{http_timeout} || $self->{config}{http_timeout}); + $self->{ua}->agent($self->{http_user_agent} || $self->{config}{http_user_agent}); $log->debugf("REQUEST: %s", $_request->as_string); my $_response = $self->{ua}->request($_request); @@ -313,11 +316,11 @@ sub get_api_key_with_prefix { my ($self, $key_name) = @_; - my $api_key = $Something::Deep::Configuration::api_key->{$key_name}; + my $api_key = $self->{config}{api_key}{$key_name}; return unless $api_key; - my $prefix = $Something::Deep::Configuration::api_key_prefix->{$key_name}; + my $prefix = $self->{config}{api_key_prefix}{$key_name}; return $prefix ? "$prefix $api_key" : $api_key; } @@ -347,8 +350,8 @@ sub update_params_for_auth { } elsif ($auth eq 'petstore_auth') { - if ($Something::Deep::Configuration::access_token) { - $header_params->{'Authorization'} = 'Bearer ' . $Something::Deep::Configuration::access_token; + if ($self->{config}{access_token}) { + $header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token}; } } else { @@ -364,7 +367,7 @@ elsif ($auth eq 'petstore_auth') { sub _global_auth_setup { my ($self, $header_params, $query_params) = @_; - my $tokens = $self->_cfg->get_tokens; + my $tokens = $self->{config}->get_tokens; return unless keys %$tokens; # basic diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiFactory.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiFactory.pm index 39a23aa2a80..c75b5daeac9 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiFactory.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/ApiFactory.pm @@ -62,19 +62,28 @@ my %_apis = map { $_ =~ /^Something::Deep::(.*)$/; $1 => $_ } grep {$_ =~ /Api$/} usesub 'Something::Deep'; -=head1 new() +=head1 new($api_client) - Any parameters are optional, and are passed to and stored on the api_client object. - - base_url: (optional) - supply this to change the default base URL taken from the Swagger definition. + create a new Something::Deep::ApiFactory instance with the given Something::Deep::ApiClient instance. + +=head1 new(%paramters) + + Any parameters are optional, and are passed to and stored on the api_client object. + See L and L for valid paramters + =cut sub new { - my ($class, %p) = (shift, @_); - $p{api_client} = Something::Deep::ApiClient->instance(%p); - return bless \%p, $class; + my ($class) = shift; + + my $api_client; + if ($_[0] && ref $_[0] && ref $_[0] eq 'Something::Deep::ApiClient' ) { + $api_client = $_[0]; + } else { + $api_client = Something::Deep::ApiClient->new(@_); + } + bless { api_client => $api_client }, $class; } =head1 get_api($which) @@ -91,7 +100,7 @@ sub get_api { my ($self, $which) = @_; croak "API not specified" unless $which; my $api_class = $_apis{"${which}Api"} || croak "No known API for '$which'"; - return $api_class->new(api_client => $self->api_client); + return $api_class->new($self->api_client); } =head1 api_client() diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Configuration.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Configuration.pm index 559fcce8e4f..b903af61ea6 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Configuration.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Configuration.pm @@ -28,71 +28,142 @@ use Carp; use constant VERSION => '1.0.0'; -# class/static variables -our $http_timeout = 180; -our $http_user_agent = 'Swagger-Codegen/1.0.0/perl'; +=head1 Name -# authentication setting -our $api_key = {}; -our $api_key_prefix = {}; -our $api_key_in = {}; + Something::Deep::Configuration - holds the configuration for all Something::Deep Modules -# username and password for HTTP basic authentication -our $username = ''; -our $password = ''; +=head1 new(%paramters) + +=over 4 + +=item http_timeout: (optional) + +Integer. timeout for HTTP requests in seconds + +default: 180 + +=item http_user_agent: (optional) + +String. custom UserAgent header + +default: Swagger-Codegen/1.0.0/perl + +=item api_key: (optional) + +Hashref. Keyed on the name of each key (there can be multiple tokens). + + api_key => { + secretKey => 'aaaabbbbccccdddd', + anotherKey => '1111222233334444', + }; + +=item api_key_prefix: (optional) + +Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. + + api_key_prefix => { + secretKey => 'string', + anotherKey => 'same or some other string', + }; + +=item api_key_in: (optional) + +=item username: (optional) + +String. The username for basic auth. + +=item password: (optional) + +String. The password for basic auth. + +=item access_token: (optional) + +String. The OAuth access token. + +=item base_url: (optional) + +String. The base URL of the API + +default: https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r + +=back + +=cut + +sub new { + my ($self, %p) = (shift,@_); + + # class/static variables + $p{http_timeout} //= 180; + $p{http_user_agent} //= 'Swagger-Codegen/1.0.0/perl'; + + # authentication setting + $p{api_key} //= {}; + $p{api_key_prefix} //= {}; + $p{api_key_in} //= {}; + + # username and password for HTTP basic authentication + $p{username} //= ''; + $p{password} //= ''; + + # access token for OAuth + $p{access_token} //= ''; + + # base_url + $p{base_url} //= 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r'; + + return bless \%p => $self; +} -# access token for OAuth -our $access_token = ''; sub get_tokens { - my $class = shift; + my $self = shift; my $tokens = {}; - $tokens->{username} = $username if $username; - $tokens->{password} = $password if $password; - $tokens->{access_token} = $access_token if $access_token; + $tokens->{username} = $self->{username} if $self->{username}; + $tokens->{password} = $self->{password} if $self->{password}; + $tokens->{access_token} = $self->{access_token} if $self->{access_token}; - foreach my $token_name (keys %{ $api_key }) { - $tokens->{$token_name}->{token} = $api_key->{$token_name}; - $tokens->{$token_name}->{prefix} = $api_key_prefix->{$token_name}; - $tokens->{$token_name}->{in} = $api_key_in->{$token_name}; + foreach my $token_name (keys %{ $self->{api_key} }) { + $tokens->{$token_name}->{token} = $self->{api_key}{$token_name}; + $tokens->{$token_name}->{prefix} = $self->{api_key_prefix}{$token_name}; + $tokens->{$token_name}->{in} = $self->{api_key_in}{$token_name}; } return $tokens; } sub clear_tokens { - my $class = shift; - my %tokens = %{$class->get_tokens}; # copy + my $self = shift; + my %tokens = %{$self->get_tokens}; # copy - $username = undef; - $password = undef; - $access_token = undef; + $self->{username} = ''; + $self->{password} = ''; + $self->{access_token} = ''; - $api_key = {}; - $api_key_prefix = {}; - $api_key_in = {}; + $self->{api_key} = {}; + $self->{api_key_prefix} = {}; + $self->{api_key_in} = {}; return \%tokens; } sub accept_tokens { - my ($class, $tokens) = @_; + my ($self, $tokens) = @_; foreach my $known_name (qw(username password access_token)) { next unless $tokens->{$known_name}; - eval "\$$known_name = delete \$tokens->{\$known_name}"; - die $@ if $@; + $self->{$known_name} = delete $tokens->{$known_name}; } foreach my $token_name (keys %$tokens) { - $api_key->{$token_name} = $tokens->{$token_name}->{token}; - if ($tokens->{$token_name}->{prefix}) { - $api_key_prefix->{$token_name} = $tokens->{$token_name}->{prefix}; + $self->{api_key}{$token_name} = $tokens->{$token_name}{token}; + if ($tokens->{$token_name}{prefix}) { + $self->{api_key_prefix}{$token_name} = $tokens->{$token_name}{prefix}; } my $in = $tokens->{$token_name}->{in} || 'head'; croak "Tokens can only go in 'head' or 'query' (not in '$in')" unless $in =~ /^(?:head|query)$/; - $api_key_in->{$token_name} = $in; + $self->{api_key_in}{$token_name} = $in; } } diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm index ca16c6f21fd..33c0f7b3936 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm @@ -28,25 +28,22 @@ use Carp qw( croak ); use Log::Any qw($log); use Something::Deep::ApiClient; -use Something::Deep::Configuration; use base "Class::Data::Inheritable"; __PACKAGE__->mk_classdata('method_documentation' => {}); sub new { - my $class = shift; - my (%self) = ( - 'api_client' => Something::Deep::ApiClient->instance, - @_ - ); - - #my $self = { - # #api_client => $options->{api_client} - # api_client => $default_api_client - #}; - - bless \%self, $class; + my $class = shift; + my $api_client; + + if ($_[0] && ref $_[0] && ref $_[0] eq 'Something::Deep::ApiClient' ) { + $api_client = $_[0]; + } else { + $api_client = Something::Deep::ApiClient->new(@_); + } + + bless { api_client => $api_client }, $class; } diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Object/ModelReturn.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Object/ModelReturn.pm index 4e42c5e0698..248a672c60e 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Object/ModelReturn.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Object/ModelReturn.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Role.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Role.pm index 5723472b1cc..f82a7808f6f 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Role.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/Role.pm @@ -47,8 +47,8 @@ has tokens => ( is => 'ro', ); has _cfg => ( is => 'ro', - isa => 'Str', - default => 'Something::Deep::Configuration', + isa => 'Something::Deep::Configuration', + default => sub { Something::Deep::Configuration->new() }, ); has version_info => ( is => 'ro', @@ -201,39 +201,39 @@ you are accessing. Usually C and C will be determined by the code ge the spec and you will not need to set them at run time. If not, C will default to 'head' and C to the empty string. -The tokens will be placed in the C namespace +The tokens will be placed in a L instance as follows, but you don't need to know about this. =over 4 -=item C<$Something::Deep::Configuration::username> +=item C<$cfg-\>{username}> String. The username for basic auth. -=item C<$Something::Deep::Configuration::password> +=item C<$cfg-\>{password}> String. The password for basic auth. -=item C<$Something::Deep::Configuration::api_key> +=item C<$cfg-\>{api_key}> Hashref. Keyed on the name of each key (there can be multiple tokens). - $Something::Deep::Configuration::api_key = { + $cfg->{api_key} = { secretKey => 'aaaabbbbccccdddd', anotherKey => '1111222233334444', }; -=item C<$Something::Deep::Configuration::api_key_prefix> +=item C<$cfg->{api_key_prefix}> Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. - $Something::Deep::Configuration::api_key_prefix = { + $cfg->{api_key_prefix} = { secretKey => 'string', anotherKey => 'same or some other string', }; -=item C<$Something::Deep::Configuration::access_token> +=item C<$config-\>{access_token}> String. The OAuth access token. @@ -244,8 +244,7 @@ String. The OAuth access token. =head2 C The generated code has the C already set as a default value. This method -returns (and optionally sets, but only if the API client has not been -created yet) the current value of C. +returns the current value of C. =head2 C diff --git a/samples/client/petstore-security-test/perl/docs/FakeApi.md b/samples/client/petstore-security-test/perl/docs/FakeApi.md index 7caee1454f1..fbea6c1fc8d 100644 --- a/samples/client/petstore-security-test/perl/docs/FakeApi.md +++ b/samples/client/petstore-security-test/perl/docs/FakeApi.md @@ -20,10 +20,10 @@ To test code injection */ ' \" =_end -- \\r\\n \\n \\r ### Example ```perl use Data::Dumper; -use WWW::SwaggerClient::Configuration; use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); -my $api_instance = WWW::SwaggerClient::FakeApi->new(); my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiClient.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiClient.pm index 48770b587a7..1a3c23c1f7b 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiClient.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiClient.pm @@ -39,22 +39,25 @@ use Module::Runtime qw(use_module); use WWW::SwaggerClient::Configuration; -use base 'Class::Singleton'; -sub _new_instance -{ +sub new { my $class = shift; + + my $config; + if ( $_[0] && ref $_[0] && ref $_[0] eq 'WWW::SwaggerClient::Configuration' ) { + $config = $_[0]; + } else { + $config = WWW::SwaggerClient::Configuration->new(@_); + } + my (%args) = ( 'ua' => LWP::UserAgent->new, - 'base_url' => 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r', - @_ + 'config' => $config, ); return bless \%args, $class; } -sub _cfg {'WWW::SwaggerClient::Configuration'} - # Set the user agent of the API client # # @param string $user_agent The user agent of the API client @@ -91,7 +94,7 @@ sub call_api { $self->update_params_for_auth($header_params, $query_params, $auth_settings); - my $_url = $self->{base_url} . $resource_path; + my $_url = $self->{config}{base_url} . $resource_path; # build query if (%$query_params) { @@ -138,8 +141,8 @@ sub call_api { else { } - $self->{ua}->timeout($self->{http_timeout} || $WWW::SwaggerClient::Configuration::http_timeout); - $self->{ua}->agent($self->{http_user_agent} || $WWW::SwaggerClient::Configuration::http_user_agent); + $self->{ua}->timeout($self->{http_timeout} || $self->{config}{http_timeout}); + $self->{ua}->agent($self->{http_user_agent} || $self->{config}{http_user_agent}); $log->debugf("REQUEST: %s", $_request->as_string); my $_response = $self->{ua}->request($_request); @@ -313,11 +316,11 @@ sub get_api_key_with_prefix { my ($self, $key_name) = @_; - my $api_key = $WWW::SwaggerClient::Configuration::api_key->{$key_name}; + my $api_key = $self->{config}{api_key}{$key_name}; return unless $api_key; - my $prefix = $WWW::SwaggerClient::Configuration::api_key_prefix->{$key_name}; + my $prefix = $self->{config}{api_key_prefix}{$key_name}; return $prefix ? "$prefix $api_key" : $api_key; } @@ -347,8 +350,8 @@ sub update_params_for_auth { } elsif ($auth eq 'petstore_auth') { - if ($WWW::SwaggerClient::Configuration::access_token) { - $header_params->{'Authorization'} = 'Bearer ' . $WWW::SwaggerClient::Configuration::access_token; + if ($self->{config}{access_token}) { + $header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token}; } } else { @@ -364,7 +367,7 @@ elsif ($auth eq 'petstore_auth') { sub _global_auth_setup { my ($self, $header_params, $query_params) = @_; - my $tokens = $self->_cfg->get_tokens; + my $tokens = $self->{config}->get_tokens; return unless keys %$tokens; # basic diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiFactory.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiFactory.pm index 14d9027a554..96f68cbde1e 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiFactory.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/ApiFactory.pm @@ -62,19 +62,28 @@ my %_apis = map { $_ =~ /^WWW::SwaggerClient::(.*)$/; $1 => $_ } grep {$_ =~ /Api$/} usesub 'WWW::SwaggerClient'; -=head1 new() +=head1 new($api_client) - Any parameters are optional, and are passed to and stored on the api_client object. - - base_url: (optional) - supply this to change the default base URL taken from the Swagger definition. + create a new WWW::SwaggerClient::ApiFactory instance with the given WWW::SwaggerClient::ApiClient instance. + +=head1 new(%paramters) + + Any parameters are optional, and are passed to and stored on the api_client object. + See L and L for valid paramters + =cut sub new { - my ($class, %p) = (shift, @_); - $p{api_client} = WWW::SwaggerClient::ApiClient->instance(%p); - return bless \%p, $class; + my ($class) = shift; + + my $api_client; + if ($_[0] && ref $_[0] && ref $_[0] eq 'WWW::SwaggerClient::ApiClient' ) { + $api_client = $_[0]; + } else { + $api_client = WWW::SwaggerClient::ApiClient->new(@_); + } + bless { api_client => $api_client }, $class; } =head1 get_api($which) @@ -91,7 +100,7 @@ sub get_api { my ($self, $which) = @_; croak "API not specified" unless $which; my $api_class = $_apis{"${which}Api"} || croak "No known API for '$which'"; - return $api_class->new(api_client => $self->api_client); + return $api_class->new($self->api_client); } =head1 api_client() diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Configuration.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Configuration.pm index 61428f94280..488e608169f 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Configuration.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Configuration.pm @@ -28,71 +28,142 @@ use Carp; use constant VERSION => '1.0.0'; -# class/static variables -our $http_timeout = 180; -our $http_user_agent = 'Swagger-Codegen/1.0.0/perl'; +=head1 Name -# authentication setting -our $api_key = {}; -our $api_key_prefix = {}; -our $api_key_in = {}; + WWW::SwaggerClient::Configuration - holds the configuration for all WWW::SwaggerClient Modules -# username and password for HTTP basic authentication -our $username = ''; -our $password = ''; +=head1 new(%paramters) + +=over 4 + +=item http_timeout: (optional) + +Integer. timeout for HTTP requests in seconds + +default: 180 + +=item http_user_agent: (optional) + +String. custom UserAgent header + +default: Swagger-Codegen/1.0.0/perl + +=item api_key: (optional) + +Hashref. Keyed on the name of each key (there can be multiple tokens). + + api_key => { + secretKey => 'aaaabbbbccccdddd', + anotherKey => '1111222233334444', + }; + +=item api_key_prefix: (optional) + +Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. + + api_key_prefix => { + secretKey => 'string', + anotherKey => 'same or some other string', + }; + +=item api_key_in: (optional) + +=item username: (optional) + +String. The username for basic auth. + +=item password: (optional) + +String. The password for basic auth. + +=item access_token: (optional) + +String. The OAuth access token. + +=item base_url: (optional) + +String. The base URL of the API + +default: https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r + +=back + +=cut + +sub new { + my ($self, %p) = (shift,@_); + + # class/static variables + $p{http_timeout} //= 180; + $p{http_user_agent} //= 'Swagger-Codegen/1.0.0/perl'; + + # authentication setting + $p{api_key} //= {}; + $p{api_key_prefix} //= {}; + $p{api_key_in} //= {}; + + # username and password for HTTP basic authentication + $p{username} //= ''; + $p{password} //= ''; + + # access token for OAuth + $p{access_token} //= ''; + + # base_url + $p{base_url} //= 'https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r'; + + return bless \%p => $self; +} -# access token for OAuth -our $access_token = ''; sub get_tokens { - my $class = shift; + my $self = shift; my $tokens = {}; - $tokens->{username} = $username if $username; - $tokens->{password} = $password if $password; - $tokens->{access_token} = $access_token if $access_token; + $tokens->{username} = $self->{username} if $self->{username}; + $tokens->{password} = $self->{password} if $self->{password}; + $tokens->{access_token} = $self->{access_token} if $self->{access_token}; - foreach my $token_name (keys %{ $api_key }) { - $tokens->{$token_name}->{token} = $api_key->{$token_name}; - $tokens->{$token_name}->{prefix} = $api_key_prefix->{$token_name}; - $tokens->{$token_name}->{in} = $api_key_in->{$token_name}; + foreach my $token_name (keys %{ $self->{api_key} }) { + $tokens->{$token_name}->{token} = $self->{api_key}{$token_name}; + $tokens->{$token_name}->{prefix} = $self->{api_key_prefix}{$token_name}; + $tokens->{$token_name}->{in} = $self->{api_key_in}{$token_name}; } return $tokens; } sub clear_tokens { - my $class = shift; - my %tokens = %{$class->get_tokens}; # copy + my $self = shift; + my %tokens = %{$self->get_tokens}; # copy - $username = undef; - $password = undef; - $access_token = undef; + $self->{username} = ''; + $self->{password} = ''; + $self->{access_token} = ''; - $api_key = {}; - $api_key_prefix = {}; - $api_key_in = {}; + $self->{api_key} = {}; + $self->{api_key_prefix} = {}; + $self->{api_key_in} = {}; return \%tokens; } sub accept_tokens { - my ($class, $tokens) = @_; + my ($self, $tokens) = @_; foreach my $known_name (qw(username password access_token)) { next unless $tokens->{$known_name}; - eval "\$$known_name = delete \$tokens->{\$known_name}"; - die $@ if $@; + $self->{$known_name} = delete $tokens->{$known_name}; } foreach my $token_name (keys %$tokens) { - $api_key->{$token_name} = $tokens->{$token_name}->{token}; - if ($tokens->{$token_name}->{prefix}) { - $api_key_prefix->{$token_name} = $tokens->{$token_name}->{prefix}; + $self->{api_key}{$token_name} = $tokens->{$token_name}{token}; + if ($tokens->{$token_name}{prefix}) { + $self->{api_key_prefix}{$token_name} = $tokens->{$token_name}{prefix}; } my $in = $tokens->{$token_name}->{in} || 'head'; croak "Tokens can only go in 'head' or 'query' (not in '$in')" unless $in =~ /^(?:head|query)$/; - $api_key_in->{$token_name} = $in; + $self->{api_key_in}{$token_name} = $in; } } diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm index f8502625686..79318d9180b 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -28,25 +28,22 @@ use Carp qw( croak ); use Log::Any qw($log); use WWW::SwaggerClient::ApiClient; -use WWW::SwaggerClient::Configuration; use base "Class::Data::Inheritable"; __PACKAGE__->mk_classdata('method_documentation' => {}); sub new { - my $class = shift; - my (%self) = ( - 'api_client' => WWW::SwaggerClient::ApiClient->instance, - @_ - ); - - #my $self = { - # #api_client => $options->{api_client} - # api_client => $default_api_client - #}; - - bless \%self, $class; + my $class = shift; + my $api_client; + + if ($_[0] && ref $_[0] && ref $_[0] eq 'WWW::SwaggerClient::ApiClient' ) { + $api_client = $_[0]; + } else { + $api_client = WWW::SwaggerClient::ApiClient->new(@_); + } + + bless { api_client => $api_client }, $class; } diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm index c87fc7c970e..b58bee43fc6 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Role.pm index 100770cacfe..b04fa8d54bd 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/Role.pm @@ -47,8 +47,8 @@ has tokens => ( is => 'ro', ); has _cfg => ( is => 'ro', - isa => 'Str', - default => 'WWW::SwaggerClient::Configuration', + isa => 'WWW::SwaggerClient::Configuration', + default => sub { WWW::SwaggerClient::Configuration->new() }, ); has version_info => ( is => 'ro', @@ -201,39 +201,39 @@ you are accessing. Usually C and C will be determined by the code ge the spec and you will not need to set them at run time. If not, C will default to 'head' and C to the empty string. -The tokens will be placed in the C namespace +The tokens will be placed in a L instance as follows, but you don't need to know about this. =over 4 -=item C<$WWW::SwaggerClient::Configuration::username> +=item C<$cfg-\>{username}> String. The username for basic auth. -=item C<$WWW::SwaggerClient::Configuration::password> +=item C<$cfg-\>{password}> String. The password for basic auth. -=item C<$WWW::SwaggerClient::Configuration::api_key> +=item C<$cfg-\>{api_key}> Hashref. Keyed on the name of each key (there can be multiple tokens). - $WWW::SwaggerClient::Configuration::api_key = { + $cfg->{api_key} = { secretKey => 'aaaabbbbccccdddd', anotherKey => '1111222233334444', }; -=item C<$WWW::SwaggerClient::Configuration::api_key_prefix> +=item C<$cfg->{api_key_prefix}> Hashref. Keyed on the name of each key (there can be multiple tokens). Note not all api keys require a prefix. - $WWW::SwaggerClient::Configuration::api_key_prefix = { + $cfg->{api_key_prefix} = { secretKey => 'string', anotherKey => 'same or some other string', }; -=item C<$WWW::SwaggerClient::Configuration::access_token> +=item C<$config-\>{access_token}> String. The OAuth access token. @@ -244,8 +244,7 @@ String. The OAuth access token. =head2 C The generated code has the C already set as a default value. This method -returns (and optionally sets, but only if the API client has not been -created yet) the current value of C. +returns the current value of C. =head2 C diff --git a/samples/client/petstore/perl/.swagger-codegen/VERSION b/samples/client/petstore/perl/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/perl/.swagger-codegen/VERSION +++ b/samples/client/petstore/perl/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 2a404df51e8..32e5e359b1d 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -226,6 +226,7 @@ use WWW::SwaggerClient::FakeClassnameTags123Api; use WWW::SwaggerClient::PetApi; use WWW::SwaggerClient::StoreApi; use WWW::SwaggerClient::UserApi; +use WWW::SwaggerClient::AnotherfakeApi; ``` @@ -283,6 +284,7 @@ use WWW::SwaggerClient::FakeClassnameTags123Api; use WWW::SwaggerClient::PetApi; use WWW::SwaggerClient::StoreApi; use WWW::SwaggerClient::UserApi; +use WWW::SwaggerClient::AnotherfakeApi; # load the models use WWW::SwaggerClient::Object::AdditionalPropertiesClass; @@ -354,6 +356,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet @@ -375,6 +378,7 @@ Class | Method | HTTP request | Description *UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system *UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user +*AnotherfakeApi* | [**test_special_tags**](docs/AnotherfakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags # DOCUMENTATION FOR MODELS @@ -424,6 +428,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/perl/docs/AnotherfakeApi.md b/samples/client/petstore/perl/docs/AnotherfakeApi.md new file mode 100644 index 00000000000..29a06be2e94 --- /dev/null +++ b/samples/client/petstore/perl/docs/AnotherfakeApi.md @@ -0,0 +1,60 @@ +# WWW::SwaggerClient::AnotherfakeApi + +## Load the API package +```perl +use WWW::SwaggerClient::Object::AnotherfakeApi; +``` + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherfakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **test_special_tags** +> Client test_special_tags(body => $body) + +To test special tags + +To test special tags + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::AnotherfakeApi; +my $api_instance = WWW::SwaggerClient::AnotherfakeApi->new( +); + +my $body = WWW::SwaggerClient::Object::Client->new(); # Client | client model + +eval { + my $result = $api_instance->test_special_tags(body => $body); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling AnotherfakeApi->test_special_tags: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 3449f1e7aca..2ac74f17f5d 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data # **fake_outer_boolean_serialize** @@ -269,7 +270,7 @@ my $api_instance = WWW::SwaggerClient::FakeApi->new( my $number = 3.4; # Number | None my $double = 1.2; # double | None my $pattern_without_delimiter = 'pattern_without_delimiter_example'; # string | None -my $byte = 'B'; # string | None +my $byte = 'byte_example'; # string | None my $integer = 56; # int | None my $int32 = 56; # int | None my $int64 = 789; # int | None @@ -382,3 +383,50 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_json_form_data** +> test_json_form_data(param => $param, param2 => $param2) + +test json serialization of form data + + + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); + +my $param = 'param_example'; # string | field1 +my $param2 = 'param2_example'; # string | field2 + +eval { + $api_instance->test_json_form_data(param => $param, param2 => $param2); +}; +if ($@) { + warn "Exception when calling FakeApi->test_json_form_data: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **string**| field1 | + **param2** | **string**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md b/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md index b9e2893026f..ae6da4daf6c 100644 --- a/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/perl/docs/FakeClassnameTags123Api.md @@ -22,6 +22,11 @@ To test class name in snake case use Data::Dumper; use WWW::SwaggerClient::FakeClassnameTags123Api; my $api_instance = WWW::SwaggerClient::FakeClassnameTags123Api->new( + + # Configure API key authorization: api_key_query + api_key => {'api_key_query' => 'YOUR_API_KEY'}, + # uncomment below to setup prefix (e.g. Bearer) for API key, if needed + #api_key_prefix => {'api_key_query' => 'Bearer'}, ); my $body = WWW::SwaggerClient::Object::Client->new(); # Client | client model @@ -47,7 +52,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[api_key_query](../README.md#api_key_query) ### HTTP request headers diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm new file mode 100644 index 00000000000..48debee7dd1 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm @@ -0,0 +1,116 @@ +=begin comment + +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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +package WWW::SwaggerClient::AnotherfakeApi; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use Exporter; +use Carp qw( croak ); +use Log::Any qw($log); + +use WWW::SwaggerClient::ApiClient; + +use base "Class::Data::Inheritable"; + +__PACKAGE__->mk_classdata('method_documentation' => {}); + +sub new { + my $class = shift; + my $api_client; + + if ($_[0] && ref $_[0] && ref $_[0] eq 'WWW::SwaggerClient::ApiClient' ) { + $api_client = $_[0]; + } else { + $api_client = WWW::SwaggerClient::ApiClient->new(@_); + } + + bless { api_client => $api_client }, $class; + +} + + +# +# test_special_tags +# +# To test special tags +# +# @param Client $body client model (required) +{ + my $params = { + 'body' => { + data_type => 'Client', + description => 'client model', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_special_tags' } = { + summary => 'To test special tags', + params => $params, + returns => 'Client', + }; +} +# @return Client +# +sub test_special_tags { + my ($self, %args) = @_; + + # verify the required parameter 'body' is set + unless (exists $args{'body'}) { + croak("Missing the required parameter 'body' when calling test_special_tags"); + } + + # parse inputs + my $_resource_path = '/another-fake/dummy'; + + my $_method = 'PATCH'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('Client', $response); + return $_response_object; +} + +1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/ApiClient.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/ApiClient.pm index 9c404b2d5bf..40a1d3d6193 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/ApiClient.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/ApiClient.pm @@ -348,6 +348,13 @@ sub update_params_for_auth { $header_params->{'api_key'} = $api_key; } } +elsif ($auth eq 'api_key_query') { + + my $api_key = $self->get_api_key_with_prefix('api_key_query'); + if ($api_key) { + $query_params->{'api_key_query'} = $api_key; + } + } elsif ($auth eq 'http_basic_test') { if ($self->{config}{username} || $self->{config}{password}) { diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm index d0cd56a018b..8f4b272637a 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -705,4 +705,81 @@ sub test_enum_parameters { return; } +# +# test_json_form_data +# +# test json serialization of form data +# +# @param string $param field1 (required) +# @param string $param2 field2 (required) +{ + my $params = { + 'param' => { + data_type => 'string', + description => 'field1', + required => '1', + }, + 'param2' => { + data_type => 'string', + description => 'field2', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_json_form_data' } = { + summary => 'test json serialization of form data', + params => $params, + returns => undef, + }; +} +# @return void +# +sub test_json_form_data { + my ($self, %args) = @_; + + # verify the required parameter 'param' is set + unless (exists $args{'param'}) { + croak("Missing the required parameter 'param' when calling test_json_form_data"); + } + + # verify the required parameter 'param2' is set + unless (exists $args{'param2'}) { + croak("Missing the required parameter 'param2' when calling test_json_form_data"); + } + + # parse inputs + my $_resource_path = '/fake/jsonFormData'; + + my $_method = 'GET'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); + + # form params + if ( exists $args{'param'} ) { + $form_params->{'param'} = $self->{api_client}->to_form_value($args{'param'}); + } + + # form params + if ( exists $args{'param2'} ) { + $form_params->{'param2'} = $self->{api_client}->to_form_value($args{'param2'}); + } + + my $_body_data; + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; +} + 1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeClassnameTags123Api.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeClassnameTags123Api.pm index 2d0550f9f82..69d8cc6defc 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeClassnameTags123Api.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeClassnameTags123Api.pm @@ -100,7 +100,7 @@ sub test_classname { } # authentication setting, if any - my $auth_settings = [qw()]; + my $auth_settings = [qw(api_key_query )]; # make the API Call my $response = $self->{api_client}->call_api($_resource_path, $_method, diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AdditionalPropertiesClass.pm index 3fe437aecd6..36ef2b20a78 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AdditionalPropertiesClass.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Animal.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Animal.pm index 563798ac8e0..22739cd6bc2 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Animal.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Animal.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AnimalFarm.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AnimalFarm.pm index db72a37462d..8b967bc0b57 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AnimalFarm.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/AnimalFarm.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Animal; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ApiResponse.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ApiResponse.pm index 5fbfaa01188..f751367d9ec 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ApiResponse.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ApiResponse.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm index d4a29601829..76ec3c05d5c 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfArrayOfNumberOnly.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Number; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm index 2ca74a07bcf..ac57470e70b 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayOfNumberOnly.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Number; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayTest.pm index 06b1510491a..efafb64be74 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ArrayTest.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::ReadOnlyFirst; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Capitalization.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Capitalization.pm index a1eb4353d3d..e6308e686aa 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Capitalization.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Capitalization.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Cat.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Cat.pm index ec800a25880..382789fe043 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Cat.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Cat.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Animal; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Category.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Category.pm index 3f2eef68d79..21d978183f6 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Category.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Category.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ClassModel.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ClassModel.pm index 90634705247..9be89999e73 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ClassModel.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ClassModel.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Client.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Client.pm index 1330c3de474..4a0a668805b 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Client.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Client.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Dog.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Dog.pm index f390090bb82..259eaa27c4f 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Dog.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Dog.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Animal; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumArrays.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumArrays.pm index 0378f0da8d7..a4c44c93d43 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumArrays.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumArrays.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumClass.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumClass.pm index c6f86df9650..981873845ae 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumClass.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumClass.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumTest.pm index 6b5f9317c4d..0d94500ec78 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/EnumTest.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::OuterEnum; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm index 99035e024ce..acbeb44796f 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm @@ -30,6 +30,9 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Number; +use WWW::SwaggerClient::Object::UUID; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/HasOnlyReadOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/HasOnlyReadOnly.pm index 58f96d793df..26a049924ac 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/HasOnlyReadOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/HasOnlyReadOnly.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/List.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/List.pm index 0bfa14e7454..3651bdc0d47 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/List.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/List.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MapTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MapTest.pm index 972bba09a68..85b3fb9f3f0 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MapTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MapTest.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm index 23d4485fab7..7353bacdbbe 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm @@ -30,6 +30,9 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Animal; +use WWW::SwaggerClient::Object::UUID; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Model200Response.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Model200Response.pm index d3a8642c7f1..93d1debca41 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Model200Response.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Model200Response.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm index d9dd154e49c..e395f7a17e2 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ModelReturn.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Name.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Name.pm index 75008ef2859..7462ff05bc3 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Name.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Name.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm index 46c00317e6e..c20db138e2a 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/NumberOnly.pm @@ -30,6 +30,8 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Number; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Order.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Order.pm index 9b0f4b3fa42..de5a0ca92dc 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Order.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Order.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm index 476df404705..c7bbc5700ae 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm index 7697149a774..705ca951da9 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm @@ -30,6 +30,10 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::OuterBoolean; +use WWW::SwaggerClient::Object::OuterNumber; +use WWW::SwaggerClient::Object::OuterString; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterEnum.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterEnum.pm index 344b4624d82..1b078e01ac5 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterEnum.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterEnum.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm index 5bb037849c5..799fb19c80f 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm index ac7e0ba5295..0c02799a35f 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Pet.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Pet.pm index 8f023ea870f..817b627b549 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Pet.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Pet.pm @@ -30,6 +30,9 @@ use Log::Any qw($log); use Date::Parse; use DateTime; +use WWW::SwaggerClient::Object::Category; +use WWW::SwaggerClient::Object::Tag; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ReadOnlyFirst.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ReadOnlyFirst.pm index 22d81105352..f506c1416dc 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ReadOnlyFirst.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/ReadOnlyFirst.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/SpecialModelName.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/SpecialModelName.pm index cd7bc18b774..7f73a6d0314 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/SpecialModelName.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/SpecialModelName.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Tag.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Tag.pm index f1d3249673b..c3da4f655f8 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Tag.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/Tag.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/User.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/User.pm index 6dd6de5e76a..8c02b6df99a 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/User.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/User.pm @@ -30,6 +30,7 @@ use Log::Any qw($log); use Date::Parse; use DateTime; + use base ("Class::Accessor", "Class::Data::Inheritable"); diff --git a/samples/client/petstore/perl/t/AnotherfakeApiTest.t b/samples/client/petstore/perl/t/AnotherfakeApiTest.t new file mode 100644 index 00000000000..35cd58c510e --- /dev/null +++ b/samples/client/petstore/perl/t/AnotherfakeApiTest.t @@ -0,0 +1,41 @@ +=begin comment + +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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by Swagger Codegen +# Please update the test cases below to test the API endpoints. +# Ref: https://github.com/swagger-api/swagger-codegen +# +use Test::More tests => 1; #TODO update number of test cases +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + +use_ok('WWW::SwaggerClient::AnotherfakeApi'); + +my $api = WWW::SwaggerClient::AnotherfakeApi->new(); +isa_ok($api, 'WWW::SwaggerClient::AnotherfakeApi'); + +# +# test_special_tags test +# +{ + my $body = undef; # replace NULL with a proper value + my $result = $api->test_special_tags(body => $body); +} + + +1; From e27d4577c1c86f083635f100856929eb63093856 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 19 Sep 2017 10:20:47 +0800 Subject: [PATCH 032/197] update perl petstore sample --- samples/client/petstore/perl/README.md | 12 ++++++------ samples/client/petstore/perl/docs/AnotherfakeApi.md | 12 ++++++------ .../perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 32e5e359b1d..ba89cad4214 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -221,12 +221,12 @@ Each of these calls returns a hashref with various useful pieces of information. To load the API packages: ```perl +use WWW::SwaggerClient::AnotherFakeApi; use WWW::SwaggerClient::FakeApi; use WWW::SwaggerClient::FakeClassnameTags123Api; use WWW::SwaggerClient::PetApi; use WWW::SwaggerClient::StoreApi; use WWW::SwaggerClient::UserApi; -use WWW::SwaggerClient::AnotherfakeApi; ``` @@ -279,12 +279,12 @@ use lib 'lib'; use strict; use warnings; # load the API package +use WWW::SwaggerClient::AnotherFakeApi; use WWW::SwaggerClient::FakeApi; use WWW::SwaggerClient::FakeClassnameTags123Api; use WWW::SwaggerClient::PetApi; use WWW::SwaggerClient::StoreApi; use WWW::SwaggerClient::UserApi; -use WWW::SwaggerClient::AnotherfakeApi; # load the models use WWW::SwaggerClient::Object::AdditionalPropertiesClass; @@ -331,14 +331,14 @@ use WWW::SwaggerClient::; my $api_instance = WWW::SwaggerClient::->new( ); -my $body = WWW::SwaggerClient::Object::OuterBoolean->new(); # OuterBoolean | Input boolean as post body +my $body = WWW::SwaggerClient::Object::Client->new(); # Client | client model eval { - my $result = $api_instance->fake_outer_boolean_serialize(body => $body); + my $result = $api_instance->test_special_tags(body => $body); print Dumper($result); }; if ($@) { - warn "Exception when calling FakeApi->fake_outer_boolean_serialize: $@\n"; + warn "Exception when calling AnotherFakeApi->test_special_tags: $@\n"; } ``` @@ -349,6 +349,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -378,7 +379,6 @@ Class | Method | HTTP request | Description *UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system *UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user -*AnotherfakeApi* | [**test_special_tags**](docs/AnotherfakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags # DOCUMENTATION FOR MODELS diff --git a/samples/client/petstore/perl/docs/AnotherfakeApi.md b/samples/client/petstore/perl/docs/AnotherfakeApi.md index 29a06be2e94..c4895883184 100644 --- a/samples/client/petstore/perl/docs/AnotherfakeApi.md +++ b/samples/client/petstore/perl/docs/AnotherfakeApi.md @@ -1,15 +1,15 @@ -# WWW::SwaggerClient::AnotherfakeApi +# WWW::SwaggerClient::AnotherFakeApi ## Load the API package ```perl -use WWW::SwaggerClient::Object::AnotherfakeApi; +use WWW::SwaggerClient::Object::AnotherFakeApi; ``` All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**test_special_tags**](AnotherfakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags # **test_special_tags** @@ -22,8 +22,8 @@ To test special tags ### Example ```perl use Data::Dumper; -use WWW::SwaggerClient::AnotherfakeApi; -my $api_instance = WWW::SwaggerClient::AnotherfakeApi->new( +use WWW::SwaggerClient::AnotherFakeApi; +my $api_instance = WWW::SwaggerClient::AnotherFakeApi->new( ); my $body = WWW::SwaggerClient::Object::Client->new(); # Client | client model @@ -33,7 +33,7 @@ eval { print Dumper($result); }; if ($@) { - warn "Exception when calling AnotherfakeApi->test_special_tags: $@\n"; + warn "Exception when calling AnotherFakeApi->test_special_tags: $@\n"; } ``` diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm index 48debee7dd1..7fc43d1c156 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/AnotherfakeApi.pm @@ -17,7 +17,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. # Ref: https://github.com/swagger-api/swagger-codegen # -package WWW::SwaggerClient::AnotherfakeApi; +package WWW::SwaggerClient::AnotherFakeApi; require 5.6.0; use strict; From 594b390e1149c3d4a9a0fc3b1d41975c48dc1f7c Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Tue, 19 Sep 2017 19:07:37 +0900 Subject: [PATCH 033/197] [PHP] Fix #6474: Bug with 'format: date' when using --model-name-prefix (#6510) * Add test case which repeats the issue #6474 * Add "date" to type mapping * Update samples ./bin/php-petstore.sh ./bin/security/php-petstore.sh --- .../codegen/languages/PhpClientCodegen.java | 1 + .../java/io/swagger/codegen/php/PhpModelTest.java | 14 ++++++++++++++ .../php/SwaggerClient-php/docs/Model/FormatTest.md | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index 8c889b19a06..98420bb37e1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -117,6 +117,7 @@ public PhpClientCodegen() { typeMapping.put("string", "string"); typeMapping.put("byte", "int"); typeMapping.put("boolean", "bool"); + typeMapping.put("date", "\\DateTime"); typeMapping.put("Date", "\\DateTime"); typeMapping.put("DateTime", "\\DateTime"); typeMapping.put("file", "\\SplFileObject"); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpModelTest.java index d7726b0945b..77d036272fa 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpModelTest.java @@ -1,12 +1,14 @@ package io.swagger.codegen.php; import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.languages.PhpClientCodegen; import io.swagger.models.ArrayModel; import io.swagger.models.Model; import io.swagger.models.ModelImpl; +import io.swagger.models.Operation; import io.swagger.models.properties.Property; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.DateTimeProperty; @@ -344,5 +346,17 @@ public void testReservedWord() throws Exception { Assert.assertEquals(codegen.toEnumVarName("hello", null), "HELLO"); } + @Test(description = "returns DateTime when using `--model-name-prefix`") + public void dateTest() { + final Swagger model = new SwaggerParser().read("src/test/resources/2_0/datePropertyTest.json"); + final DefaultCodegen codegen = new PhpClientCodegen(); + codegen.setModelNamePrefix("foo"); + + final String path = "/tests/dateResponse"; + final Operation p = model.getPaths().get(path).getPost(); + final CodegenOperation op = codegen.fromOperation(path, "post", p, model.getDefinitions()); + Assert.assertEquals(op.returnType, "\\DateTime"); + Assert.assertEquals(op.bodyParam.dataType, "\\DateTime"); + } } diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/FormatTest.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/FormatTest.md index c31305010fc..57cb0b1c332 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Model/FormatTest.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/FormatTest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **string** | **string** | | [optional] **byte** | **string** | | **binary** | **string** | | [optional] -**date** | [**\DateTime**](Date.md) | | +**date** | [**\DateTime**](\DateTime.md) | | **date_time** | [**\DateTime**](\DateTime.md) | | [optional] **uuid** | **string** | | [optional] **password** | **string** | | From 7f6bccb4ed1dd23a1aa0a694c24cff262b8f00ee Mon Sep 17 00:00:00 2001 From: lukoyanov Date: Wed, 20 Sep 2017 07:32:52 +0300 Subject: [PATCH 034/197] [Java] Added Play! WS filters support for retrofit2 client (#6499) * added play! ws filters support * samples updated --- .../retrofit2/play25/Play25CallFactory.mustache | 16 ++++++++++++++-- .../io/swagger/client/Play25CallFactory.java | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache index b62c78aadb8..93df7a2718d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache @@ -6,6 +6,7 @@ import okio.BufferedSource; import play.libs.ws.WSClient; import play.libs.ws.WSRequest; import play.libs.ws.WSResponse; +import play.libs.ws.WSRequestFilter; import java.io.IOException; import java.net.MalformedURLException; @@ -31,11 +32,19 @@ public class Play25CallFactory implements okhttp3.Call.Factory { /** Extra query parameters to add to request */ private List extraQueryParams = new ArrayList<>(); + + /** Filters (interceptors) */ + private List filters = new ArrayList<>(); public Play25CallFactory(WSClient wsClient) { this.wsClient = wsClient; } + public Play25CallFactory(WSClient wsClient, List filters) { + this.wsClient = wsClient; + this.filters.addAll(filters); + } + public Play25CallFactory(WSClient wsClient, Map extraHeaders, List extraQueryParams) { this.wsClient = wsClient; @@ -74,7 +83,7 @@ public class Play25CallFactory implements okhttp3.Call.Factory { } } - return new PlayWSCall(wsClient, rb.build()); + return new PlayWSCall(wsClient, this.filters, rb.build()); } /** @@ -84,12 +93,14 @@ public class Play25CallFactory implements okhttp3.Call.Factory { private final WSClient wsClient; private WSRequest wsRequest; + private List filters; private final Request request; - public PlayWSCall(WSClient wsClient, Request request) { + public PlayWSCall(WSClient wsClient, List filters, Request request) { this.wsClient = wsClient; this.request = request; + this.filters = filters; } @Override @@ -126,6 +137,7 @@ public class Play25CallFactory implements okhttp3.Call.Factory { if (request.body() != null) { addBody(wsRequest); } + filters.stream().forEach(f -> wsRequest.withRequestFilter(f)); return wsRequest.execute(request.method()); } catch (Exception e) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java index 5085288b800..ba5434f53f2 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java @@ -6,6 +6,7 @@ import play.libs.ws.WSClient; import play.libs.ws.WSRequest; import play.libs.ws.WSResponse; +import play.libs.ws.WSRequestFilter; import java.io.IOException; import java.net.MalformedURLException; @@ -31,11 +32,19 @@ public class Play25CallFactory implements okhttp3.Call.Factory { /** Extra query parameters to add to request */ private List extraQueryParams = new ArrayList<>(); + + /** Filters (interceptors) */ + private List filters = new ArrayList<>(); public Play25CallFactory(WSClient wsClient) { this.wsClient = wsClient; } + public Play25CallFactory(WSClient wsClient, List filters) { + this.wsClient = wsClient; + this.filters.addAll(filters); + } + public Play25CallFactory(WSClient wsClient, Map extraHeaders, List extraQueryParams) { this.wsClient = wsClient; @@ -74,7 +83,7 @@ public Call newCall(Request request) { } } - return new PlayWSCall(wsClient, rb.build()); + return new PlayWSCall(wsClient, this.filters, rb.build()); } /** @@ -84,12 +93,14 @@ static class PlayWSCall implements Call { private final WSClient wsClient; private WSRequest wsRequest; + private List filters; private final Request request; - public PlayWSCall(WSClient wsClient, Request request) { + public PlayWSCall(WSClient wsClient, List filters, Request request) { this.wsClient = wsClient; this.request = request; + this.filters = filters; } @Override @@ -126,6 +137,7 @@ CompletionStage executeAsync() { if (request.body() != null) { addBody(wsRequest); } + filters.stream().forEach(f -> wsRequest.withRequestFilter(f)); return wsRequest.execute(request.method()); } catch (Exception e) { From d08149b7cc899098a31ad7241af4a0278646393d Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 21 Sep 2017 11:07:43 +0800 Subject: [PATCH 035/197] Fix abcsum with abcsun --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bce55d9819d..c5ac868b50a 100644 --- a/README.md +++ b/README.md @@ -923,7 +923,7 @@ Swagger Codegen core team members are contributors who have been making signific | Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | -| PHP Lumen | @abcsum (2016/05/01) | +| PHP Lumen | @abcsun (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | @@ -991,7 +991,7 @@ Here is a list of template creators: * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala - * PHP Lumen: @abcsum + * PHP Lumen: @abcsun * PHP Slim: @jfastnacht * PHP Symfony: @ksm2 * PHP Zend Expressive (with Path Handler): @Articus From ae6d34d480627f9d39c5048080a138cedc1898f1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 21 Sep 2017 15:30:01 +0800 Subject: [PATCH 036/197] various readme update --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5ac868b50a..9db5b79ba0e 100644 --- a/README.md +++ b/README.md @@ -880,6 +880,7 @@ Presentations/Videos/Tutorials/Books - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) +- 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) (Elasticsearch) # Swagger Codegen Core Team @@ -1055,11 +1056,11 @@ If you want to join the committee, please kindly apply by sending an email to wi | PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) | | R | | -| Ruby | @cliffano (2017/07) | +| Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) | | Swift | @jgavris (2017/07) @ehyche (2017/08) | -| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07)| +| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | # License information on Generated Code From e626afaf1a87d0396204f0996e120e74d2f70d4d Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 21 Sep 2017 21:05:17 +0800 Subject: [PATCH 037/197] add https://www.elastic.co/ to list of co using sw --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9db5b79ba0e..21167c8af63 100644 --- a/README.md +++ b/README.md @@ -745,6 +745,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [DecentFoX](http://decentfox.com/) - [DocRaptor](https://docraptor.com) - [DocuSign](https://www.docusign.com) +- [Elastic](https://www.elastic.co/) - [Ergon](http://www.ergon.ch/) - [Dell EMC](https://www.emc.com/) - [eureka](http://eure.jp/) From bcfd14551a38a8732fed1619531f04fef433cab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 21 Sep 2017 12:54:10 -0400 Subject: [PATCH 038/197] Fixing conversion when it's an item of a collection + add missing isUuid in objects (#6473) --- .../src/main/java/io/swagger/codegen/CodegenParameter.java | 3 +++ .../src/main/java/io/swagger/codegen/CodegenProperty.java | 1 + .../resources/JavaPlayFramework/conversionBegin.mustache | 2 +- .../main/resources/JavaPlayFramework/conversionEnd.mustache | 2 +- .../JavaPlayFramework/itemConversionBegin.mustache | 1 + .../resources/JavaPlayFramework/itemConversionEnd.mustache | 1 + .../resources/JavaPlayFramework/newApiController.mustache | 6 +++--- 7 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionEnd.mustache diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index 008a01b5586..bb437c9a036 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -231,6 +231,8 @@ public boolean equals(Object o) { return false; if (isDateTime != that.isDateTime) return false; + if (isUuid != that.isUuid) + return false; if (isListContainer != that.isListContainer) return false; if (isMapContainer != that.isMapContainer) @@ -312,6 +314,7 @@ public int hashCode() { result = 31 * result + (isBoolean ? 13:31); result = 31 * result + (isDate ? 13:31); result = 31 * result + (isDateTime ? 13:31); + result = 31 * result + (isUuid ? 13:31); result = 31 * result + (isListContainer ? 13:31); result = 31 * result + (isMapContainer ? 13:31); result = 31 * result + (isFile ? 13:31); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java index 243b5b930fa..a7fa9385cc7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java @@ -126,6 +126,7 @@ public int hashCode() result = prime * result + ((isBoolean ? 13:31)); result = prime * result + ((isDate ? 13:31)); result = prime * result + ((isDateTime ? 13:31)); + result = prime * result + ((isUuid ? 13:31)); result = prime * result + ((isMapContainer ? 13:31)); result = prime * result + ((isListContainer ? 13:31)); result = prime * result + Objects.hashCode(isInherited); diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache index 0e33b6243ad..ef61e4943bc 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -1 +1 @@ -{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}} +{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache index 2d17a5393a0..ece85da5a28 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache @@ -1 +1 @@ -{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isUuid}}){{/isUuid}}{{#isDateTime}}){{/isDateTime}} +{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isUuid}}){{/isUuid}}{{#isDateTime}}){{/isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache new file mode 100644 index 00000000000..42bcc99d36a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache @@ -0,0 +1 @@ +{{#items.isBoolean}}Boolean.valueOf({{/items.isBoolean}}{{#items.isInteger}}Integer.parseInt({{/items.isInteger}}{{#items.isDouble}}Double.parseDouble({{/items.isDouble}}{{#items.isLong}}Long.parseLong({{/items.isLong}}{{#items.isFloat}}Float.parseFloat({{/items.isFloat}}{{#items.isUuid}}UUID.fromString({{/items.isUuid}}{{#items.isDateTime}}OffsetDateTime.parse({{/items.isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionEnd.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionEnd.mustache new file mode 100644 index 00000000000..cb202e4325e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/itemConversionEnd.mustache @@ -0,0 +1 @@ +{{#items.isBoolean}}){{/items.isBoolean}}{{#items.isInteger}}){{/items.isInteger}}{{#items.isDouble}}){{/items.isDouble}}{{#items.isLong}}){{/items.isLong}}{{#items.isFloat}}){{/items.isFloat}}{{#items.isUuid}}){{/items.isUuid}}{{#items.isDateTime}}){{/items.isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache index c4577760c7e..12c4fbb9d5f 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -74,7 +74,7 @@ public class {{classname}}Controller extends Controller { {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation - {{paramName}}.add({{>conversionBegin}}curParam{{>conversionEnd}}); + {{paramName}}.add({{>itemConversionBegin}}curParam{{>itemConversionEnd}}); } {{/collectionFormat}} {{^collectionFormat}} @@ -105,7 +105,7 @@ public class {{classname}}Controller extends Controller { {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation - {{paramName}}.add({{>conversionBegin}}curParam{{>conversionEnd}}); + {{paramName}}.add({{>itemConversionBegin}}curParam{{>itemConversionEnd}}); } {{/collectionFormat}} {{^collectionFormat}} @@ -128,7 +128,7 @@ public class {{classname}}Controller extends Controller { {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation - {{paramName}}.add({{>conversionBegin}}curParam{{>conversionEnd}}); + {{paramName}}.add({{>itemConversionBegin}}curParam{{>itemConversionEnd}}); } {{/collectionFormat}} {{^collectionFormat}} From 6267869b3fc3e36ceac9295cfea11fcae236dcc4 Mon Sep 17 00:00:00 2001 From: Cliffano Subagio Date: Fri, 22 Sep 2017 14:37:31 +1000 Subject: [PATCH 039/197] Add Jenkins World 2017 talk. (#6542) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 21167c8af63..b2da71012b1 100644 --- a/README.md +++ b/README.md @@ -880,6 +880,7 @@ Presentations/Videos/Tutorials/Books - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) +- 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from Shine Solutions @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) (Elasticsearch) From ffd8c4adb69d800c4e9181a698d7ee1fb01483cc Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 22 Sep 2017 14:25:43 +0800 Subject: [PATCH 040/197] update elasticsearch to elastic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2da71012b1..8147373151b 100644 --- a/README.md +++ b/README.md @@ -882,7 +882,7 @@ Presentations/Videos/Tutorials/Books - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from Shine Solutions @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) -- 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) (Elasticsearch) +- 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) # Swagger Codegen Core Team From c74c31bcfcbbf9b365b79eb030eec77bb66a1025 Mon Sep 17 00:00:00 2001 From: CK Date: Sat, 23 Sep 2017 09:05:05 +0200 Subject: [PATCH 041/197] produce correct enum for jaxrs resteasy eap (#6489) --- .../JavaJaxRS/resteasy/eap/enumOuterClass.mustache | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache index 7aea7b92f22..77ae9521fa5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/enumOuterClass.mustache @@ -1,3 +1,7 @@ public enum {{classname}} { - {{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{/allowableValues}} + {{#allowableValues}} + {{#enumVars}} + {{{name}}}{{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} } \ No newline at end of file From ccc980e619800b8a6524dcf20cfe5d97e3627486 Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Sat, 23 Sep 2017 16:24:37 +0900 Subject: [PATCH 042/197] Add link to Gradle Swagger Generator Plugin (#6481) --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8147373151b..ec3968aad0b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for addit - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) + - [Maven Integration](#maven-integration) + - [Gradle Integration](#gradle-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) @@ -618,10 +620,16 @@ mvn package Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts -## Workflow integration +## Workflow Integration + +### Maven Integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. +### Gradle Integration + +[Gradle Swagger Generator Plugin](https://github.com/int128/gradle-swagger-generator-plugin) is available for generating source code and API document. + ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: From c5c639b62b13efa8377024c6fa25ddc3901ebe38 Mon Sep 17 00:00:00 2001 From: Brad Crumb Date: Sat, 23 Sep 2017 09:31:20 +0200 Subject: [PATCH 043/197] Zend Expressive fix and upgrade to version 2 (#6461) * upgraded zend-expressive from version 1 to 2 * Changed error handler for compatibility with Zend Expressive 2 * generated newest sample files for Petstore ze-ph * removed ErrorMiddleware because it is never been used anymore. Regenerated samples * removed ErrorMiddleware Template from Codegen * remove ErrorMiddleware from petstore sample * Fixed some code styles * regenerated ze-ph samples with corrected code styles * added new line at the end of the file --- ...endExpressivePathHandlerServerCodegen.java | 1 - .../main/resources/ze-ph/Date.php.mustache | 8 +++-- .../resources/ze-ph/DateTime.php.mustache | 4 ++- .../ze-ph/ErrorMiddleware.php.mustache | 20 ----------- .../main/resources/ze-ph/Type.php.mustache | 2 +- .../src/main/resources/ze-ph/api.mustache | 5 ++- .../src/main/resources/ze-ph/app.yml.mustache | 17 ++++++--- .../resources/ze-ph/composer.json.mustache | 10 +++--- .../src/main/resources/ze-ph/config.yml | 1 + .../src/main/resources/ze-ph/index.php | 2 +- .../src/main/resources/ze-ph/model.mustache | 5 ++- .../petstore/ze-ph/.swagger-codegen/VERSION | 2 +- .../petstore/ze-ph/application/config.yml | 1 + .../petstore/ze-ph/application/config/app.yml | 17 ++++++--- .../ze-ph/application/config/path_handler.yml | 14 ++++++++ samples/server/petstore/ze-ph/composer.json | 10 +++--- .../server/petstore/ze-ph/public/index.php | 2 +- .../src/App/DTO/AdditionalPropertiesClass.php | 3 +- .../petstore/ze-ph/src/App/DTO/Animal.php | 3 +- .../petstore/ze-ph/src/App/DTO/AnimalFarm.php | 3 +- .../ze-ph/src/App/DTO/ApiResponse.php | 3 +- .../src/App/DTO/ArrayOfArrayOfNumberOnly.php | 3 +- .../ze-ph/src/App/DTO/ArrayOfNumberOnly.php | 3 +- .../petstore/ze-ph/src/App/DTO/ArrayTest.php | 3 +- .../ze-ph/src/App/DTO/Capitalization.php | 3 +- .../server/petstore/ze-ph/src/App/DTO/Cat.php | 3 +- .../petstore/ze-ph/src/App/DTO/Category.php | 3 +- .../petstore/ze-ph/src/App/DTO/ClassModel.php | 3 +- .../petstore/ze-ph/src/App/DTO/Client.php | 3 +- .../server/petstore/ze-ph/src/App/DTO/Dog.php | 3 +- .../petstore/ze-ph/src/App/DTO/EnumArrays.php | 3 +- .../petstore/ze-ph/src/App/DTO/EnumClass.php | 3 +- .../petstore/ze-ph/src/App/DTO/EnumTest.php | 3 +- .../petstore/ze-ph/src/App/DTO/FormatTest.php | 5 +-- .../ze-ph/src/App/DTO/HasOnlyReadOnly.php | 3 +- .../petstore/ze-ph/src/App/DTO/MapTest.php | 3 +- ...PropertiesAndAdditionalPropertiesClass.php | 3 +- .../ze-ph/src/App/DTO/Model200Response.php | 3 +- .../ze-ph/src/App/DTO/ModelReturn.php | 3 +- .../petstore/ze-ph/src/App/DTO/Name.php | 3 +- .../petstore/ze-ph/src/App/DTO/NumberOnly.php | 3 +- .../petstore/ze-ph/src/App/DTO/Order.php | 3 +- .../ze-ph/src/App/DTO/OuterBoolean.php | 3 +- .../ze-ph/src/App/DTO/OuterComposite.php | 3 +- .../petstore/ze-ph/src/App/DTO/OuterEnum.php | 3 +- .../ze-ph/src/App/DTO/OuterNumber.php | 3 +- .../ze-ph/src/App/DTO/OuterString.php | 3 +- .../server/petstore/ze-ph/src/App/DTO/Pet.php | 3 +- .../ze-ph/src/App/DTO/ReadOnlyFirst.php | 3 +- .../ze-ph/src/App/DTO/SpecialModelName.php | 3 +- .../server/petstore/ze-ph/src/App/DTO/Tag.php | 3 +- .../petstore/ze-ph/src/App/DTO/User.php | 3 +- .../ze-ph/src/App/ErrorMiddleware.php | 20 ----------- .../petstore/ze-ph/src/App/Handler/Fake.php | 11 +++++- .../src/App/Handler/FakeClassnameTest.php | 35 +++++++++++++++++++ .../src/App/Handler/FakeJsonFormData.php | 26 ++++++++++++++ .../src/App/Handler/FakeOuterBoolean.php | 5 ++- .../src/App/Handler/FakeOuterComposite.php | 5 ++- .../ze-ph/src/App/Handler/FakeOuterNumber.php | 5 ++- .../ze-ph/src/App/Handler/FakeOuterString.php | 5 ++- .../petstore/ze-ph/src/App/Handler/Pet.php | 7 +++- .../ze-ph/src/App/Handler/PetFindByStatus.php | 5 ++- .../ze-ph/src/App/Handler/PetFindByTags.php | 5 ++- .../ze-ph/src/App/Handler/PetPetId.php | 11 +++++- .../src/App/Handler/PetPetIdUploadImage.php | 5 ++- .../ze-ph/src/App/Handler/StoreInventory.php | 5 ++- .../ze-ph/src/App/Handler/StoreOrder.php | 5 ++- .../src/App/Handler/StoreOrderOrderId.php | 8 ++++- .../petstore/ze-ph/src/App/Handler/User.php | 4 ++- .../src/App/Handler/UserCreateWithArray.php | 4 ++- .../src/App/Handler/UserCreateWithList.php | 4 ++- .../ze-ph/src/App/Handler/UserLogin.php | 5 ++- .../ze-ph/src/App/Handler/UserLogout.php | 4 ++- .../ze-ph/src/App/Handler/UserUsername.php | 11 +++++- .../petstore/ze-ph/src/App/Strategy/Date.php | 8 +++-- .../ze-ph/src/App/Strategy/DateTime.php | 4 ++- .../petstore/ze-ph/src/App/Validator/Type.php | 2 +- 77 files changed, 274 insertions(+), 163 deletions(-) delete mode 100644 modules/swagger-codegen/src/main/resources/ze-ph/ErrorMiddleware.php.mustache delete mode 100644 samples/server/petstore/ze-ph/src/App/ErrorMiddleware.php create mode 100644 samples/server/petstore/ze-ph/src/App/Handler/FakeClassnameTest.php create mode 100644 samples/server/petstore/ze-ph/src/App/Handler/FakeJsonFormData.php diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ZendExpressivePathHandlerServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ZendExpressivePathHandlerServerCodegen.java index 12328c64d58..91cf0a40ad0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ZendExpressivePathHandlerServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ZendExpressivePathHandlerServerCodegen.java @@ -55,7 +55,6 @@ public ZendExpressivePathHandlerServerCodegen() { supportingFiles.add(new SupportingFile("Date.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "Date.php")); supportingFiles.add(new SupportingFile("DateTime.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "DateTime.php")); supportingFiles.add(new SupportingFile("Type.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Validator", "Type.php")); - supportingFiles.add(new SupportingFile("ErrorMiddleware.php.mustache", packagePath + File.separator + srcBasePath, "ErrorMiddleware.php")); additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, "1.0.0"); } diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/Date.php.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/Date.php.mustache index 89bcf5ba0ec..4edbca0486b 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/Date.php.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/Date.php.mustache @@ -12,6 +12,10 @@ class Date extends DateTime */ protected function parseDateString($arrayValue) { - return \DateTime::createFromFormat(static::DATE_TIME_FORMAT.' H:i:sP', $arrayValue.' 00:00:00+00:00', new \DateTimeZone('UTC')); + return \DateTime::createFromFormat( + static::DATE_TIME_FORMAT . ' H:i:sP', + $arrayValue . ' 00:00:00+00:00', + new \DateTimeZone('UTC') + ); } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/DateTime.php.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/DateTime.php.mustache index 53eae99be48..1c3a7ad6efd 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/DateTime.php.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/DateTime.php.mustache @@ -1,11 +1,13 @@ withStatus(500, 'Internal server error'); - $response->getBody()->write((string)$error); - error_log((string) $error); - return ($out === null)? $response : $out($request, $response); - } -} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/Type.php.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/Type.php.mustache index 050fbbef54b..812da6cb80b 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/Type.php.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/Type.php.mustache @@ -68,4 +68,4 @@ class Type extends AbstractValidator throw new \InvalidArgumentException(sprintf('Can not check for type %s.', $this->type)); } } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/api.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/api.mustache index a2463ccfb65..fdaf4ca7ba7 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/api.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/api.mustache @@ -11,7 +11,6 @@ use Articus\PathHandler\Exception as PHException; use Psr\Http\Message\ServerRequestInterface; {{#operations}} - {{#description}} /** * {{&description}} @@ -40,7 +39,11 @@ class {{classname}} implements {{interfacesToImplement}} * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="{{mediaType}}") {{/produces}} + * @param ServerRequestInterface $request + * + * @throws PHException\HttpCode 500 if the method is not implemented {{#returnType}} + * * @return {{returnType}} {{/returnType}} */ diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/app.yml.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/app.yml.mustache index 1cabd291fd6..425019ca115 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/app.yml.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/app.yml.mustache @@ -3,17 +3,24 @@ dependencies: #Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter - {{invokerPackage}}\ErrorMiddleware: {{invokerPackage}}\ErrorMiddleware factories: Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory + Zend\Stratigility\Middleware\ErrorHandler: Zend\Expressive\Container\ErrorHandlerFactory + Zend\Expressive\Middleware\ErrorResponseGenerator: Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory + Zend\Expressive\Whoops: Zend\Expressive\Container\WhoopsFactory + Zend\Expressive\WhoopsPageHandler: Zend\Expressive\Container\WhoopsPageHandlerFactory middleware_pipeline: + error: + middleware: Zend\Stratigility\Middleware\ErrorHandler api: middleware: Articus\PathHandler\Middleware path: {{basePathWithoutHost}} - error: - middleware: {{invokerPackage}}\ErrorMiddleware - error: true - priority: -10000 + +whoops: + json_exceptions: + display: true + show_trace: true + ajax_only: true diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/composer.json.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/composer.json.mustache index df263a37b8e..aaf19cbddeb 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/composer.json.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/composer.json.mustache @@ -7,12 +7,14 @@ "require": { "php": "^5.6 || ^7.0", "ext-yaml" : "^1.2 || ^2.0", - "zendframework/zend-expressive": "^1.0", - "zendframework/zend-expressive-router": "1.2.*", - "articus/path-handler": "0.1.*", + "zendframework/zend-expressive": "^2.0", + "zendframework/zend-expressive-router": "^2.1", + "zendframework/zend-expressive-zendrouter": "^2.0", + "articus/path-handler": "0.2.*", "articus/data-transfer": "*", "zendframework/zend-serializer": "*", - "zendframework/zend-config": "*" + "zendframework/zend-config": "*", + "filp/whoops": "^2.1.7" }, "autoload": { "psr-4": { diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/config.yml b/modules/swagger-codegen/src/main/resources/ze-ph/config.yml index dce9c534bcd..1a6111a88f5 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/config.yml +++ b/modules/swagger-codegen/src/main/resources/ze-ph/config.yml @@ -1,2 +1,3 @@ #App cache_configuration: false +debug: true diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/index.php b/modules/swagger-codegen/src/main/resources/ze-ph/index.php index 09e8b0233e4..fcb6dd63852 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/index.php +++ b/modules/swagger-codegen/src/main/resources/ze-ph/index.php @@ -7,4 +7,4 @@ /** @var \Zend\Expressive\Application $app */ $app = $container->get(\Zend\Expressive\Application::class); -$app->run(); \ No newline at end of file +$app->run(); diff --git a/modules/swagger-codegen/src/main/resources/ze-ph/model.mustache b/modules/swagger-codegen/src/main/resources/ze-ph/model.mustache index 5aad31bf70f..a9106820843 100644 --- a/modules/swagger-codegen/src/main/resources/ze-ph/model.mustache +++ b/modules/swagger-codegen/src/main/resources/ze-ph/model.mustache @@ -9,7 +9,7 @@ use Articus\DataTransfer\Annotation as DTA; * {{description}} {{/description}} */ -class {{classname}} +class {{classname}} { {{#vars}} /** @@ -127,5 +127,4 @@ class {{classname}} */ public ${{name}}; {{/vars}} -} -{{/model}}{{/models}} +}{{/model}}{{/models}} diff --git a/samples/server/petstore/ze-ph/.swagger-codegen/VERSION b/samples/server/petstore/ze-ph/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/ze-ph/.swagger-codegen/VERSION +++ b/samples/server/petstore/ze-ph/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ze-ph/application/config.yml b/samples/server/petstore/ze-ph/application/config.yml index dce9c534bcd..1a6111a88f5 100644 --- a/samples/server/petstore/ze-ph/application/config.yml +++ b/samples/server/petstore/ze-ph/application/config.yml @@ -1,2 +1,3 @@ #App cache_configuration: false +debug: true diff --git a/samples/server/petstore/ze-ph/application/config/app.yml b/samples/server/petstore/ze-ph/application/config/app.yml index d91bcd21339..414b59389f1 100644 --- a/samples/server/petstore/ze-ph/application/config/app.yml +++ b/samples/server/petstore/ze-ph/application/config/app.yml @@ -3,17 +3,24 @@ dependencies: #Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter - App\ErrorMiddleware: App\ErrorMiddleware factories: Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory + Zend\Stratigility\Middleware\ErrorHandler: Zend\Expressive\Container\ErrorHandlerFactory + Zend\Expressive\Middleware\ErrorResponseGenerator: Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory + Zend\Expressive\Whoops: Zend\Expressive\Container\WhoopsFactory + Zend\Expressive\WhoopsPageHandler: Zend\Expressive\Container\WhoopsPageHandlerFactory middleware_pipeline: + error: + middleware: Zend\Stratigility\Middleware\ErrorHandler api: middleware: Articus\PathHandler\Middleware path: /v2 - error: - middleware: App\ErrorMiddleware - error: true - priority: -10000 + +whoops: + json_exceptions: + display: true + show_trace: true + ajax_only: true diff --git a/samples/server/petstore/ze-ph/application/config/path_handler.yml b/samples/server/petstore/ze-ph/application/config/path_handler.yml index 2b91ca7d58d..58ad234f634 100644 --- a/samples/server/petstore/ze-ph/application/config/path_handler.yml +++ b/samples/server/petstore/ze-ph/application/config/path_handler.yml @@ -9,6 +9,12 @@ path_handler: handler: Fake may_terminate: true child_routes: + 'jsonFormData': + type: Literal + options: + route: /jsonFormData + defaults: + handler: FakeJsonFormData 'outer': type: Literal options: @@ -38,6 +44,12 @@ path_handler: route: /string defaults: handler: FakeOuterString + 'fake_classname_test': + type: Literal + options: + route: /fake_classname_test + defaults: + handler: FakeClassnameTest 'pet': type: Literal options: @@ -150,10 +162,12 @@ path_handler: handlers: invokables: Fake: App\Handler\Fake + FakeJsonFormData: App\Handler\FakeJsonFormData FakeOuterBoolean: App\Handler\FakeOuterBoolean FakeOuterComposite: App\Handler\FakeOuterComposite FakeOuterNumber: App\Handler\FakeOuterNumber FakeOuterString: App\Handler\FakeOuterString + FakeClassnameTest: App\Handler\FakeClassnameTest Pet: App\Handler\Pet PetFindByStatus: App\Handler\PetFindByStatus PetFindByTags: App\Handler\PetFindByTags diff --git a/samples/server/petstore/ze-ph/composer.json b/samples/server/petstore/ze-ph/composer.json index 5cad52b27e2..457b2209907 100644 --- a/samples/server/petstore/ze-ph/composer.json +++ b/samples/server/petstore/ze-ph/composer.json @@ -7,12 +7,14 @@ "require": { "php": "^5.6 || ^7.0", "ext-yaml" : "^1.2 || ^2.0", - "zendframework/zend-expressive": "^1.0", - "zendframework/zend-expressive-router": "1.2.*", - "articus/path-handler": "0.1.*", + "zendframework/zend-expressive": "^2.0", + "zendframework/zend-expressive-router": "^2.1", + "zendframework/zend-expressive-zendrouter": "^2.0", + "articus/path-handler": "0.2.*", "articus/data-transfer": "*", "zendframework/zend-serializer": "*", - "zendframework/zend-config": "*" + "zendframework/zend-config": "*", + "filp/whoops": "^2.1.7" }, "autoload": { "psr-4": { diff --git a/samples/server/petstore/ze-ph/public/index.php b/samples/server/petstore/ze-ph/public/index.php index 09e8b0233e4..fcb6dd63852 100644 --- a/samples/server/petstore/ze-ph/public/index.php +++ b/samples/server/petstore/ze-ph/public/index.php @@ -7,4 +7,4 @@ /** @var \Zend\Expressive\Application $app */ $app = $container->get(\Zend\Expressive\Application::class); -$app->run(); \ No newline at end of file +$app->run(); diff --git a/samples/server/petstore/ze-ph/src/App/DTO/AdditionalPropertiesClass.php b/samples/server/petstore/ze-ph/src/App/DTO/AdditionalPropertiesClass.php index 8d4f82b8816..1bd97b750ee 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/AdditionalPropertiesClass.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/AdditionalPropertiesClass.php @@ -6,7 +6,7 @@ /** */ -class AdditionalPropertiesClass +class AdditionalPropertiesClass { /** * @DTA\Data(field="map_property", nullable=true) @@ -21,4 +21,3 @@ class AdditionalPropertiesClass */ public $map_of_map_property; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Animal.php b/samples/server/petstore/ze-ph/src/App/DTO/Animal.php index cfeab7af503..215b1a0259c 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Animal.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Animal.php @@ -6,7 +6,7 @@ /** */ -class Animal +class Animal { /** * @DTA\Data(field="className") @@ -21,4 +21,3 @@ class Animal */ public $color; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/AnimalFarm.php b/samples/server/petstore/ze-ph/src/App/DTO/AnimalFarm.php index e161fae5773..98fa3a2a131 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/AnimalFarm.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/AnimalFarm.php @@ -6,7 +6,6 @@ /** */ -class AnimalFarm +class AnimalFarm { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ApiResponse.php b/samples/server/petstore/ze-ph/src/App/DTO/ApiResponse.php index 9d978986b06..381b20bd55a 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ApiResponse.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ApiResponse.php @@ -6,7 +6,7 @@ /** */ -class ApiResponse +class ApiResponse { /** * @DTA\Data(field="code", nullable=true) @@ -27,4 +27,3 @@ class ApiResponse */ public $message; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfArrayOfNumberOnly.php b/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfArrayOfNumberOnly.php index d33fb66a650..d3cdf2c34ae 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfArrayOfNumberOnly.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfArrayOfNumberOnly.php @@ -6,7 +6,7 @@ /** */ -class ArrayOfArrayOfNumberOnly +class ArrayOfArrayOfNumberOnly { /** * @DTA\Data(field="ArrayArrayNumber", nullable=true) @@ -18,4 +18,3 @@ class ArrayOfArrayOfNumberOnly */ public $array_array_number; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfNumberOnly.php b/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfNumberOnly.php index 006d7583b71..6168949960e 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfNumberOnly.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ArrayOfNumberOnly.php @@ -6,7 +6,7 @@ /** */ -class ArrayOfNumberOnly +class ArrayOfNumberOnly { /** * @DTA\Data(field="ArrayNumber", nullable=true) @@ -17,4 +17,3 @@ class ArrayOfNumberOnly */ public $array_number; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ArrayTest.php b/samples/server/petstore/ze-ph/src/App/DTO/ArrayTest.php index 901bcb7cf3c..64786f57404 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ArrayTest.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ArrayTest.php @@ -6,7 +6,7 @@ /** */ -class ArrayTest +class ArrayTest { /** * @DTA\Data(field="array_of_string", nullable=true) @@ -35,4 +35,3 @@ class ArrayTest */ public $array_array_of_model; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Capitalization.php b/samples/server/petstore/ze-ph/src/App/DTO/Capitalization.php index 79a442ed068..d09f67081de 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Capitalization.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Capitalization.php @@ -6,7 +6,7 @@ /** */ -class Capitalization +class Capitalization { /** * @DTA\Data(field="smallCamel", nullable=true) @@ -46,4 +46,3 @@ class Capitalization */ public $att_name; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Cat.php b/samples/server/petstore/ze-ph/src/App/DTO/Cat.php index 1d8d759cead..e1596de8ede 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Cat.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Cat.php @@ -6,7 +6,7 @@ /** */ -class Cat +class Cat { /** * @DTA\Data(field="className") @@ -27,4 +27,3 @@ class Cat */ public $declawed; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Category.php b/samples/server/petstore/ze-ph/src/App/DTO/Category.php index f2d23ca6f43..67f1b97ec3c 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Category.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Category.php @@ -6,7 +6,7 @@ /** */ -class Category +class Category { /** * @DTA\Data(field="id", nullable=true) @@ -21,4 +21,3 @@ class Category */ public $name; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ClassModel.php b/samples/server/petstore/ze-ph/src/App/DTO/ClassModel.php index 8d7f31fca6d..388871d8e01 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ClassModel.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ClassModel.php @@ -7,7 +7,7 @@ /** * Model for testing model with \"_class\" property */ -class ClassModel +class ClassModel { /** * @DTA\Data(field="_class", nullable=true) @@ -16,4 +16,3 @@ class ClassModel */ public $_class; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Client.php b/samples/server/petstore/ze-ph/src/App/DTO/Client.php index a9418d3ec9e..793c70a82dc 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Client.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Client.php @@ -6,7 +6,7 @@ /** */ -class Client +class Client { /** * @DTA\Data(field="client", nullable=true) @@ -15,4 +15,3 @@ class Client */ public $client; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Dog.php b/samples/server/petstore/ze-ph/src/App/DTO/Dog.php index 44dd67d7764..74482a9a33e 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Dog.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Dog.php @@ -6,7 +6,7 @@ /** */ -class Dog +class Dog { /** * @DTA\Data(field="className") @@ -27,4 +27,3 @@ class Dog */ public $breed; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/EnumArrays.php b/samples/server/petstore/ze-ph/src/App/DTO/EnumArrays.php index b65b4930e1c..f0ba9663716 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/EnumArrays.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/EnumArrays.php @@ -6,7 +6,7 @@ /** */ -class EnumArrays +class EnumArrays { /** * @DTA\Data(field="just_symbol", nullable=true) @@ -23,4 +23,3 @@ class EnumArrays */ public $array_enum; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/EnumClass.php b/samples/server/petstore/ze-ph/src/App/DTO/EnumClass.php index fdef8067f96..2eb9dc5d69c 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/EnumClass.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/EnumClass.php @@ -6,7 +6,6 @@ /** */ -class EnumClass +class EnumClass { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/EnumTest.php b/samples/server/petstore/ze-ph/src/App/DTO/EnumTest.php index 81ae226f7ed..e9a062b6844 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/EnumTest.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/EnumTest.php @@ -6,7 +6,7 @@ /** */ -class EnumTest +class EnumTest { /** * @DTA\Data(field="enum_string", nullable=true) @@ -34,4 +34,3 @@ class EnumTest */ public $outer_enum; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/FormatTest.php b/samples/server/petstore/ze-ph/src/App/DTO/FormatTest.php index e9e8a5b763c..81194340336 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/FormatTest.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/FormatTest.php @@ -6,7 +6,7 @@ /** */ -class FormatTest +class FormatTest { /** * @DTA\Data(field="integer", nullable=true) @@ -63,6 +63,8 @@ class FormatTest public $string; /** * @DTA\Data(field="byte") + * @DTA\Validator(name="Type", options={"type":"string"}) + * @DTA\Validator(name="Regex", options={"pattern":"/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/"}) * @var string */ public $byte; @@ -99,4 +101,3 @@ class FormatTest */ public $password; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/HasOnlyReadOnly.php b/samples/server/petstore/ze-ph/src/App/DTO/HasOnlyReadOnly.php index bef0f049730..84df4d368ec 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/HasOnlyReadOnly.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/HasOnlyReadOnly.php @@ -6,7 +6,7 @@ /** */ -class HasOnlyReadOnly +class HasOnlyReadOnly { /** * @DTA\Data(field="bar", nullable=true) @@ -21,4 +21,3 @@ class HasOnlyReadOnly */ public $foo; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/MapTest.php b/samples/server/petstore/ze-ph/src/App/DTO/MapTest.php index 4437be83ece..96fa07e9541 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/MapTest.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/MapTest.php @@ -6,7 +6,7 @@ /** */ -class MapTest +class MapTest { /** * @DTA\Data(field="map_map_of_string", nullable=true) @@ -21,4 +21,3 @@ class MapTest */ public $map_of_enum_string; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/server/petstore/ze-ph/src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php index 5abdd233466..833543e64d8 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php @@ -6,7 +6,7 @@ /** */ -class MixedPropertiesAndAdditionalPropertiesClass +class MixedPropertiesAndAdditionalPropertiesClass { /** * @DTA\Data(field="uuid", nullable=true) @@ -29,4 +29,3 @@ class MixedPropertiesAndAdditionalPropertiesClass */ public $map; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Model200Response.php b/samples/server/petstore/ze-ph/src/App/DTO/Model200Response.php index 40097a59197..203b90e39c7 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Model200Response.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Model200Response.php @@ -7,7 +7,7 @@ /** * Model for testing model name starting with number */ -class Model200Response +class Model200Response { /** * @DTA\Data(field="name", nullable=true) @@ -22,4 +22,3 @@ class Model200Response */ public $class; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ModelReturn.php b/samples/server/petstore/ze-ph/src/App/DTO/ModelReturn.php index a88a57b2c10..674da073821 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ModelReturn.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ModelReturn.php @@ -7,7 +7,7 @@ /** * Model for testing reserved words */ -class ModelReturn +class ModelReturn { /** * @DTA\Data(field="return", nullable=true) @@ -16,4 +16,3 @@ class ModelReturn */ public $return; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Name.php b/samples/server/petstore/ze-ph/src/App/DTO/Name.php index e830280bb71..6c6fe15a7f2 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Name.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Name.php @@ -7,7 +7,7 @@ /** * Model for testing model name same as property name */ -class Name +class Name { /** * @DTA\Data(field="name") @@ -34,4 +34,3 @@ class Name */ public $_123_number; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/NumberOnly.php b/samples/server/petstore/ze-ph/src/App/DTO/NumberOnly.php index 5fc9f120e18..bbe15f429ba 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/NumberOnly.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/NumberOnly.php @@ -6,7 +6,7 @@ /** */ -class NumberOnly +class NumberOnly { /** * @DTA\Data(field="JustNumber", nullable=true) @@ -15,4 +15,3 @@ class NumberOnly */ public $just_number; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Order.php b/samples/server/petstore/ze-ph/src/App/DTO/Order.php index 0a332d918f1..1e33bdc6cb3 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Order.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Order.php @@ -6,7 +6,7 @@ /** */ -class Order +class Order { /** * @DTA\Data(field="id", nullable=true) @@ -47,4 +47,3 @@ class Order */ public $complete; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/OuterBoolean.php b/samples/server/petstore/ze-ph/src/App/DTO/OuterBoolean.php index 4746e4941a3..0023dda9288 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/OuterBoolean.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/OuterBoolean.php @@ -6,7 +6,6 @@ /** */ -class OuterBoolean +class OuterBoolean { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/OuterComposite.php b/samples/server/petstore/ze-ph/src/App/DTO/OuterComposite.php index a72f0a61047..91e4e596046 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/OuterComposite.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/OuterComposite.php @@ -6,7 +6,7 @@ /** */ -class OuterComposite +class OuterComposite { /** * @DTA\Data(field="my_number", nullable=true) @@ -30,4 +30,3 @@ class OuterComposite */ public $my_boolean; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/OuterEnum.php b/samples/server/petstore/ze-ph/src/App/DTO/OuterEnum.php index d001bf30deb..460a4c4bb3a 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/OuterEnum.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/OuterEnum.php @@ -6,7 +6,6 @@ /** */ -class OuterEnum +class OuterEnum { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/OuterNumber.php b/samples/server/petstore/ze-ph/src/App/DTO/OuterNumber.php index 7f81220333f..f12d79abbdd 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/OuterNumber.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/OuterNumber.php @@ -6,7 +6,6 @@ /** */ -class OuterNumber +class OuterNumber { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/OuterString.php b/samples/server/petstore/ze-ph/src/App/DTO/OuterString.php index 35c3283feac..4f0902502d3 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/OuterString.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/OuterString.php @@ -6,7 +6,6 @@ /** */ -class OuterString +class OuterString { } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Pet.php b/samples/server/petstore/ze-ph/src/App/DTO/Pet.php index a4f3af164f2..ca54fbc570c 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Pet.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Pet.php @@ -6,7 +6,7 @@ /** */ -class Pet +class Pet { /** * @DTA\Data(field="id", nullable=true) @@ -52,4 +52,3 @@ class Pet */ public $status; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/ReadOnlyFirst.php b/samples/server/petstore/ze-ph/src/App/DTO/ReadOnlyFirst.php index 297b27017e2..5bec02d6511 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/ReadOnlyFirst.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/ReadOnlyFirst.php @@ -6,7 +6,7 @@ /** */ -class ReadOnlyFirst +class ReadOnlyFirst { /** * @DTA\Data(field="bar", nullable=true) @@ -21,4 +21,3 @@ class ReadOnlyFirst */ public $baz; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/SpecialModelName.php b/samples/server/petstore/ze-ph/src/App/DTO/SpecialModelName.php index 964cca083fc..84b1a4f595a 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/SpecialModelName.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/SpecialModelName.php @@ -6,7 +6,7 @@ /** */ -class SpecialModelName +class SpecialModelName { /** * @DTA\Data(field="$special[property.name]", nullable=true) @@ -15,4 +15,3 @@ class SpecialModelName */ public $special_property_name; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/Tag.php b/samples/server/petstore/ze-ph/src/App/DTO/Tag.php index 7ba6ac01c2b..530bc395613 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/Tag.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/Tag.php @@ -6,7 +6,7 @@ /** */ -class Tag +class Tag { /** * @DTA\Data(field="id", nullable=true) @@ -21,4 +21,3 @@ class Tag */ public $name; } - diff --git a/samples/server/petstore/ze-ph/src/App/DTO/User.php b/samples/server/petstore/ze-ph/src/App/DTO/User.php index 745b8206dd6..09c44d7a551 100644 --- a/samples/server/petstore/ze-ph/src/App/DTO/User.php +++ b/samples/server/petstore/ze-ph/src/App/DTO/User.php @@ -6,7 +6,7 @@ /** */ -class User +class User { /** * @DTA\Data(field="id", nullable=true) @@ -58,4 +58,3 @@ class User */ public $user_status; } - diff --git a/samples/server/petstore/ze-ph/src/App/ErrorMiddleware.php b/samples/server/petstore/ze-ph/src/App/ErrorMiddleware.php deleted file mode 100644 index 0605e519f42..00000000000 --- a/samples/server/petstore/ze-ph/src/App/ErrorMiddleware.php +++ /dev/null @@ -1,20 +0,0 @@ -withStatus(500, 'Internal server error'); - $response->getBody()->write((string)$error); - error_log((string) $error); - return ($out === null)? $response : $out($request, $response); - } -} \ No newline at end of file diff --git a/samples/server/petstore/ze-ph/src/App/Handler/Fake.php b/samples/server/petstore/ze-ph/src/App/Handler/Fake.php index 592f153ca87..71ba8700f06 100644 --- a/samples/server/petstore/ze-ph/src/App/Handler/Fake.php +++ b/samples/server/petstore/ze-ph/src/App/Handler/Fake.php @@ -10,7 +10,6 @@ use Articus\PathHandler\Exception as PHException; use Psr\Http\Message\ServerRequestInterface; - class Fake implements Operation\PatchInterface, Operation\PostInterface, Operation\GetInterface { /** @@ -20,6 +19,10 @@ class Fake implements Operation\PatchInterface, Operation\PostInterface, Operati * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\Client::class,"objectAttr":"body"}) * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json") + * @param ServerRequestInterface $request + * + * @throws PHException\HttpCode 500 if the method is not implemented + * * @return \App\DTO\Client */ public function handlePatch(ServerRequestInterface $request) @@ -35,6 +38,9 @@ public function handlePatch(ServerRequestInterface $request) * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml; charset=utf-8") * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json; charset=utf-8") + * @param ServerRequestInterface $request + * + * @throws PHException\HttpCode 500 if the method is not implemented */ public function handlePost(ServerRequestInterface $request) { @@ -45,6 +51,9 @@ public function handlePost(ServerRequestInterface $request) * To test enum parameters * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="*/*") + * @param ServerRequestInterface $request + * + * @throws PHException\HttpCode 500 if the method is not implemented */ public function handleGet(ServerRequestInterface $request) { diff --git a/samples/server/petstore/ze-ph/src/App/Handler/FakeClassnameTest.php b/samples/server/petstore/ze-ph/src/App/Handler/FakeClassnameTest.php new file mode 100644 index 00000000000..afd81f25733 --- /dev/null +++ b/samples/server/petstore/ze-ph/src/App/Handler/FakeClassnameTest.php @@ -0,0 +1,35 @@ +getAttribute("body"); + throw new PHException\HttpCode(500, "Not implemented"); + } +} diff --git a/samples/server/petstore/ze-ph/src/App/Handler/FakeJsonFormData.php b/samples/server/petstore/ze-ph/src/App/Handler/FakeJsonFormData.php new file mode 100644 index 00000000000..bc13c0b69dc --- /dev/null +++ b/samples/server/petstore/ze-ph/src/App/Handler/FakeJsonFormData.php @@ -0,0 +1,26 @@ +type)); } } -} \ No newline at end of file +} From 8698444fb259b876077ca605fc075f7e6b694683 Mon Sep 17 00:00:00 2001 From: WendellDuncan Date: Sat, 23 Sep 2017 01:32:29 -0600 Subject: [PATCH 044/197] Propsed fix for the ApiClient runtime crash (#6523) --- .../main/resources/cpprest/apiclient-source.mustache | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache index 59ca1c180f8..b3a3e075a7d 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache @@ -124,7 +124,10 @@ pplx::task ApiClient::callApi( { body_data[kvp.first] = ModelBase::toJson(kvp.second); } - request.set_body(body_data); + if (!formParams.empty()) + { + request.set_body(body_data); + } } else { @@ -133,7 +136,10 @@ pplx::task ApiClient::callApi( { formData.append_query(kvp.first, kvp.second); } - request.set_body(formData.query(), U("application/x-www-form-urlencoded")); + if (!formParams.empty()) + { + request.set_body(formData.query(), U("application/x-www-form-urlencoded")); + } } } } From b1e7a4f7242bae5cac1c450b8093a41a45f06fd7 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 23 Sep 2017 15:45:17 +0800 Subject: [PATCH 045/197] update cpprest petstore samples --- samples/client/petstore/cpprest/ApiClient.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/cpprest/ApiClient.cpp b/samples/client/petstore/cpprest/ApiClient.cpp index dc53f212966..f6e5f11af55 100644 --- a/samples/client/petstore/cpprest/ApiClient.cpp +++ b/samples/client/petstore/cpprest/ApiClient.cpp @@ -136,7 +136,10 @@ pplx::task ApiClient::callApi( { body_data[kvp.first] = ModelBase::toJson(kvp.second); } - request.set_body(body_data); + if (!formParams.empty()) + { + request.set_body(body_data); + } } else { @@ -145,7 +148,10 @@ pplx::task ApiClient::callApi( { formData.append_query(kvp.first, kvp.second); } - request.set_body(formData.query(), U("application/x-www-form-urlencoded")); + if (!formParams.empty()) + { + request.set_body(formData.query(), U("application/x-www-form-urlencoded")); + } } } } From 07df0759d325786bebdfb2a55544bda683b9dfc2 Mon Sep 17 00:00:00 2001 From: stoetti <31430612+stoetti@users.noreply.github.com> Date: Sat, 23 Sep 2017 09:48:05 +0200 Subject: [PATCH 046/197] [TypeScript][Angular] Better support for "Accept", "Content-Type" (#6454) * add consumes and produces as corresponding headers if present * add check for empty array fix copy/paste error * fix styling * add isJsonMime filter produces- and consumes-Arrays for json-mime items --- .../typescript-angular/api.service.mustache | 14 +++++++ .../default/api/pet.service.ts | 42 +++++++++++++++++++ .../default/api/store.service.ts | 16 +++++++ .../default/api/user.service.ts | 32 ++++++++++++++ .../npm/api/pet.service.ts | 42 +++++++++++++++++++ .../npm/api/store.service.ts | 16 +++++++ .../npm/api/user.service.ts | 32 ++++++++++++++ .../with-interfaces/api/pet.service.ts | 42 +++++++++++++++++++ .../with-interfaces/api/store.service.ts | 16 +++++++ .../with-interfaces/api/user.service.ts | 32 ++++++++++++++ 10 files changed, 284 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 5da473f5ccb..3c59792963a 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -78,6 +78,11 @@ export class {{classname}} { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + {{#operation}} /** * {{¬es}} @@ -175,6 +180,11 @@ export class {{classname}} { '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/consumes}} ]; + + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; {{#formParams}} @@ -194,6 +204,10 @@ export class {{classname}} { {{/produces}} ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + {{#authMethods}} // authentication ({{name}}) required {{#isApiKey}} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index b05fe8fc637..e4937a071c6 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -230,6 +230,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -285,6 +289,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -335,6 +343,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -385,6 +397,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -432,6 +448,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -474,6 +494,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -523,6 +547,11 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; let formParams = new (useForm ? FormData : URLSearchParams as any)() as { @@ -535,6 +564,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -590,6 +623,11 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -602,6 +640,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 8765ad7c4a9..7044e00d1dd 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -160,6 +160,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -191,6 +195,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -234,6 +242,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -271,6 +283,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 4322a11f7ef..07057355f0c 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -225,6 +225,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -265,6 +269,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -305,6 +313,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -346,6 +358,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -384,6 +400,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -434,6 +454,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -466,6 +490,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -509,6 +537,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index b05fe8fc637..e4937a071c6 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -230,6 +230,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -285,6 +289,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -335,6 +343,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -385,6 +397,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -432,6 +448,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -474,6 +494,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -523,6 +547,11 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; let formParams = new (useForm ? FormData : URLSearchParams as any)() as { @@ -535,6 +564,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -590,6 +623,11 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -602,6 +640,10 @@ export class PetService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 8765ad7c4a9..7044e00d1dd 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -160,6 +160,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -191,6 +195,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -234,6 +242,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -271,6 +283,10 @@ export class StoreService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 4322a11f7ef..07057355f0c 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -225,6 +225,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -265,6 +269,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -305,6 +313,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -346,6 +358,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -384,6 +400,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -434,6 +454,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -466,6 +490,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -509,6 +537,10 @@ export class UserService { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index cfba1741216..cfcf1c48b7e 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -231,6 +231,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -286,6 +290,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -336,6 +344,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -386,6 +398,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -433,6 +449,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -475,6 +495,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -524,6 +548,11 @@ export class PetService implements PetServiceInterface { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; let formParams = new (useForm ? FormData : URLSearchParams as any)() as { @@ -536,6 +565,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -591,6 +624,11 @@ export class PetService implements PetServiceInterface { let consumes: string[] = [ 'multipart/form-data' ]; + + if ((consumes != null) && (consumes.length > 0)) { + headers.set('Content-Type', consumes.join(';')); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -603,6 +641,10 @@ export class PetService implements PetServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 6a3d0fc745c..b6edf9a45ad 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -161,6 +161,10 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -192,6 +196,10 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -235,6 +243,10 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -272,6 +284,10 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 593c8d71a92..706562c088b 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -226,6 +226,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -266,6 +270,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -306,6 +314,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -347,6 +359,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -385,6 +401,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -435,6 +455,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -467,6 +491,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -510,6 +538,10 @@ export class UserService implements UserServiceInterface { 'application/json' ]; + if ((produces != null) && (produces.length > 0)) { + headers.set('Accept', produces.join(';')); + } + headers.set('Content-Type', 'application/json'); From 16678b810698ab05e02c45df7992586903957bba Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 23 Sep 2017 15:55:14 +0800 Subject: [PATCH 047/197] update ts angular v2, v4 petstore samples --- .../default/api/pet.service.ts | 45 ++++++++++-------- .../default/api/store.service.ts | 21 +++++---- .../default/api/user.service.ts | 37 ++++++++------- .../npm/api/pet.service.ts | 45 ++++++++++-------- .../npm/api/store.service.ts | 21 +++++---- .../npm/api/user.service.ts | 37 ++++++++------- .../with-interfaces/api/pet.service.ts | 45 ++++++++++-------- .../with-interfaces/api/store.service.ts | 21 +++++---- .../with-interfaces/api/user.service.ts | 37 ++++++++------- .../npm/api/pet.service.ts | 47 +++++++++++++++++++ .../npm/api/store.service.ts | 21 +++++++++ .../npm/api/user.service.ts | 37 +++++++++++++++ 12 files changed, 282 insertions(+), 132 deletions(-) diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index e4937a071c6..25b50dd7546 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -74,6 +74,11 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * * @summary Add a new pet to the store @@ -230,8 +235,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -289,8 +294,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -343,8 +348,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -397,8 +402,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -448,8 +453,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -494,8 +499,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -548,8 +553,8 @@ export class PetService { 'application/x-www-form-urlencoded' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -564,8 +569,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -624,8 +629,8 @@ export class PetService { 'multipart/form-data' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -640,8 +645,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 7044e00d1dd..1dd4980e43b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -73,6 +73,11 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID @@ -160,8 +165,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -195,8 +200,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -242,8 +247,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -283,8 +288,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 07057355f0c..4f24303f502 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -73,6 +73,11 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * This can only be done by the logged in user. * @summary Create user @@ -225,8 +230,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -269,8 +274,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -313,8 +318,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -358,8 +363,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -400,8 +405,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -454,8 +459,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -490,8 +495,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -537,8 +542,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index e4937a071c6..25b50dd7546 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -74,6 +74,11 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * * @summary Add a new pet to the store @@ -230,8 +235,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -289,8 +294,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -343,8 +348,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -397,8 +402,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -448,8 +453,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -494,8 +499,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -548,8 +553,8 @@ export class PetService { 'application/x-www-form-urlencoded' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -564,8 +569,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -624,8 +629,8 @@ export class PetService { 'multipart/form-data' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -640,8 +645,8 @@ export class PetService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 7044e00d1dd..1dd4980e43b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -73,6 +73,11 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID @@ -160,8 +165,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -195,8 +200,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -242,8 +247,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -283,8 +288,8 @@ export class StoreService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 07057355f0c..4f24303f502 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -73,6 +73,11 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * This can only be done by the logged in user. * @summary Create user @@ -225,8 +230,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -269,8 +274,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -313,8 +318,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -358,8 +363,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -400,8 +405,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -454,8 +459,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -490,8 +495,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -537,8 +542,8 @@ export class UserService { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index cfcf1c48b7e..10bac669298 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -75,6 +75,11 @@ export class PetService implements PetServiceInterface { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * * @summary Add a new pet to the store @@ -231,8 +236,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -290,8 +295,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -344,8 +349,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -398,8 +403,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -449,8 +454,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -495,8 +500,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -549,8 +554,8 @@ export class PetService implements PetServiceInterface { 'application/x-www-form-urlencoded' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -565,8 +570,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required @@ -625,8 +630,8 @@ export class PetService implements PetServiceInterface { 'multipart/form-data' ]; - if ((consumes != null) && (consumes.length > 0)) { - headers.set('Content-Type', consumes.join(';')); + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); } let canConsumeForm = this.canConsumeForm(consumes); @@ -641,8 +646,8 @@ export class PetService implements PetServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (petstore_auth) required diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index b6edf9a45ad..32577dab35f 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -74,6 +74,11 @@ export class StoreService implements StoreServiceInterface { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID @@ -161,8 +166,8 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -196,8 +201,8 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } // authentication (api_key) required @@ -243,8 +248,8 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -284,8 +289,8 @@ export class StoreService implements StoreServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 706562c088b..5765c284b3e 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -74,6 +74,11 @@ export class UserService implements UserServiceInterface { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * This can only be done by the logged in user. * @summary Create user @@ -226,8 +231,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -270,8 +275,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -314,8 +319,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -359,8 +364,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -401,8 +406,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -455,8 +460,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -491,8 +496,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } @@ -538,8 +543,8 @@ export class UserService implements UserServiceInterface { 'application/json' ]; - if ((produces != null) && (produces.length > 0)) { - headers.set('Accept', produces.join(';')); + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index b05fe8fc637..25b50dd7546 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -74,6 +74,11 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * * @summary Add a new pet to the store @@ -230,6 +235,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -285,6 +294,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -335,6 +348,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -385,6 +402,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -432,6 +453,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -474,6 +499,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -523,6 +552,11 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; + + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; let formParams = new (useForm ? FormData : URLSearchParams as any)() as { @@ -535,6 +569,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { @@ -590,6 +628,11 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; + + if (consumes != null && consumes.length > 0) { + headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); + } + let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -602,6 +645,10 @@ export class PetService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (petstore_auth) required // oauth required if (this.configuration.accessToken) { diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 8765ad7c4a9..1dd4980e43b 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -73,6 +73,11 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID @@ -160,6 +165,10 @@ export class StoreService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -191,6 +200,10 @@ export class StoreService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); @@ -234,6 +247,10 @@ export class StoreService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -271,6 +288,10 @@ export class StoreService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + headers.set('Content-Type', 'application/json'); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 4322a11f7ef..4f24303f502 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -73,6 +73,11 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + /** * This can only be done by the logged in user. * @summary Create user @@ -225,6 +230,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -265,6 +274,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -305,6 +318,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + headers.set('Content-Type', 'application/json'); @@ -346,6 +363,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -384,6 +405,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -434,6 +459,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -466,6 +495,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -509,6 +542,10 @@ export class UserService { 'application/json' ]; + if (produces != null && produces.length > 0) { + headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); + } + headers.set('Content-Type', 'application/json'); From 1baa5fca45e43436e55c1dc29d81666a15bcc6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Sat, 23 Sep 2017 04:57:48 -0400 Subject: [PATCH 048/197] [Typescript-jQuery] Fix for issue #6505 (#6541) * Fix that prevented the default version to generate the model files * Add generated samples --- .../src/main/resources/typescript-jquery/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5acab55f344..2191d52f965 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache @@ -103,7 +103,7 @@ export class {{classname}} { {{#formParams}} {{#isFile}} reqHasFile = true; - formParams = {{paramName}}; + formParams.append("{{baseName}}", {{paramName}}); {{/isFile}} {{^isFile}} {{#isListContainer}} From 209158aa9d3f6a4f5be6d94f41d472eea1992a42 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 23 Sep 2017 17:07:21 +0800 Subject: [PATCH 049/197] update ts jquery petstore samples --- samples/client/petstore/typescript-jquery/default/api/PetApi.ts | 2 +- samples/client/petstore/typescript-jquery/npm/api/PetApi.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts index ef7f615f690..3a2844ef25c 100644 --- a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts @@ -514,7 +514,7 @@ export class PetApi { formParams.append('additionalMetadata', additionalMetadata); } reqHasFile = true; - formParams = file; + formParams.append("file", file); // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index ef7f615f690..3a2844ef25c 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -514,7 +514,7 @@ export class PetApi { formParams.append('additionalMetadata', additionalMetadata); } reqHasFile = true; - formParams = file; + formParams.append("file", file); // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' From 4a89d236192631ee29b1ba871805335910e19b8b Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Sat, 23 Sep 2017 11:23:45 +0200 Subject: [PATCH 050/197] [typescript-angular] apply encodeURIComponent to path-parameter (#6525) * #6524: [typescript-angular] apply encodeURIComponent to path-parameter * #6524: [typescript-angular2] update samples * #6524: [typescript-angularjs] update samples --- .../resources/typescript-angular/api.service.mustache | 2 +- .../src/main/resources/typescript-angularjs/api.mustache | 2 +- .../typescript-angular-v2/default/api/pet.service.ts | 8 ++++---- .../typescript-angular-v2/default/api/store.service.ts | 4 ++-- .../typescript-angular-v2/default/api/user.service.ts | 6 +++--- .../petstore/typescript-angular-v2/npm/api/pet.service.ts | 8 ++++---- .../typescript-angular-v2/npm/api/store.service.ts | 4 ++-- .../typescript-angular-v2/npm/api/user.service.ts | 6 +++--- .../with-interfaces/api/pet.service.ts | 8 ++++---- .../with-interfaces/api/store.service.ts | 4 ++-- .../with-interfaces/api/user.service.ts | 6 +++--- .../client/petstore/typescript-angularjs/api/PetApi.ts | 8 ++++---- .../client/petstore/typescript-angularjs/api/StoreApi.ts | 4 ++-- .../client/petstore/typescript-angularjs/api/UserApi.ts | 6 +++--- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 3c59792963a..376a6d6602f 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -122,7 +122,7 @@ export class {{classname}} { {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { const path = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + .replace('${' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache index 3027c399afb..b6aa0b6ae96 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache @@ -33,7 +33,7 @@ export class {{classname}} { {{/allParams}}*/ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 25b50dd7546..b1bf4505cc5 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -274,7 +274,7 @@ export class PetService { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -437,7 +437,7 @@ export class PetService { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -539,7 +539,7 @@ export class PetService { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -615,7 +615,7 @@ export class PetService { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 1dd4980e43b..3610483fd6b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -149,7 +149,7 @@ export class StoreService { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -231,7 +231,7 @@ export class StoreService { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 4f24303f502..d608c6a4c27 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -347,7 +347,7 @@ export class UserService { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -389,7 +389,7 @@ export class UserService { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -522,7 +522,7 @@ export class UserService { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 25b50dd7546..b1bf4505cc5 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -274,7 +274,7 @@ export class PetService { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -437,7 +437,7 @@ export class PetService { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -539,7 +539,7 @@ export class PetService { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -615,7 +615,7 @@ export class PetService { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 1dd4980e43b..3610483fd6b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -149,7 +149,7 @@ export class StoreService { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -231,7 +231,7 @@ export class StoreService { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 4f24303f502..d608c6a4c27 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -347,7 +347,7 @@ export class UserService { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -389,7 +389,7 @@ export class UserService { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -522,7 +522,7 @@ export class UserService { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 10bac669298..775efa6b32d 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -275,7 +275,7 @@ export class PetService implements PetServiceInterface { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -438,7 +438,7 @@ export class PetService implements PetServiceInterface { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -540,7 +540,7 @@ export class PetService implements PetServiceInterface { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -616,7 +616,7 @@ export class PetService implements PetServiceInterface { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 32577dab35f..2c715fbab7c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -150,7 +150,7 @@ export class StoreService implements StoreServiceInterface { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -232,7 +232,7 @@ export class StoreService implements StoreServiceInterface { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 5765c284b3e..0448df9297c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -348,7 +348,7 @@ export class UserService implements UserServiceInterface { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -390,7 +390,7 @@ export class UserService implements UserServiceInterface { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -523,7 +523,7 @@ export class UserService implements UserServiceInterface { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angularjs/api/PetApi.ts b/samples/client/petstore/typescript-angularjs/api/PetApi.ts index eedcbb36425..a830833d94b 100644 --- a/samples/client/petstore/typescript-angularjs/api/PetApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/PetApi.ts @@ -62,7 +62,7 @@ export class PetApi { */ public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -154,7 +154,7 @@ export class PetApi { */ public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -212,7 +212,7 @@ export class PetApi { */ public updatePetWithForm (petId: number, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -251,7 +251,7 @@ export class PetApi { */ public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts index 3946a8d47a8..93199134ab8 100644 --- a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts @@ -33,7 +33,7 @@ export class StoreApi { */ public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -83,7 +83,7 @@ export class StoreApi { */ public getOrderById (orderId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angularjs/api/UserApi.ts b/samples/client/petstore/typescript-angularjs/api/UserApi.ts index 74092f7541f..903abecb803 100644 --- a/samples/client/petstore/typescript-angularjs/api/UserApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/UserApi.ts @@ -117,7 +117,7 @@ export class UserApi { */ public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -145,7 +145,7 @@ export class UserApi { */ public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -236,7 +236,7 @@ export class UserApi { */ public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); From 8f8515486fa073b835b9cc56ed262e92356c18df Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sat, 23 Sep 2017 22:36:05 +0900 Subject: [PATCH 051/197] [PHP] Improve Model template (#6460) * Update samples ./bin/php-petstore.sh * Remove unnecessary implements entry ModelInterface, ArrayAccess are already implemented in parent * Remove field `container` which is already defined in parent * Change snake case to lower camel case - invalid_properties - allowed_values * Improve doc commenct style * Improve description length * Improve length * Doc comment short description must start with a capital letter * Add a line between @param and @return * Delete an additinal blank line at end of doc comment * Udpate petstore-security-test --- .../src/main/resources/php/model.mustache | 11 +- .../main/resources/php/model_generic.mustache | 97 +++++++----- .../resources/php/partial_header.mustache | 1 - .../php/SwaggerClient-php/lib/Api/FakeApi.php | 1 - .../SwaggerClient-php/lib/ApiException.php | 1 - .../SwaggerClient-php/lib/Configuration.php | 1 - .../SwaggerClient-php/lib/HeaderSelector.php | 1 - .../lib/Model/ModelReturn.php | 62 +++++--- .../lib/ObjectSerializer.php | 1 - .../php/SwaggerClient-php/docs/Api/FakeApi.md | 2 +- .../SwaggerClient-php/docs/Api/StoreApi.md | 2 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 5 +- .../lib/Api/FakeClassnameTags123Api.php | 1 - .../php/SwaggerClient-php/lib/Api/PetApi.php | 1 - .../SwaggerClient-php/lib/Api/StoreApi.php | 1 - .../php/SwaggerClient-php/lib/Api/UserApi.php | 1 - .../SwaggerClient-php/lib/ApiException.php | 1 - .../SwaggerClient-php/lib/Configuration.php | 1 - .../SwaggerClient-php/lib/HeaderSelector.php | 1 - .../lib/Model/AdditionalPropertiesClass.php | 65 +++++--- .../SwaggerClient-php/lib/Model/Animal.php | 67 +++++--- .../lib/Model/AnimalFarm.php | 59 ++++--- .../lib/Model/ApiResponse.php | 68 ++++++--- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 62 +++++--- .../lib/Model/ArrayOfNumberOnly.php | 62 +++++--- .../SwaggerClient-php/lib/Model/ArrayTest.php | 68 ++++++--- .../lib/Model/Capitalization.php | 77 +++++++--- .../php/SwaggerClient-php/lib/Model/Cat.php | 70 +++++---- .../SwaggerClient-php/lib/Model/Category.php | 65 +++++--- .../lib/Model/ClassModel.php | 62 +++++--- .../SwaggerClient-php/lib/Model/Client.php | 62 +++++--- .../php/SwaggerClient-php/lib/Model/Dog.php | 70 +++++---- .../lib/Model/EnumArrays.php | 91 +++++++---- .../SwaggerClient-php/lib/Model/EnumClass.php | 10 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 128 ++++++++++------ .../lib/Model/FormatTest.php | 144 ++++++++++++------ .../lib/Model/HasOnlyReadOnly.php | 65 +++++--- .../SwaggerClient-php/lib/Model/MapTest.php | 72 ++++++--- ...PropertiesAndAdditionalPropertiesClass.php | 68 ++++++--- .../lib/Model/Model200Response.php | 65 +++++--- .../SwaggerClient-php/lib/Model/ModelList.php | 62 +++++--- .../lib/Model/ModelReturn.php | 62 +++++--- .../php/SwaggerClient-php/lib/Model/Name.php | 73 ++++++--- .../lib/Model/NumberOnly.php | 62 +++++--- .../php/SwaggerClient-php/lib/Model/Order.php | 96 ++++++++---- .../lib/Model/OuterBoolean.php | 59 ++++--- .../lib/Model/OuterComposite.php | 68 ++++++--- .../SwaggerClient-php/lib/Model/OuterEnum.php | 10 +- .../lib/Model/OuterNumber.php | 59 ++++--- .../lib/Model/OuterString.php | 59 ++++--- .../php/SwaggerClient-php/lib/Model/Pet.php | 100 ++++++++---- .../lib/Model/ReadOnlyFirst.php | 65 +++++--- .../lib/Model/SpecialModelName.php | 62 +++++--- .../php/SwaggerClient-php/lib/Model/Tag.php | 65 +++++--- .../php/SwaggerClient-php/lib/Model/User.php | 83 +++++++--- .../lib/ObjectSerializer.php | 1 - 56 files changed, 1872 insertions(+), 806 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 136f05e2c0e..9382cfa5ff5 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -21,20 +21,23 @@ namespace {{modelPackage}}; {{^isEnum}} +{{^parentSchema}} use \ArrayAccess; +{{/parentSchema}} {{/isEnum}} +use \{{invokerPackage}}\ObjectSerializer; /** * {{classname}} Class Doc Comment * - * @category Class + * @category Class {{#description}} * @description {{description}} {{/description}} - * @package {{invokerPackage}} - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} {{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 274fb7176e1..8305a7d293b 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -1,15 +1,17 @@ -class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}implements ModelInterface, ArrayAccess +class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess{{/parentSchema}} { const DISCRIMINATOR = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = '{{name}}'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -19,6 +21,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -47,7 +50,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -57,6 +62,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -66,6 +72,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -74,7 +81,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -119,6 +127,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{#vars}}{{#isEnum}} /** * Gets allowable values of the enum + * * @return string[] */ public function {{getter}}AllowableValues() @@ -130,15 +139,20 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple } {{/isEnum}}{{/vars}} + {{^parentSchema}} /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; + {{/parentSchema}} /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -165,25 +179,25 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple public function listInvalidProperties() { {{#parent}} - $invalid_properties = parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); {{/parent}} {{^parent}} - $invalid_properties = []; + $invalidProperties = []; {{/parent}} {{#vars}} {{#required}} if ($this->container['{{name}}'] === null) { - $invalid_properties[] = "'{{name}}' can't be null"; + $invalidProperties[] = "'{{name}}' can't be null"; } {{/required}} {{#isEnum}} {{^isContainer}} - $allowed_values = $this->{{getter}}AllowableValues(); - if (!in_array($this->container['{{name}}'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->{{getter}}AllowableValues(); + if (!in_array($this->container['{{name}}'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } @@ -192,53 +206,53 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{#hasValidation}} {{#maxLength}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) > {{maxLength}})) { - $invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; + $invalidProperties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; } {{/maxLength}} {{#minLength}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) < {{minLength}})) { - $invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; + $invalidProperties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; } {{/minLength}} {{#maximum}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { - $invalid_properties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}."; + $invalidProperties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}."; } {{/maximum}} {{#minimum}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { - $invalid_properties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}."; + $invalidProperties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}."; } {{/minimum}} {{#pattern}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{{pattern}}}", $this->container['{{name}}'])) { - $invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}."; + $invalidProperties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}."; } {{/pattern}} {{#maxItems}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) > {{maxItems}})) { - $invalid_properties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}."; + $invalidProperties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}."; } {{/maxItems}} {{#minItems}} if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) < {{minItems}})) { - $invalid_properties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}."; + $invalidProperties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}."; } {{/minItems}} {{/hasValidation}} {{/vars}} - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -259,8 +273,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{/required}} {{#isEnum}} {{^isContainer}} - $allowed_values = $this->{{getter}}AllowableValues(); - if (!in_array($this->container['{{name}}'], $allowed_values)) { + $allowedValues = $this->{{getter}}AllowableValues(); + if (!in_array($this->container['{{name}}'], $allowedValues)) { return false; } {{/isContainer}} @@ -310,6 +324,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Gets {{name}} + * * @return {{datatype}} */ public function {{getter}}() @@ -319,29 +334,31 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Sets {{name}} + * * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}} + * * @return $this */ public function {{setter}}(${{name}}) { {{#isEnum}} - $allowed_values = $this->{{getter}}AllowableValues(); + $allowedValues = $this->{{getter}}AllowableValues(); {{^isContainer}} - if ({{^required}}!is_null(${{name}}) && {{/required}}!in_array(${{{name}}}, $allowed_values)) { + if ({{^required}}!is_null(${{name}}) && {{/required}}!in_array(${{{name}}}, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } {{/isContainer}} {{#isContainer}} - if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowed_values)) { + if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -389,7 +406,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{/vars}} /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -399,7 +418,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -409,8 +430,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -424,7 +447,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -434,14 +459,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/modules/swagger-codegen/src/main/resources/php/partial_header.mustache b/modules/swagger-codegen/src/main/resources/php/partial_header.mustache index 810c48d3122..dafd3b3f35f 100644 --- a/modules/swagger-codegen/src/main/resources/php/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/php/partial_header.mustache @@ -10,5 +10,4 @@ * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ 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 b5ea0314811..c6ca2196346 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,6 @@ * 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 - * */ /** 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 752176f5cd7..b12b72fe296 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,6 @@ * 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 - * */ /** 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 723aedf111d..3fd2131e3da 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,6 @@ * 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 - * */ /** 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 a12b0f6e1ed..cd0ee96168b 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,6 @@ * 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 - * */ /** 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 c106c8bb544..a2038fd14c4 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,6 @@ * 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 - * */ /** @@ -30,15 +29,16 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ModelReturn Class Doc Comment * - * @category Class + * @category Class * @description Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ModelReturn implements ModelInterface, ArrayAccess { @@ -46,12 +46,14 @@ class ModelReturn implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Return'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class ModelReturn implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -87,7 +90,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,6 +101,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,6 +110,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,7 +118,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -156,13 +164,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -176,13 +187,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -196,6 +207,7 @@ public function valid() /** * Gets return + * * @return int */ public function getReturn() @@ -205,7 +217,9 @@ public function getReturn() /** * Sets return + * * @param int $return property description *_/ ' \" =end -- \\r\\n \\n \\r + * * @return $this */ public function setReturn($return) @@ -216,7 +230,9 @@ public function setReturn($return) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -226,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -236,8 +254,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -251,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -261,15 +283,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 be925b47fde..e7b40fe74bb 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,6 @@ * 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 - * */ /** 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 20958d97da2..1691f3d27a8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -259,7 +259,7 @@ $api_instance = new Swagger\Client\Api\FakeApi(new \Http\Adapter\Guzzle6\Client( $number = 3.4; // float | None $double = 1.2; // double | None $pattern_without_delimiter = "pattern_without_delimiter_example"; // string | None -$byte = "byte_example"; // string | None +$byte = "B"; // string | None $integer = 56; // int | None $int32 = 56; // int | None $int64 = 789; // int | None diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 9daa65eba7b..a377df225db 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -87,7 +87,7 @@ This endpoint does not need any parameter. ### Return type -**map[string,int]** +[**map[string,int]**](../Model/map.md) ### Authorization 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 02d38b61bbb..ac6c71e1178 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -1380,8 +1379,8 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with if ($pattern_without_delimiter === null) { throw new \InvalidArgumentException('Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters'); } - if (!preg_match("/^[A-Z].*/", $pattern_without_delimiter)) { - throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/."); + if (!preg_match("/^[A-Z].*_/", $pattern_without_delimiter)) { + throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*_/."); } // verify the required parameter 'byte' is set 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 8ebf5fd83f3..9377a1ee421 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** 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 e2ab3e4713f..989219ad924 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** 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 56ad01aa62f..5cd336fe458 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** 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 27f7220ed8a..321aa41ac75 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 95acee508bc..48039762e9c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -17,7 +17,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index a65232cdf78..fc2edcd805d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -17,7 +17,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php index 77cee4dd319..f8b77a0eb8d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php @@ -17,7 +17,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** 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 caf058f1fcf..b7aa6634edb 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * AdditionalPropertiesClass Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'AdditionalPropertiesClass'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -181,13 +192,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -201,6 +212,7 @@ public function valid() /** * Gets map_property + * * @return map[string,string] */ public function getMapProperty() @@ -210,7 +222,9 @@ public function getMapProperty() /** * Sets map_property + * * @param map[string,string] $map_property + * * @return $this */ public function setMapProperty($map_property) @@ -222,6 +236,7 @@ public function setMapProperty($map_property) /** * Gets map_of_map_property + * * @return map[string,map[string,string]] */ public function getMapOfMapProperty() @@ -231,7 +246,9 @@ public function getMapOfMapProperty() /** * Sets map_of_map_property + * * @param map[string,map[string,string]] $map_of_map_property + * * @return $this */ public function setMapOfMapProperty($map_of_map_property) @@ -242,7 +259,9 @@ public function setMapOfMapProperty($map_of_map_property) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -252,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -262,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -277,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -287,15 +312,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 f2bd0b6ceb1..ef8f4146bfc 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Animal Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Animal implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Animal implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Animal'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class Animal implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -185,16 +196,16 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['class_name'] === null) { - $invalid_properties[] = "'class_name' can't be null"; + $invalidProperties[] = "'class_name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -211,6 +222,7 @@ public function valid() /** * Gets class_name + * * @return string */ public function getClassName() @@ -220,7 +232,9 @@ public function getClassName() /** * Sets class_name + * * @param string $class_name + * * @return $this */ public function setClassName($class_name) @@ -232,6 +246,7 @@ public function setClassName($class_name) /** * Gets color + * * @return string */ public function getColor() @@ -241,7 +256,9 @@ public function getColor() /** * Sets color + * * @param string $color + * * @return $this */ public function setColor($color) @@ -252,7 +269,9 @@ public function setColor($color) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -262,7 +281,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -272,8 +293,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -287,7 +310,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -297,15 +322,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 114b1a361a6..0e5d40ee16d 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * AnimalFarm Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class AnimalFarm implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class AnimalFarm implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'AnimalFarm'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class AnimalFarm implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -174,13 +185,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -196,7 +207,9 @@ public function valid() /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -206,7 +219,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -216,8 +231,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -231,7 +248,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -241,15 +260,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 e0dc3eedde7..abdad1f0abf 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ApiResponse Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ApiResponse implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ApiResponse implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ApiResponse'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +63,7 @@ class ApiResponse implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -90,7 +93,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,6 +106,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -111,6 +117,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -120,7 +127,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -165,13 +173,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -187,13 +198,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -207,6 +218,7 @@ public function valid() /** * Gets code + * * @return int */ public function getCode() @@ -216,7 +228,9 @@ public function getCode() /** * Sets code + * * @param int $code + * * @return $this */ public function setCode($code) @@ -228,6 +242,7 @@ public function setCode($code) /** * Gets type + * * @return string */ public function getType() @@ -237,7 +252,9 @@ public function getType() /** * Sets type + * * @param string $type + * * @return $this */ public function setType($type) @@ -249,6 +266,7 @@ public function setType($type) /** * Gets message + * * @return string */ public function getMessage() @@ -258,7 +276,9 @@ public function getMessage() /** * Sets message + * * @param string $message + * * @return $this */ public function setMessage($message) @@ -269,7 +289,9 @@ public function setMessage($message) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -279,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -289,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -304,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -314,15 +342,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 da549dea222..bbe57d45841 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ArrayOfArrayOfNumberOnly Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ArrayOfArrayOfNumberOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets array_array_number + * * @return float[][] */ public function getArrayArrayNumber() @@ -204,7 +216,9 @@ public function getArrayArrayNumber() /** * Sets array_array_number + * * @param float[][] $array_array_number + * * @return $this */ public function setArrayArrayNumber($array_array_number) @@ -215,7 +229,9 @@ public function setArrayArrayNumber($array_array_number) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 2c2c8d25650..2469e34b7df 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ArrayOfNumberOnly Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ArrayOfNumberOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets array_number + * * @return float[] */ public function getArrayNumber() @@ -204,7 +216,9 @@ public function getArrayNumber() /** * Sets array_number + * * @param float[] $array_number + * * @return $this */ public function setArrayNumber($array_number) @@ -215,7 +229,9 @@ public function setArrayNumber($array_number) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 786b4fe0bac..fdd9c9e6238 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ArrayTest Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ArrayTest implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ArrayTest implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ArrayTest'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +63,7 @@ class ArrayTest implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -90,7 +93,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,6 +106,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -111,6 +117,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -120,7 +127,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -165,13 +173,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -187,13 +198,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -207,6 +218,7 @@ public function valid() /** * Gets array_of_string + * * @return string[] */ public function getArrayOfString() @@ -216,7 +228,9 @@ public function getArrayOfString() /** * Sets array_of_string + * * @param string[] $array_of_string + * * @return $this */ public function setArrayOfString($array_of_string) @@ -228,6 +242,7 @@ public function setArrayOfString($array_of_string) /** * Gets array_array_of_integer + * * @return int[][] */ public function getArrayArrayOfInteger() @@ -237,7 +252,9 @@ public function getArrayArrayOfInteger() /** * Sets array_array_of_integer + * * @param int[][] $array_array_of_integer + * * @return $this */ public function setArrayArrayOfInteger($array_array_of_integer) @@ -249,6 +266,7 @@ public function setArrayArrayOfInteger($array_array_of_integer) /** * Gets array_array_of_model + * * @return \Swagger\Client\Model\ReadOnlyFirst[][] */ public function getArrayArrayOfModel() @@ -258,7 +276,9 @@ public function getArrayArrayOfModel() /** * Sets array_array_of_model + * * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model + * * @return $this */ public function setArrayArrayOfModel($array_array_of_model) @@ -269,7 +289,9 @@ public function setArrayArrayOfModel($array_array_of_model) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -279,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -289,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -304,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -314,15 +342,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 1d28f1321d3..6beffb1c1e9 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Capitalization Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Capitalization implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Capitalization implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Capitalization'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +66,7 @@ class Capitalization implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -96,7 +99,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,6 +115,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -123,6 +129,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -135,7 +142,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -180,13 +188,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -205,13 +216,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -225,6 +236,7 @@ public function valid() /** * Gets small_camel + * * @return string */ public function getSmallCamel() @@ -234,7 +246,9 @@ public function getSmallCamel() /** * Sets small_camel + * * @param string $small_camel + * * @return $this */ public function setSmallCamel($small_camel) @@ -246,6 +260,7 @@ public function setSmallCamel($small_camel) /** * Gets capital_camel + * * @return string */ public function getCapitalCamel() @@ -255,7 +270,9 @@ public function getCapitalCamel() /** * Sets capital_camel + * * @param string $capital_camel + * * @return $this */ public function setCapitalCamel($capital_camel) @@ -267,6 +284,7 @@ public function setCapitalCamel($capital_camel) /** * Gets small_snake + * * @return string */ public function getSmallSnake() @@ -276,7 +294,9 @@ public function getSmallSnake() /** * Sets small_snake + * * @param string $small_snake + * * @return $this */ public function setSmallSnake($small_snake) @@ -288,6 +308,7 @@ public function setSmallSnake($small_snake) /** * Gets capital_snake + * * @return string */ public function getCapitalSnake() @@ -297,7 +318,9 @@ public function getCapitalSnake() /** * Sets capital_snake + * * @param string $capital_snake + * * @return $this */ public function setCapitalSnake($capital_snake) @@ -309,6 +332,7 @@ public function setCapitalSnake($capital_snake) /** * Gets sca_eth_flow_points + * * @return string */ public function getScaEthFlowPoints() @@ -318,7 +342,9 @@ public function getScaEthFlowPoints() /** * Sets sca_eth_flow_points + * * @param string $sca_eth_flow_points + * * @return $this */ public function setScaEthFlowPoints($sca_eth_flow_points) @@ -330,6 +356,7 @@ public function setScaEthFlowPoints($sca_eth_flow_points) /** * Gets att_name + * * @return string */ public function getAttName() @@ -339,7 +366,9 @@ public function getAttName() /** * Sets att_name + * * @param string $att_name Name of the pet + * * @return $this */ public function setAttName($att_name) @@ -350,7 +379,9 @@ public function setAttName($att_name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -360,7 +391,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -370,8 +403,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -385,7 +420,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -395,15 +432,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 2c24b7e089c..467d001fcf5 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -28,29 +27,30 @@ */ namespace Swagger\Client\Model; - -use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Cat Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Cat extends Animal implements ModelInterface, ArrayAccess +class Cat extends Animal { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Cat'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +59,7 @@ class Cat extends Animal implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +87,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +98,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +107,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +115,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -153,15 +159,12 @@ public function getModelName() - /** - * Associative array for storing property values - * @var mixed[] - */ - protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -177,13 +180,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -200,6 +203,7 @@ public function valid() /** * Gets declawed + * * @return bool */ public function getDeclawed() @@ -209,7 +213,9 @@ public function getDeclawed() /** * Sets declawed + * * @param bool $declawed + * * @return $this */ public function setDeclawed($declawed) @@ -220,7 +226,9 @@ public function setDeclawed($declawed) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -230,7 +238,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -240,8 +250,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -255,7 +267,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -265,15 +279,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 00b3126cac8..694f0f886fe 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Category Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Category implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Category implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Category'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class Category implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -181,13 +192,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -201,6 +212,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -210,7 +222,9 @@ public function getId() /** * Sets id + * * @param int $id + * * @return $this */ public function setId($id) @@ -222,6 +236,7 @@ public function setId($id) /** * Gets name + * * @return string */ public function getName() @@ -231,7 +246,9 @@ public function getName() /** * Sets name + * * @param string $name + * * @return $this */ public function setName($name) @@ -242,7 +259,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -252,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -262,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -277,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -287,15 +312,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 a8c070a4aaf..d3cffef6e30 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,15 +29,16 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ClassModel Class Doc Comment * - * @category Class + * @category Class * @description Model for testing model with \"_class\" property - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ClassModel implements ModelInterface, ArrayAccess { @@ -46,12 +46,14 @@ class ClassModel implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ClassModel'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class ClassModel implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -87,7 +90,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,6 +101,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,6 +110,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,7 +118,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -156,13 +164,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -176,13 +187,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -196,6 +207,7 @@ public function valid() /** * Gets _class + * * @return string */ public function getClass() @@ -205,7 +217,9 @@ public function getClass() /** * Sets _class + * * @param string $_class + * * @return $this */ public function setClass($_class) @@ -216,7 +230,9 @@ public function setClass($_class) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -226,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -236,8 +254,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -251,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -261,15 +283,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 7efb7fbd05c..6fe33372b6b 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Client Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Client implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Client implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Client'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class Client implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets client + * * @return string */ public function getClient() @@ -204,7 +216,9 @@ public function getClient() /** * Sets client + * * @param string $client + * * @return $this */ public function setClient($client) @@ -215,7 +229,9 @@ public function setClient($client) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 bdde3f62282..33f32068721 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -28,29 +27,30 @@ */ namespace Swagger\Client\Model; - -use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Dog Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ -class Dog extends Animal implements ModelInterface, ArrayAccess +class Dog extends Animal { const DISCRIMINATOR = null; /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Dog'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +59,7 @@ class Dog extends Animal implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +87,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +98,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +107,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +115,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -153,15 +159,12 @@ public function getModelName() - /** - * Associative array for storing property values - * @var mixed[] - */ - protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -177,13 +180,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = parent::listInvalidProperties(); + $invalidProperties = parent::listInvalidProperties(); - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -200,6 +203,7 @@ public function valid() /** * Gets breed + * * @return string */ public function getBreed() @@ -209,7 +213,9 @@ public function getBreed() /** * Sets breed + * * @param string $breed + * * @return $this */ public function setBreed($breed) @@ -220,7 +226,9 @@ public function setBreed($breed) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -230,7 +238,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -240,8 +250,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -255,7 +267,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -265,15 +279,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 00910f339fc..d04608bd8dd 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * EnumArrays Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class EnumArrays implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class EnumArrays implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'EnumArrays'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class EnumArrays implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -163,6 +171,7 @@ public function getModelName() /** * Gets allowable values of the enum + * * @return string[] */ public function getJustSymbolAllowableValues() @@ -175,6 +184,7 @@ public function getJustSymbolAllowableValues() /** * Gets allowable values of the enum + * * @return string[] */ public function getArrayEnumAllowableValues() @@ -188,13 +198,16 @@ public function getArrayEnumAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -209,21 +222,21 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - $allowed_values = $this->getJustSymbolAllowableValues(); - if (!in_array($this->container['just_symbol'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getJustSymbolAllowableValues(); + if (!in_array($this->container['just_symbol'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'just_symbol', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -231,8 +244,8 @@ public function listInvalidProperties() public function valid() { - $allowed_values = $this->getJustSymbolAllowableValues(); - if (!in_array($this->container['just_symbol'], $allowed_values)) { + $allowedValues = $this->getJustSymbolAllowableValues(); + if (!in_array($this->container['just_symbol'], $allowedValues)) { return false; } return true; @@ -241,6 +254,7 @@ public function valid() /** * Gets just_symbol + * * @return string */ public function getJustSymbol() @@ -250,17 +264,19 @@ public function getJustSymbol() /** * Sets just_symbol + * * @param string $just_symbol + * * @return $this */ public function setJustSymbol($just_symbol) { - $allowed_values = $this->getJustSymbolAllowableValues(); - if (!is_null($just_symbol) && !in_array($just_symbol, $allowed_values)) { + $allowedValues = $this->getJustSymbolAllowableValues(); + if (!is_null($just_symbol) && !in_array($just_symbol, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'just_symbol', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -271,6 +287,7 @@ public function setJustSymbol($just_symbol) /** * Gets array_enum + * * @return string[] */ public function getArrayEnum() @@ -280,17 +297,19 @@ public function getArrayEnum() /** * Sets array_enum + * * @param string[] $array_enum + * * @return $this */ public function setArrayEnum($array_enum) { - $allowed_values = $this->getArrayEnumAllowableValues(); - if (!is_null($array_enum) && array_diff($array_enum, $allowed_values)) { + $allowedValues = $this->getArrayEnumAllowableValues(); + if (!is_null($array_enum) && array_diff($array_enum, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'array_enum', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -300,7 +319,9 @@ public function setArrayEnum($array_enum) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -310,7 +331,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -320,8 +343,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -335,7 +360,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -345,15 +372,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 3584a76436d..8df7d95f527 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -28,14 +27,15 @@ */ namespace Swagger\Client\Model; +use \Swagger\Client\ObjectSerializer; /** * EnumClass Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class EnumClass { 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 c05423901b9..8b749a79e60 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * EnumTest Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class EnumTest implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class EnumTest implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Enum_Test'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -62,6 +64,7 @@ class EnumTest implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -92,7 +95,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -104,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -115,6 +121,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -125,7 +132,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -176,6 +184,7 @@ public function getModelName() /** * Gets allowable values of the enum + * * @return string[] */ public function getEnumStringAllowableValues() @@ -189,6 +198,7 @@ public function getEnumStringAllowableValues() /** * Gets allowable values of the enum + * * @return string[] */ public function getEnumIntegerAllowableValues() @@ -201,6 +211,7 @@ public function getEnumIntegerAllowableValues() /** * Gets allowable values of the enum + * * @return string[] */ public function getEnumNumberAllowableValues() @@ -214,13 +225,16 @@ public function getEnumNumberAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -237,37 +251,37 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - $allowed_values = $this->getEnumStringAllowableValues(); - if (!in_array($this->container['enum_string'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getEnumStringAllowableValues(); + if (!in_array($this->container['enum_string'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'enum_string', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - $allowed_values = $this->getEnumIntegerAllowableValues(); - if (!in_array($this->container['enum_integer'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getEnumIntegerAllowableValues(); + if (!in_array($this->container['enum_integer'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'enum_integer', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - $allowed_values = $this->getEnumNumberAllowableValues(); - if (!in_array($this->container['enum_number'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getEnumNumberAllowableValues(); + if (!in_array($this->container['enum_number'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'enum_number', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -275,16 +289,16 @@ public function listInvalidProperties() public function valid() { - $allowed_values = $this->getEnumStringAllowableValues(); - if (!in_array($this->container['enum_string'], $allowed_values)) { + $allowedValues = $this->getEnumStringAllowableValues(); + if (!in_array($this->container['enum_string'], $allowedValues)) { return false; } - $allowed_values = $this->getEnumIntegerAllowableValues(); - if (!in_array($this->container['enum_integer'], $allowed_values)) { + $allowedValues = $this->getEnumIntegerAllowableValues(); + if (!in_array($this->container['enum_integer'], $allowedValues)) { return false; } - $allowed_values = $this->getEnumNumberAllowableValues(); - if (!in_array($this->container['enum_number'], $allowed_values)) { + $allowedValues = $this->getEnumNumberAllowableValues(); + if (!in_array($this->container['enum_number'], $allowedValues)) { return false; } return true; @@ -293,6 +307,7 @@ public function valid() /** * Gets enum_string + * * @return string */ public function getEnumString() @@ -302,17 +317,19 @@ public function getEnumString() /** * Sets enum_string + * * @param string $enum_string + * * @return $this */ public function setEnumString($enum_string) { - $allowed_values = $this->getEnumStringAllowableValues(); - if (!is_null($enum_string) && !in_array($enum_string, $allowed_values)) { + $allowedValues = $this->getEnumStringAllowableValues(); + if (!is_null($enum_string) && !in_array($enum_string, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_string', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -323,6 +340,7 @@ public function setEnumString($enum_string) /** * Gets enum_integer + * * @return int */ public function getEnumInteger() @@ -332,17 +350,19 @@ public function getEnumInteger() /** * Sets enum_integer + * * @param int $enum_integer + * * @return $this */ public function setEnumInteger($enum_integer) { - $allowed_values = $this->getEnumIntegerAllowableValues(); - if (!is_null($enum_integer) && !in_array($enum_integer, $allowed_values)) { + $allowedValues = $this->getEnumIntegerAllowableValues(); + if (!is_null($enum_integer) && !in_array($enum_integer, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_integer', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -353,6 +373,7 @@ public function setEnumInteger($enum_integer) /** * Gets enum_number + * * @return double */ public function getEnumNumber() @@ -362,17 +383,19 @@ public function getEnumNumber() /** * Sets enum_number + * * @param double $enum_number + * * @return $this */ public function setEnumNumber($enum_number) { - $allowed_values = $this->getEnumNumberAllowableValues(); - if (!is_null($enum_number) && !in_array($enum_number, $allowed_values)) { + $allowedValues = $this->getEnumNumberAllowableValues(); + if (!is_null($enum_number) && !in_array($enum_number, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_number', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -383,6 +406,7 @@ public function setEnumNumber($enum_number) /** * Gets outer_enum + * * @return \Swagger\Client\Model\OuterEnum */ public function getOuterEnum() @@ -392,7 +416,9 @@ public function getOuterEnum() /** * Sets outer_enum + * * @param \Swagger\Client\Model\OuterEnum $outer_enum + * * @return $this */ public function setOuterEnum($outer_enum) @@ -403,7 +429,9 @@ public function setOuterEnum($outer_enum) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -413,7 +441,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -423,8 +453,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -438,7 +470,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -448,15 +482,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 4ddb24ba866..338b19c1aa1 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * FormatTest Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class FormatTest implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class FormatTest implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'format_test'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -71,6 +73,7 @@ class FormatTest implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -110,7 +113,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -131,6 +136,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -151,6 +157,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -170,7 +177,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -215,13 +223,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -247,81 +258,77 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { - $invalid_properties[] = "invalid value for 'integer', must be smaller than or equal to 100."; + $invalidProperties[] = "invalid value for 'integer', must be smaller than or equal to 100."; } if (!is_null($this->container['integer']) && ($this->container['integer'] < 10)) { - $invalid_properties[] = "invalid value for 'integer', must be bigger than or equal to 10."; + $invalidProperties[] = "invalid value for 'integer', must be bigger than or equal to 10."; } if (!is_null($this->container['int32']) && ($this->container['int32'] > 200)) { - $invalid_properties[] = "invalid value for 'int32', must be smaller than or equal to 200."; + $invalidProperties[] = "invalid value for 'int32', must be smaller than or equal to 200."; } if (!is_null($this->container['int32']) && ($this->container['int32'] < 20)) { - $invalid_properties[] = "invalid value for 'int32', must be bigger than or equal to 20."; + $invalidProperties[] = "invalid value for 'int32', must be bigger than or equal to 20."; } if ($this->container['number'] === null) { - $invalid_properties[] = "'number' can't be null"; + $invalidProperties[] = "'number' can't be null"; } if (($this->container['number'] > 543.2)) { - $invalid_properties[] = "invalid value for 'number', must be smaller than or equal to 543.2."; + $invalidProperties[] = "invalid value for 'number', must be smaller than or equal to 543.2."; } if (($this->container['number'] < 32.1)) { - $invalid_properties[] = "invalid value for 'number', must be bigger than or equal to 32.1."; + $invalidProperties[] = "invalid value for 'number', must be bigger than or equal to 32.1."; } if (!is_null($this->container['float']) && ($this->container['float'] > 987.6)) { - $invalid_properties[] = "invalid value for 'float', must be smaller than or equal to 987.6."; + $invalidProperties[] = "invalid value for 'float', must be smaller than or equal to 987.6."; } if (!is_null($this->container['float']) && ($this->container['float'] < 54.3)) { - $invalid_properties[] = "invalid value for 'float', must be bigger than or equal to 54.3."; + $invalidProperties[] = "invalid value for 'float', must be bigger than or equal to 54.3."; } if (!is_null($this->container['double']) && ($this->container['double'] > 123.4)) { - $invalid_properties[] = "invalid value for 'double', must be smaller than or equal to 123.4."; + $invalidProperties[] = "invalid value for 'double', must be smaller than or equal to 123.4."; } if (!is_null($this->container['double']) && ($this->container['double'] < 67.8)) { - $invalid_properties[] = "invalid value for 'double', must be bigger than or equal to 67.8."; + $invalidProperties[] = "invalid value for 'double', must be bigger than or equal to 67.8."; } if (!is_null($this->container['string']) && !preg_match("/[a-z]/i", $this->container['string'])) { - $invalid_properties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i."; + $invalidProperties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i."; } if ($this->container['byte'] === null) { - $invalid_properties[] = "'byte' can't be null"; - } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { - $invalid_properties[] = "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + $invalidProperties[] = "'byte' can't be null"; } - if ($this->container['date'] === null) { - $invalid_properties[] = "'date' can't be null"; + $invalidProperties[] = "'date' can't be null"; } if ($this->container['password'] === null) { - $invalid_properties[] = "'password' can't be null"; + $invalidProperties[] = "'password' can't be null"; } if ((strlen($this->container['password']) > 64)) { - $invalid_properties[] = "invalid value for 'password', the character length must be smaller than or equal to 64."; + $invalidProperties[] = "invalid value for 'password', the character length must be smaller than or equal to 64."; } if ((strlen($this->container['password']) < 10)) { - $invalid_properties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; + $invalidProperties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -368,9 +375,6 @@ public function valid() if ($this->container['byte'] === null) { return false; } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { - return false; - } if ($this->container['date'] === null) { return false; } @@ -389,6 +393,7 @@ public function valid() /** * Gets integer + * * @return int */ public function getInteger() @@ -398,7 +403,9 @@ public function getInteger() /** * Sets integer + * * @param int $integer + * * @return $this */ public function setInteger($integer) @@ -418,6 +425,7 @@ public function setInteger($integer) /** * Gets int32 + * * @return int */ public function getInt32() @@ -427,7 +435,9 @@ public function getInt32() /** * Sets int32 + * * @param int $int32 + * * @return $this */ public function setInt32($int32) @@ -447,6 +457,7 @@ public function setInt32($int32) /** * Gets int64 + * * @return int */ public function getInt64() @@ -456,7 +467,9 @@ public function getInt64() /** * Sets int64 + * * @param int $int64 + * * @return $this */ public function setInt64($int64) @@ -468,6 +481,7 @@ public function setInt64($int64) /** * Gets number + * * @return float */ public function getNumber() @@ -477,7 +491,9 @@ public function getNumber() /** * Sets number + * * @param float $number + * * @return $this */ public function setNumber($number) @@ -497,6 +513,7 @@ public function setNumber($number) /** * Gets float + * * @return float */ public function getFloat() @@ -506,7 +523,9 @@ public function getFloat() /** * Sets float + * * @param float $float + * * @return $this */ public function setFloat($float) @@ -526,6 +545,7 @@ public function setFloat($float) /** * Gets double + * * @return double */ public function getDouble() @@ -535,7 +555,9 @@ public function getDouble() /** * Sets double + * * @param double $double + * * @return $this */ public function setDouble($double) @@ -555,6 +577,7 @@ public function setDouble($double) /** * Gets string + * * @return string */ public function getString() @@ -564,7 +587,9 @@ public function getString() /** * Sets string + * * @param string $string + * * @return $this */ public function setString($string) @@ -581,6 +606,7 @@ public function setString($string) /** * Gets byte + * * @return string */ public function getByte() @@ -590,16 +616,13 @@ public function getByte() /** * Sets byte + * * @param string $byte + * * @return $this */ public function setByte($byte) { - - if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $byte))) { - throw new \InvalidArgumentException("invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); - } - $this->container['byte'] = $byte; return $this; @@ -607,6 +630,7 @@ public function setByte($byte) /** * Gets binary + * * @return string */ public function getBinary() @@ -616,7 +640,9 @@ public function getBinary() /** * Sets binary + * * @param string $binary + * * @return $this */ public function setBinary($binary) @@ -628,6 +654,7 @@ public function setBinary($binary) /** * Gets date + * * @return \DateTime */ public function getDate() @@ -637,7 +664,9 @@ public function getDate() /** * Sets date + * * @param \DateTime $date + * * @return $this */ public function setDate($date) @@ -649,6 +678,7 @@ public function setDate($date) /** * Gets date_time + * * @return \DateTime */ public function getDateTime() @@ -658,7 +688,9 @@ public function getDateTime() /** * Sets date_time + * * @param \DateTime $date_time + * * @return $this */ public function setDateTime($date_time) @@ -670,6 +702,7 @@ public function setDateTime($date_time) /** * Gets uuid + * * @return string */ public function getUuid() @@ -679,7 +712,9 @@ public function getUuid() /** * Sets uuid + * * @param string $uuid + * * @return $this */ public function setUuid($uuid) @@ -691,6 +726,7 @@ public function setUuid($uuid) /** * Gets password + * * @return string */ public function getPassword() @@ -700,7 +736,9 @@ public function getPassword() /** * Sets password + * * @param string $password + * * @return $this */ public function setPassword($password) @@ -718,7 +756,9 @@ public function setPassword($password) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -728,7 +768,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -738,8 +780,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -753,7 +797,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -763,15 +809,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 954a49683ec..9deab454ca8 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * HasOnlyReadOnly Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class HasOnlyReadOnly implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'hasOnlyReadOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -181,13 +192,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -201,6 +212,7 @@ public function valid() /** * Gets bar + * * @return string */ public function getBar() @@ -210,7 +222,9 @@ public function getBar() /** * Sets bar + * * @param string $bar + * * @return $this */ public function setBar($bar) @@ -222,6 +236,7 @@ public function setBar($bar) /** * Gets foo + * * @return string */ public function getFoo() @@ -231,7 +246,9 @@ public function getFoo() /** * Sets foo + * * @param string $foo + * * @return $this */ public function setFoo($foo) @@ -242,7 +259,9 @@ public function setFoo($foo) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -252,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -262,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -277,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -287,15 +312,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 c821ad47d40..e2cd49676b5 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * MapTest Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class MapTest implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class MapTest implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'MapTest'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class MapTest implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -161,6 +169,7 @@ public function getModelName() /** * Gets allowable values of the enum + * * @return string[] */ public function getMapOfEnumStringAllowableValues() @@ -174,13 +183,16 @@ public function getMapOfEnumStringAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -195,13 +207,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -215,6 +227,7 @@ public function valid() /** * Gets map_map_of_string + * * @return map[string,map[string,string]] */ public function getMapMapOfString() @@ -224,7 +237,9 @@ public function getMapMapOfString() /** * Sets map_map_of_string + * * @param map[string,map[string,string]] $map_map_of_string + * * @return $this */ public function setMapMapOfString($map_map_of_string) @@ -236,6 +251,7 @@ public function setMapMapOfString($map_map_of_string) /** * Gets map_of_enum_string + * * @return map[string,string] */ public function getMapOfEnumString() @@ -245,17 +261,19 @@ public function getMapOfEnumString() /** * Sets map_of_enum_string + * * @param map[string,string] $map_of_enum_string + * * @return $this */ public function setMapOfEnumString($map_of_enum_string) { - $allowed_values = $this->getMapOfEnumStringAllowableValues(); - if (!is_null($map_of_enum_string) && array_diff($map_of_enum_string, $allowed_values)) { + $allowedValues = $this->getMapOfEnumStringAllowableValues(); + if (!is_null($map_of_enum_string) && array_diff($map_of_enum_string, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'map_of_enum_string', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -265,7 +283,9 @@ public function setMapOfEnumString($map_of_enum_string) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -275,7 +295,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -285,8 +307,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -300,7 +324,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -310,15 +336,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 3effed2eeaa..12cfd35160e 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * MixedPropertiesAndAdditionalPropertiesClass Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'MixedPropertiesAndAdditionalPropertiesClass'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +63,7 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -90,7 +93,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,6 +106,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -111,6 +117,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -120,7 +127,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -165,13 +173,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -187,13 +198,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -207,6 +218,7 @@ public function valid() /** * Gets uuid + * * @return string */ public function getUuid() @@ -216,7 +228,9 @@ public function getUuid() /** * Sets uuid + * * @param string $uuid + * * @return $this */ public function setUuid($uuid) @@ -228,6 +242,7 @@ public function setUuid($uuid) /** * Gets date_time + * * @return \DateTime */ public function getDateTime() @@ -237,7 +252,9 @@ public function getDateTime() /** * Sets date_time + * * @param \DateTime $date_time + * * @return $this */ public function setDateTime($date_time) @@ -249,6 +266,7 @@ public function setDateTime($date_time) /** * Gets map + * * @return map[string,\Swagger\Client\Model\Animal] */ public function getMap() @@ -258,7 +276,9 @@ public function getMap() /** * Sets map + * * @param map[string,\Swagger\Client\Model\Animal] $map + * * @return $this */ public function setMap($map) @@ -269,7 +289,9 @@ public function setMap($map) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -279,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -289,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -304,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -314,15 +342,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 5b8f392645d..ab75d0dee42 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,15 +29,16 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Model200Response Class Doc Comment * - * @category Class + * @category Class * @description Model for testing model name starting with number - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Model200Response implements ModelInterface, ArrayAccess { @@ -46,12 +46,14 @@ class Model200Response implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = '200_response'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +63,7 @@ class Model200Response implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -89,7 +92,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -99,6 +104,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -108,6 +114,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -116,7 +123,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -161,13 +169,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -182,13 +193,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -202,6 +213,7 @@ public function valid() /** * Gets name + * * @return int */ public function getName() @@ -211,7 +223,9 @@ public function getName() /** * Sets name + * * @param int $name + * * @return $this */ public function setName($name) @@ -223,6 +237,7 @@ public function setName($name) /** * Gets class + * * @return string */ public function getClass() @@ -232,7 +247,9 @@ public function getClass() /** * Sets class + * * @param string $class + * * @return $this */ public function setClass($class) @@ -243,7 +260,9 @@ public function setClass($class) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -253,7 +272,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -263,8 +284,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -278,7 +301,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -288,15 +313,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 50ff5051a2e..7c17be9b237 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ModelList Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ModelList implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ModelList implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'List'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class ModelList implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets _123_list + * * @return string */ public function get123List() @@ -204,7 +216,9 @@ public function get123List() /** * Sets _123_list + * * @param string $_123_list + * * @return $this */ public function set123List($_123_list) @@ -215,7 +229,9 @@ public function set123List($_123_list) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 32047e3098c..fe1b72ec7ab 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,15 +29,16 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ModelReturn Class Doc Comment * - * @category Class + * @category Class * @description Model for testing reserved words - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ModelReturn implements ModelInterface, ArrayAccess { @@ -46,12 +46,14 @@ class ModelReturn implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Return'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class ModelReturn implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -87,7 +90,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -96,6 +101,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -104,6 +110,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -111,7 +118,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -156,13 +164,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -176,13 +187,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -196,6 +207,7 @@ public function valid() /** * Gets return + * * @return int */ public function getReturn() @@ -205,7 +217,9 @@ public function getReturn() /** * Sets return + * * @param int $return + * * @return $this */ public function setReturn($return) @@ -216,7 +230,9 @@ public function setReturn($return) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -226,7 +242,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -236,8 +254,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -251,7 +271,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -261,15 +283,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 1e01e3867b0..90d8781e45a 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,15 +29,16 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Name Class Doc Comment * - * @category Class + * @category Class * @description Model for testing model name same as property name - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Name implements ModelInterface, ArrayAccess { @@ -46,12 +46,14 @@ class Name implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Name'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -63,6 +65,7 @@ class Name implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -93,7 +96,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -105,6 +110,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -116,6 +122,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -126,7 +133,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -171,13 +179,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -194,16 +205,16 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -220,6 +231,7 @@ public function valid() /** * Gets name + * * @return int */ public function getName() @@ -229,7 +241,9 @@ public function getName() /** * Sets name + * * @param int $name + * * @return $this */ public function setName($name) @@ -241,6 +255,7 @@ public function setName($name) /** * Gets snake_case + * * @return int */ public function getSnakeCase() @@ -250,7 +265,9 @@ public function getSnakeCase() /** * Sets snake_case + * * @param int $snake_case + * * @return $this */ public function setSnakeCase($snake_case) @@ -262,6 +279,7 @@ public function setSnakeCase($snake_case) /** * Gets property + * * @return string */ public function getProperty() @@ -271,7 +289,9 @@ public function getProperty() /** * Sets property + * * @param string $property + * * @return $this */ public function setProperty($property) @@ -283,6 +303,7 @@ public function setProperty($property) /** * Gets _123_number + * * @return int */ public function get123Number() @@ -292,7 +313,9 @@ public function get123Number() /** * Sets _123_number + * * @param int $_123_number + * * @return $this */ public function set123Number($_123_number) @@ -303,7 +326,9 @@ public function set123Number($_123_number) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -313,7 +338,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -323,8 +350,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -338,7 +367,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -348,15 +379,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 10af696bad9..f59fbfd6e1f 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * NumberOnly Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class NumberOnly implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class NumberOnly implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'NumberOnly'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class NumberOnly implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets just_number + * * @return float */ public function getJustNumber() @@ -204,7 +216,9 @@ public function getJustNumber() /** * Sets just_number + * * @param float $just_number + * * @return $this */ public function setJustNumber($just_number) @@ -215,7 +229,9 @@ public function setJustNumber($just_number) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 4c469349719..5a70366e2d6 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Order Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Order implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Order implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Order'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +66,7 @@ class Order implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -96,7 +99,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,6 +115,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -123,6 +129,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -135,7 +142,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -182,6 +190,7 @@ public function getModelName() /** * Gets allowable values of the enum + * * @return string[] */ public function getStatusAllowableValues() @@ -196,13 +205,16 @@ public function getStatusAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -221,21 +233,21 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -243,8 +255,8 @@ public function listInvalidProperties() public function valid() { - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { return false; } return true; @@ -253,6 +265,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -262,7 +275,9 @@ public function getId() /** * Sets id + * * @param int $id + * * @return $this */ public function setId($id) @@ -274,6 +289,7 @@ public function setId($id) /** * Gets pet_id + * * @return int */ public function getPetId() @@ -283,7 +299,9 @@ public function getPetId() /** * Sets pet_id + * * @param int $pet_id + * * @return $this */ public function setPetId($pet_id) @@ -295,6 +313,7 @@ public function setPetId($pet_id) /** * Gets quantity + * * @return int */ public function getQuantity() @@ -304,7 +323,9 @@ public function getQuantity() /** * Sets quantity + * * @param int $quantity + * * @return $this */ public function setQuantity($quantity) @@ -316,6 +337,7 @@ public function setQuantity($quantity) /** * Gets ship_date + * * @return \DateTime */ public function getShipDate() @@ -325,7 +347,9 @@ public function getShipDate() /** * Sets ship_date + * * @param \DateTime $ship_date + * * @return $this */ public function setShipDate($ship_date) @@ -337,6 +361,7 @@ public function setShipDate($ship_date) /** * Gets status + * * @return string */ public function getStatus() @@ -346,17 +371,19 @@ public function getStatus() /** * Sets status + * * @param string $status Order Status + * * @return $this */ public function setStatus($status) { - $allowed_values = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -367,6 +394,7 @@ public function setStatus($status) /** * Gets complete + * * @return bool */ public function getComplete() @@ -376,7 +404,9 @@ public function getComplete() /** * Sets complete + * * @param bool $complete + * * @return $this */ public function setComplete($complete) @@ -387,7 +417,9 @@ public function setComplete($complete) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -397,7 +429,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -407,8 +441,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -422,7 +458,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -432,15 +470,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 894a54cd620..12d259785ac 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * OuterBoolean Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class OuterBoolean implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class OuterBoolean implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'OuterBoolean'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class OuterBoolean implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -174,13 +185,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -193,7 +204,9 @@ public function valid() /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -203,7 +216,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -213,8 +228,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -228,7 +245,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -238,15 +257,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 a5cf7b95710..36c4a3856b3 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * OuterComposite Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class OuterComposite implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class OuterComposite implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'OuterComposite'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -61,6 +63,7 @@ class OuterComposite implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -90,7 +93,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -101,6 +106,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -111,6 +117,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -120,7 +127,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -165,13 +173,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -187,13 +198,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -207,6 +218,7 @@ public function valid() /** * Gets my_number + * * @return \Swagger\Client\Model\OuterNumber */ public function getMyNumber() @@ -216,7 +228,9 @@ public function getMyNumber() /** * Sets my_number + * * @param \Swagger\Client\Model\OuterNumber $my_number + * * @return $this */ public function setMyNumber($my_number) @@ -228,6 +242,7 @@ public function setMyNumber($my_number) /** * Gets my_string + * * @return \Swagger\Client\Model\OuterString */ public function getMyString() @@ -237,7 +252,9 @@ public function getMyString() /** * Sets my_string + * * @param \Swagger\Client\Model\OuterString $my_string + * * @return $this */ public function setMyString($my_string) @@ -249,6 +266,7 @@ public function setMyString($my_string) /** * Gets my_boolean + * * @return \Swagger\Client\Model\OuterBoolean */ public function getMyBoolean() @@ -258,7 +276,9 @@ public function getMyBoolean() /** * Sets my_boolean + * * @param \Swagger\Client\Model\OuterBoolean $my_boolean + * * @return $this */ public function setMyBoolean($my_boolean) @@ -269,7 +289,9 @@ public function setMyBoolean($my_boolean) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -279,7 +301,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -289,8 +313,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -304,7 +330,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -314,15 +342,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 7b71273784b..e1254b42f82 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -28,14 +27,15 @@ */ namespace Swagger\Client\Model; +use \Swagger\Client\ObjectSerializer; /** * OuterEnum Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class OuterEnum { 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 a57d2da2bd9..24f44549fda 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * OuterNumber Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class OuterNumber implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class OuterNumber implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'OuterNumber'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class OuterNumber implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -174,13 +185,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -193,7 +204,9 @@ public function valid() /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -203,7 +216,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -213,8 +228,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -228,7 +245,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -238,15 +257,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 53ba2c2d4be..e6f01806581 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * OuterString Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class OuterString implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class OuterString implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'OuterString'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class OuterString implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -174,13 +185,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -193,7 +204,9 @@ public function valid() /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -203,7 +216,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -213,8 +228,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -228,7 +245,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -238,15 +257,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 9333fe38e28..382e5ee7672 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Pet Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Pet implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Pet implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Pet'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -64,6 +66,7 @@ class Pet implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -96,7 +99,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -110,6 +115,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -123,6 +129,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -135,7 +142,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -182,6 +190,7 @@ public function getModelName() /** * Gets allowable values of the enum + * * @return string[] */ public function getStatusAllowableValues() @@ -196,13 +205,16 @@ public function getStatusAllowableValues() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -221,27 +233,27 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; if ($this->container['name'] === null) { - $invalid_properties[] = "'name' can't be null"; + $invalidProperties[] = "'name' can't be null"; } if ($this->container['photo_urls'] === null) { - $invalid_properties[] = "'photo_urls' can't be null"; + $invalidProperties[] = "'photo_urls' can't be null"; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { - $invalid_properties[] = sprintf( + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { + $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ); } - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -255,8 +267,8 @@ public function valid() if ($this->container['photo_urls'] === null) { return false; } - $allowed_values = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($this->container['status'], $allowedValues)) { return false; } return true; @@ -265,6 +277,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -274,7 +287,9 @@ public function getId() /** * Sets id + * * @param int $id + * * @return $this */ public function setId($id) @@ -286,6 +301,7 @@ public function setId($id) /** * Gets category + * * @return \Swagger\Client\Model\Category */ public function getCategory() @@ -295,7 +311,9 @@ public function getCategory() /** * Sets category + * * @param \Swagger\Client\Model\Category $category + * * @return $this */ public function setCategory($category) @@ -307,6 +325,7 @@ public function setCategory($category) /** * Gets name + * * @return string */ public function getName() @@ -316,7 +335,9 @@ public function getName() /** * Sets name + * * @param string $name + * * @return $this */ public function setName($name) @@ -328,6 +349,7 @@ public function setName($name) /** * Gets photo_urls + * * @return string[] */ public function getPhotoUrls() @@ -337,7 +359,9 @@ public function getPhotoUrls() /** * Sets photo_urls + * * @param string[] $photo_urls + * * @return $this */ public function setPhotoUrls($photo_urls) @@ -349,6 +373,7 @@ public function setPhotoUrls($photo_urls) /** * Gets tags + * * @return \Swagger\Client\Model\Tag[] */ public function getTags() @@ -358,7 +383,9 @@ public function getTags() /** * Sets tags + * * @param \Swagger\Client\Model\Tag[] $tags + * * @return $this */ public function setTags($tags) @@ -370,6 +397,7 @@ public function setTags($tags) /** * Gets status + * * @return string */ public function getStatus() @@ -379,17 +407,19 @@ public function getStatus() /** * Sets status + * * @param string $status pet status in the store + * * @return $this */ public function setStatus($status) { - $allowed_values = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowed_values)) { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowed_values) + implode("', '", $allowedValues) ) ); } @@ -399,7 +429,9 @@ public function setStatus($status) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -409,7 +441,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -419,8 +453,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -434,7 +470,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -444,15 +482,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 24418f2a731..36e14e910f1 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * ReadOnlyFirst Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class ReadOnlyFirst implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'ReadOnlyFirst'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -181,13 +192,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -201,6 +212,7 @@ public function valid() /** * Gets bar + * * @return string */ public function getBar() @@ -210,7 +222,9 @@ public function getBar() /** * Sets bar + * * @param string $bar + * * @return $this */ public function setBar($bar) @@ -222,6 +236,7 @@ public function setBar($bar) /** * Gets baz + * * @return string */ public function getBaz() @@ -231,7 +246,9 @@ public function getBaz() /** * Sets baz + * * @param string $baz + * * @return $this */ public function setBaz($baz) @@ -242,7 +259,9 @@ public function setBaz($baz) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -252,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -262,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -277,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -287,15 +312,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 1f7dd3f781b..dba1e2d730e 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * SpecialModelName Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class SpecialModelName implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class SpecialModelName implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = '$special[model.name]'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -59,6 +61,7 @@ class SpecialModelName implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -86,7 +89,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -95,6 +100,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -103,6 +109,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -110,7 +117,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -155,13 +163,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -175,13 +186,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -195,6 +206,7 @@ public function valid() /** * Gets special_property_name + * * @return int */ public function getSpecialPropertyName() @@ -204,7 +216,9 @@ public function getSpecialPropertyName() /** * Sets special_property_name + * * @param int $special_property_name + * * @return $this */ public function setSpecialPropertyName($special_property_name) @@ -215,7 +229,9 @@ public function setSpecialPropertyName($special_property_name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -225,7 +241,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -235,8 +253,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -250,7 +270,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -260,15 +282,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 88ade56deea..d9ec6d40dcf 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * Tag Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class Tag implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class Tag implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'Tag'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -60,6 +62,7 @@ class Tag implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -88,7 +91,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -98,6 +103,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -107,6 +113,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -115,7 +122,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -160,13 +168,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -181,13 +192,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -201,6 +212,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -210,7 +222,9 @@ public function getId() /** * Sets id + * * @param int $id + * * @return $this */ public function setId($id) @@ -222,6 +236,7 @@ public function setId($id) /** * Gets name + * * @return string */ public function getName() @@ -231,7 +246,9 @@ public function getName() /** * Sets name + * * @param string $name + * * @return $this */ public function setName($name) @@ -242,7 +259,9 @@ public function setName($name) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -252,7 +271,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -262,8 +283,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -277,7 +300,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -287,15 +312,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } 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 a280a091cbb..16553380b64 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** @@ -30,14 +29,15 @@ namespace Swagger\Client\Model; use \ArrayAccess; +use \Swagger\Client\ObjectSerializer; /** * User Class Doc Comment * - * @category Class - * @package Swagger\Client - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @category Class + * @package Swagger\Client + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen */ class User implements ModelInterface, ArrayAccess { @@ -45,12 +45,14 @@ class User implements ModelInterface, ArrayAccess /** * The original name of the model. + * * @var string */ protected static $swaggerModelName = 'User'; /** * Array of property to type mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerTypes = [ @@ -66,6 +68,7 @@ class User implements ModelInterface, ArrayAccess /** * Array of property to format mappings. Used for (de)serialization + * * @var string[] */ protected static $swaggerFormats = [ @@ -100,7 +103,9 @@ public static function swaggerFormats() } /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name + * * @var string[] */ protected static $attributeMap = [ @@ -116,6 +121,7 @@ public static function swaggerFormats() /** * Array of attributes to setter functions (for deserialization of responses) + * * @var string[] */ protected static $setters = [ @@ -131,6 +137,7 @@ public static function swaggerFormats() /** * Array of attributes to getter functions (for serialization of requests) + * * @var string[] */ protected static $getters = [ @@ -145,7 +152,8 @@ public static function swaggerFormats() ]; /** - * Array of attributes where the key is the local name, and the value is the original name + * Array of attributes where the key is the local name, + * and the value is the original name * * @return array */ @@ -190,13 +198,16 @@ public function getModelName() /** * Associative array for storing property values + * * @var mixed[] */ protected $container = []; /** * Constructor - * @param mixed[] $data Associated array of property values initializing the model + * + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { @@ -217,13 +228,13 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalid_properties = []; + $invalidProperties = []; - return $invalid_properties; + return $invalidProperties; } /** - * validate all the properties in the model + * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid @@ -237,6 +248,7 @@ public function valid() /** * Gets id + * * @return int */ public function getId() @@ -246,7 +258,9 @@ public function getId() /** * Sets id + * * @param int $id + * * @return $this */ public function setId($id) @@ -258,6 +272,7 @@ public function setId($id) /** * Gets username + * * @return string */ public function getUsername() @@ -267,7 +282,9 @@ public function getUsername() /** * Sets username + * * @param string $username + * * @return $this */ public function setUsername($username) @@ -279,6 +296,7 @@ public function setUsername($username) /** * Gets first_name + * * @return string */ public function getFirstName() @@ -288,7 +306,9 @@ public function getFirstName() /** * Sets first_name + * * @param string $first_name + * * @return $this */ public function setFirstName($first_name) @@ -300,6 +320,7 @@ public function setFirstName($first_name) /** * Gets last_name + * * @return string */ public function getLastName() @@ -309,7 +330,9 @@ public function getLastName() /** * Sets last_name + * * @param string $last_name + * * @return $this */ public function setLastName($last_name) @@ -321,6 +344,7 @@ public function setLastName($last_name) /** * Gets email + * * @return string */ public function getEmail() @@ -330,7 +354,9 @@ public function getEmail() /** * Sets email + * * @param string $email + * * @return $this */ public function setEmail($email) @@ -342,6 +368,7 @@ public function setEmail($email) /** * Gets password + * * @return string */ public function getPassword() @@ -351,7 +378,9 @@ public function getPassword() /** * Sets password + * * @param string $password + * * @return $this */ public function setPassword($password) @@ -363,6 +392,7 @@ public function setPassword($password) /** * Gets phone + * * @return string */ public function getPhone() @@ -372,7 +402,9 @@ public function getPhone() /** * Sets phone + * * @param string $phone + * * @return $this */ public function setPhone($phone) @@ -384,6 +416,7 @@ public function setPhone($phone) /** * Gets user_status + * * @return int */ public function getUserStatus() @@ -393,7 +426,9 @@ public function getUserStatus() /** * Sets user_status + * * @param int $user_status User Status + * * @return $this */ public function setUserStatus($user_status) @@ -404,7 +439,9 @@ public function setUserStatus($user_status) } /** * Returns true if offset exists. False otherwise. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return boolean */ public function offsetExists($offset) @@ -414,7 +451,9 @@ public function offsetExists($offset) /** * Gets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return mixed */ public function offsetGet($offset) @@ -424,8 +463,10 @@ public function offsetGet($offset) /** * Sets value based on offset. - * @param integer $offset Offset - * @param mixed $value Value to be set + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * * @return void */ public function offsetSet($offset, $value) @@ -439,7 +480,9 @@ public function offsetSet($offset, $value) /** * Unsets offset. - * @param integer $offset Offset + * + * @param integer $offset Offset + * * @return void */ public function offsetUnset($offset) @@ -449,15 +492,19 @@ public function offsetUnset($offset) /** * Gets the string presentation of the object + * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index c027ba3d3c7..a19107432e2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -18,7 +18,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** From 639f88918a1500a799c360fc4c7ff7ceb3aff25c Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 24 Sep 2017 12:49:43 +0800 Subject: [PATCH 052/197] [Java][RESTEasy] fix resteasy dependency issue in pom.xml (#6556) * fix resteasy dependency issue * add java resteasy petstore to circleci test --- .../Java/libraries/resteasy/pom.mustache | 20 +++-- pom.xml.circleci | 1 + .../java/resteasy/docs/AnotherFakeApi.md | 54 ++++++++++++ samples/client/petstore/java/resteasy/pom.xml | 20 +++-- .../io/swagger/client/api/AnotherFakeApi.java | 78 ++++++++++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++++++++ .../io/swagger/client/api/FakeApiTest.java | 88 ++++++++++++++++++- 7 files changed, 299 insertions(+), 13 deletions(-) create mode 100644 samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java 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 057d3484d83..4fae33777db 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 @@ -201,10 +201,20 @@ {{/supportJava6}} - org.jboss.resteasy - resteasy-jackson-provider - 3.1.3.Final - + org.jboss.resteasy + resteasy-jackson-provider + 3.1.3.Final + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + junit @@ -216,7 +226,7 @@ 1.5.15 3.1.3.Final - 2.8.9 + 2.6.4 {{^java8}} 2.9.9 {{/java8}} diff --git a/pom.xml.circleci b/pom.xml.circleci index 5e658cd2dd1..c06631b8af2 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -835,6 +835,7 @@ samples/client/petstore/java/resttemplate samples/client/petstore/java/resttemplate-withXml samples/client/petstore/java/vertx + samples/client/petstore/java/resteasy samples/client/petstore/ruby samples/client/petstore/kotlin/ junit @@ -178,7 +188,7 @@ 1.5.15 3.1.3.Final - 2.8.9 + 2.6.4 2.9.9 1.0.0 4.12 diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..82673918c35 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,78 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + +import javax.ws.rs.core.GenericType; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testSpecialTags(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java index 25ac4ed8e49..f7a75022194 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,8 +16,9 @@ import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import org.junit.Test; import org.junit.Ignore; @@ -35,6 +36,70 @@ public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite body = null; + OuterComposite response = api.fakeOuterCompositeSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + /** * To test \"client\" model * @@ -72,7 +137,7 @@ public void testEndpointParametersTest() throws ApiException { String string = null; byte[] binary = null; LocalDate date = null; - DateTime dateTime = null; + OffsetDateTime dateTime = null; String password = null; String paramCallback = null; api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); @@ -103,4 +168,21 @@ public void testEnumParametersTest() throws ApiException { // TODO: test validations } + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + + // TODO: test validations + } + } From ac99fe6b2d13dc516f7d3796ee5c8b5e576b9b79 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 24 Sep 2017 07:47:40 +0100 Subject: [PATCH 053/197] fix #6353 (#6514) --- .../src/main/resources/php/ObjectSerializer.mustache | 4 +++- .../petstore/php/SwaggerClient-php/lib/ObjectSerializer.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index d8ca2d904d2..f07a4d18cc0 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -55,7 +55,9 @@ class ObjectSerializer foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && method_exists($swaggerType, 'getAllowableEnumValues') + if ($value !== null + && !in_array($swaggerType, [{{&primitives}}], true) + && method_exists($swaggerType, 'getAllowableEnumValues') && !in_array($value, $swaggerType::getAllowableEnumValues())) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index a19107432e2..fe6cbdfe4b3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -64,7 +64,9 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && method_exists($swaggerType, 'getAllowableEnumValues') + if ($value !== null + && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($swaggerType, 'getAllowableEnumValues') && !in_array($value, $swaggerType::getAllowableEnumValues())) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); From b31a80448a6cf2e0bcd913507412722bc69ec838 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 24 Sep 2017 16:40:06 +0900 Subject: [PATCH 054/197] [PHP] Improve Api template (#6507) * Improve spacing in doc comment * Improve grouping of parameter tags * Improve line length * Fix undefined variable $_tempBody * Improve indent --- .../src/main/resources/php/api.mustache | 131 ++- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 79 +- .../petstore/php/SwaggerClient-php/README.md | 12 +- .../docs/Api/AnotherFakeApi.md | 8 +- .../docs/Api/Fake_classname_tags123Api.md | 57 + .../lib/Api/AnotherFakeApi.php | 119 ++- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 992 +++++++++++------- .../lib/Api/Fake_classname_tags123Api.php | 341 ++++++ .../php/SwaggerClient-php/lib/Api/PetApi.php | 834 +++++++++------ .../SwaggerClient-php/lib/Api/StoreApi.php | 412 +++++--- .../php/SwaggerClient-php/lib/Api/UserApi.php | 724 ++++++++----- .../Api/Fake_classname_tags123ApiTest.php | 83 ++ 12 files changed, 2560 insertions(+), 1232 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md create mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php create mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Api/Fake_classname_tags123ApiTest.php diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 1fa2640c880..a2247273df0 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -50,8 +50,8 @@ use {{invokerPackage}}\ObjectSerializer; /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -84,8 +84,9 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} @@ -108,8 +109,9 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) @@ -135,7 +137,11 @@ use {{invokerPackage}}\ObjectSerializer; if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -168,7 +174,11 @@ use {{invokerPackage}}\ObjectSerializer; {{#responses}} {{#dataType}} {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} - $data = ObjectSerializer::deserialize($e->getResponseBody(), '{{dataType}}', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '{{dataType}}', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; {{/dataType}} @@ -188,16 +198,20 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function {{operationId}}Async({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - return $this->{{operationId}}AsyncWithHttpInfo({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})->then(function ($response) { - return $response[0]; - }); + return $this->{{operationId}}AsyncWithHttpInfo({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -210,8 +224,9 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -220,45 +235,55 @@ use {{invokerPackage}}\ObjectSerializer; $returnType = '{{returnType}}'; $request = $this->{{operationId}}Request({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - {{#returnType}} - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + {{#returnType}} + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + return [null, $response->getStatusCode(), $response->getHeaders()]; + {{/returnType}} + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/returnType}} - {{^returnType}} - return [null, $response->getStatusCode(), $response->getHeaders()]; - {{/returnType}} - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation '{{{operationId}}}' * {{#allParams}} - * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -268,7 +293,9 @@ use {{invokerPackage}}\ObjectSerializer; {{#required}} // verify the required parameter '{{paramName}}' is set if (${{paramName}} === null) { - throw new \InvalidArgumentException('Missing the required parameter ${{paramName}} when calling {{operationId}}'); + throw new \InvalidArgumentException( + 'Missing the required parameter ${{paramName}} when calling {{operationId}}' + ); } {{/required}} {{#hasValidation}} @@ -349,7 +376,11 @@ use {{invokerPackage}}\ObjectSerializer; } {{/collectionFormat}} if (${{paramName}} !== null) { - $resourcePath = str_replace('{' . '{{baseName}}' . '}', ObjectSerializer::toPathValue(${{paramName}}), $resourcePath); + $resourcePath = str_replace( + '{' . '{{baseName}}' . '}', + ObjectSerializer::toPathValue(${{paramName}}), + $resourcePath + ); } {{/pathParams}} @@ -365,9 +396,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/isFile}} } {{/formParams}} - {{#bodyParams}} // body params $_tempBody = null; + {{#bodyParams}} if (isset(${{paramName}})) { $_tempBody = ${{paramName}}; } @@ -397,13 +428,15 @@ use {{invokerPackage}}\ObjectSerializer; 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -429,9 +462,6 @@ use {{invokerPackage}}\ObjectSerializer; {{/isOAuth}} {{/authMethods}} - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -443,9 +473,10 @@ use {{invokerPackage}}\ObjectSerializer; $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( '{{httpMethod}}', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); 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 c6ca2196346..c2e0132a490 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 @@ -59,8 +59,8 @@ class FakeApi /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -85,7 +85,8 @@ public function getConfig() * * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * - * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -100,7 +101,8 @@ public function testCodeInjectEndRnNR($test_code_inject____end____rn_n_r = null) * * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * - * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -126,7 +128,11 @@ public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -147,15 +153,19 @@ public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn * * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * - * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testCodeInjectEndRnNRAsync($test_code_inject____end____rn_n_r = null) { - return $this->testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end____rn_n_r)->then(function ($response) { - return $response[0]; - }); + return $this->testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end____rn_n_r) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -163,7 +173,8 @@ public function testCodeInjectEndRnNRAsync($test_code_inject____end____rn_n_r = * * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * - * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -172,24 +183,34 @@ public function testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end_ $returnType = ''; $request = $this->testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n_r); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'testCodeInjectEndRnNR' * - * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -209,6 +230,8 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n if ($test_code_inject____end____rn_n_r !== null) { $formParams['test code inject */ ' " =end -- \r\n \n \r'] = ObjectSerializer::toFormValue($test_code_inject____end____rn_n_r); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -234,20 +257,19 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -259,9 +281,10 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 83b6d6e01a1..7e6e53dd932 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -56,14 +56,14 @@ Please follow the [installation procedure](#installation--usage) and then run th testSpecialTags($body); + $result = $api_instance->fakeOuterBooleanSerialize($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; } ?> @@ -75,7 +75,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -84,7 +83,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*Fake_classname_tags123Api* | [**testClassname**](docs/Api/Fake_classname_tags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -105,6 +104,7 @@ Class | Method | HTTP request | Description *UserApi* | [**loginUser**](docs/Api/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system *UserApi* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*AnotherfakeApi* | [**testSpecialTags**](docs/Api/AnotherfakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags ## Documentation For Models diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md index 5b443618999..53bd4be8062 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md @@ -1,10 +1,10 @@ -# Swagger\Client\AnotherFakeApi +# Swagger\Client\AnotherfakeApi All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**testSpecialTags**](AnotherfakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags # **testSpecialTags** @@ -19,14 +19,14 @@ To test special tags testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherfakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md new file mode 100644 index 00000000000..d5fe15b46fc --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md @@ -0,0 +1,57 @@ +# Swagger\Client\Fake_classname_tags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> \Swagger\Client\Model\Client testClassname($body) + +To test class name in snake case + +### Example +```php +setApiKey('api_key_query', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key_query', 'Bearer'); + +$api_instance = new Swagger\Client\Api\Fake_classname_tags123Api(new \Http\Adapter\Guzzle6\Client()); +$body = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model + +try { + $result = $api_instance->testClassname($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling Fake_classname_tags123Api->testClassname: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Client**](../Model/Client.md)| client model | + +### Return type + +[**\Swagger\Client\Model\Client**](../Model/Client.md) + +### Authorization + +[api_key_query](../../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + 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 f50a1730338..5e5ba412dd9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -1,6 +1,6 @@ 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -154,7 +160,11 @@ public function testSpecialTagsWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Client', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -167,15 +177,19 @@ public function testSpecialTagsWithHttpInfo($body) * * To test special tags * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testSpecialTagsAsync($body) { - return $this->testSpecialTagsAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->testSpecialTagsAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -183,7 +197,8 @@ public function testSpecialTagsAsync($body) * * To test special tags * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -192,38 +207,48 @@ public function testSpecialTagsAsyncWithHttpInfo($body) $returnType = '\Swagger\Client\Model\Client'; $request = $this->testSpecialTagsRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'testSpecialTags' * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -231,7 +256,9 @@ protected function testSpecialTagsRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testSpecialTags'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling testSpecialTags' + ); } $resourcePath = '/another-fake/dummy'; @@ -273,20 +300,19 @@ protected function testSpecialTagsRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -298,9 +324,10 @@ protected function testSpecialTagsRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); 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 ac6c71e1178..cf1f539567c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -59,8 +59,8 @@ class FakeApi /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -83,7 +83,8 @@ public function getConfig() /** * Operation fakeOuterBooleanSerialize * - * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\OuterBoolean @@ -97,7 +98,8 @@ public function fakeOuterBooleanSerialize($body = null) /** * Operation fakeOuterBooleanSerializeWithHttpInfo * - * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\OuterBoolean, HTTP status code, HTTP response headers (array of strings) @@ -123,7 +125,11 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -149,7 +155,11 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterBoolean', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\OuterBoolean', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -162,15 +172,19 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) * * * - * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterBooleanSerializeAsync($body = null) { - return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -178,7 +192,8 @@ public function fakeOuterBooleanSerializeAsync($body = null) * * * - * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -187,38 +202,48 @@ public function fakeOuterBooleanSerializeAsyncWithHttpInfo($body = null) $returnType = '\Swagger\Client\Model\OuterBoolean'; $request = $this->fakeOuterBooleanSerializeRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'fakeOuterBooleanSerialize' * - * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -264,20 +289,19 @@ protected function fakeOuterBooleanSerializeRequest($body = null) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -289,9 +313,10 @@ protected function fakeOuterBooleanSerializeRequest($body = null) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -300,7 +325,8 @@ protected function fakeOuterBooleanSerializeRequest($body = null) /** * Operation fakeOuterCompositeSerialize * - * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\OuterComposite @@ -314,7 +340,8 @@ public function fakeOuterCompositeSerialize($body = null) /** * Operation fakeOuterCompositeSerializeWithHttpInfo * - * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) @@ -340,7 +367,11 @@ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -366,7 +397,11 @@ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterComposite', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\OuterComposite', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -379,15 +414,19 @@ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) * * * - * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterCompositeSerializeAsync($body = null) { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -395,7 +434,8 @@ public function fakeOuterCompositeSerializeAsync($body = null) * * * - * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -404,38 +444,48 @@ public function fakeOuterCompositeSerializeAsyncWithHttpInfo($body = null) $returnType = '\Swagger\Client\Model\OuterComposite'; $request = $this->fakeOuterCompositeSerializeRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'fakeOuterCompositeSerialize' * - * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -481,20 +531,19 @@ protected function fakeOuterCompositeSerializeRequest($body = null) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -506,9 +555,10 @@ protected function fakeOuterCompositeSerializeRequest($body = null) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -517,7 +567,8 @@ protected function fakeOuterCompositeSerializeRequest($body = null) /** * Operation fakeOuterNumberSerialize * - * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\OuterNumber @@ -531,7 +582,8 @@ public function fakeOuterNumberSerialize($body = null) /** * Operation fakeOuterNumberSerializeWithHttpInfo * - * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\OuterNumber, HTTP status code, HTTP response headers (array of strings) @@ -557,7 +609,11 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -583,7 +639,11 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterNumber', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\OuterNumber', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -596,15 +656,19 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) * * * - * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterNumberSerializeAsync($body = null) { - return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -612,7 +676,8 @@ public function fakeOuterNumberSerializeAsync($body = null) * * * - * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -621,38 +686,48 @@ public function fakeOuterNumberSerializeAsyncWithHttpInfo($body = null) $returnType = '\Swagger\Client\Model\OuterNumber'; $request = $this->fakeOuterNumberSerializeRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'fakeOuterNumberSerialize' * - * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -698,20 +773,19 @@ protected function fakeOuterNumberSerializeRequest($body = null) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -723,9 +797,10 @@ protected function fakeOuterNumberSerializeRequest($body = null) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -734,7 +809,8 @@ protected function fakeOuterNumberSerializeRequest($body = null) /** * Operation fakeOuterStringSerialize * - * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\OuterString @@ -748,7 +824,8 @@ public function fakeOuterStringSerialize($body = null) /** * Operation fakeOuterStringSerializeWithHttpInfo * - * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\OuterString, HTTP status code, HTTP response headers (array of strings) @@ -774,7 +851,11 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -800,7 +881,11 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterString', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\OuterString', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -813,15 +898,19 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) * * * - * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterStringSerializeAsync($body = null) { - return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -829,7 +918,8 @@ public function fakeOuterStringSerializeAsync($body = null) * * * - * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -838,38 +928,48 @@ public function fakeOuterStringSerializeAsyncWithHttpInfo($body = null) $returnType = '\Swagger\Client\Model\OuterString'; $request = $this->fakeOuterStringSerializeRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'fakeOuterStringSerialize' * - * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -915,20 +1015,19 @@ protected function fakeOuterStringSerializeRequest($body = null) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -940,9 +1039,10 @@ protected function fakeOuterStringSerializeRequest($body = null) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -953,7 +1053,8 @@ protected function fakeOuterStringSerializeRequest($body = null) * * To test \"client\" model * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Client @@ -969,7 +1070,8 @@ public function testClientModel($body) * * To test \"client\" model * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) @@ -995,7 +1097,11 @@ public function testClientModelWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1021,7 +1127,11 @@ public function testClientModelWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Client', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -1034,15 +1144,19 @@ public function testClientModelWithHttpInfo($body) * * To test \"client\" model * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClientModelAsync($body) { - return $this->testClientModelAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->testClientModelAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1050,7 +1164,8 @@ public function testClientModelAsync($body) * * To test \"client\" model * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1059,38 +1174,48 @@ public function testClientModelAsyncWithHttpInfo($body) $returnType = '\Swagger\Client\Model\Client'; $request = $this->testClientModelRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'testClientModel' * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1098,7 +1223,9 @@ protected function testClientModelRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClientModel'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling testClientModel' + ); } $resourcePath = '/fake'; @@ -1140,20 +1267,19 @@ protected function testClientModelRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1165,9 +1291,10 @@ protected function testClientModelRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1178,20 +1305,21 @@ protected function testClientModelRequest($body) * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param string $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param float $number None (required) + * @param double $double None (required) + * @param string $pattern_without_delimiter None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $string None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @param string $callback None (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1206,20 +1334,21 @@ public function testEndpointParameters($number, $double, $pattern_without_delimi * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param string $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param float $number None (required) + * @param double $double None (required) + * @param string $pattern_without_delimiter None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $string None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @param string $callback None (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1245,7 +1374,11 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1266,28 +1399,32 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param string $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param float $number None (required) + * @param double $double None (required) + * @param string $pattern_without_delimiter None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $string None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @param string $callback None (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) { - return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback)->then(function ($response) { - return $response[0]; - }); + return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1295,20 +1432,21 @@ public function testEndpointParametersAsync($number, $double, $pattern_without_d * * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param string $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param float $number None (required) + * @param double $double None (required) + * @param string $pattern_without_delimiter None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $string None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @param string $callback None (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1317,37 +1455,47 @@ public function testEndpointParametersAsyncWithHttpInfo($number, $double, $patte $returnType = ''; $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'testEndpointParameters' * - * @param float $number None (required) - * @param double $double None (required) - * @param string $pattern_without_delimiter None (required) - * @param string $byte None (required) - * @param int $integer None (optional) - * @param int $int32 None (optional) - * @param int $int64 None (optional) - * @param float $float None (optional) - * @param string $string None (optional) - * @param string $binary None (optional) - * @param \DateTime $date None (optional) - * @param \DateTime $date_time None (optional) - * @param string $password None (optional) - * @param string $callback None (optional) + * @param float $number None (required) + * @param double $double None (required) + * @param string $pattern_without_delimiter None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $string None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @param string $callback None (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1355,7 +1503,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with { // verify the required parameter 'number' is set if ($number === null) { - throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters'); + throw new \InvalidArgumentException( + 'Missing the required parameter $number when calling testEndpointParameters' + ); } if ($number > 543.2) { throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.'); @@ -1366,7 +1516,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // verify the required parameter 'double' is set if ($double === null) { - throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters'); + throw new \InvalidArgumentException( + 'Missing the required parameter $double when calling testEndpointParameters' + ); } if ($double > 123.4) { throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.'); @@ -1377,7 +1529,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // verify the required parameter 'pattern_without_delimiter' is set if ($pattern_without_delimiter === null) { - throw new \InvalidArgumentException('Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters'); + throw new \InvalidArgumentException( + 'Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters' + ); } if (!preg_match("/^[A-Z].*_/", $pattern_without_delimiter)) { throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*_/."); @@ -1385,7 +1539,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // verify the required parameter 'byte' is set if ($byte === null) { - throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters'); + throw new \InvalidArgumentException( + 'Missing the required parameter $byte when calling testEndpointParameters' + ); } if ($integer !== null && $integer > 100) { throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); @@ -1482,6 +1638,8 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with if ($callback !== null) { $formParams['callback'] = ObjectSerializer::toFormValue($callback); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1507,13 +1665,15 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1522,9 +1682,6 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1536,9 +1693,10 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1549,14 +1707,15 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with * * To test enum parameters * - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) - * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) + * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) + * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) + * @param int $enum_query_integer Query parameter enum test (double) (optional) + * @param double $enum_query_double Query parameter enum test (double) (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1571,14 +1730,15 @@ public function testEnumParameters($enum_form_string_array = null, $enum_form_st * * To test enum parameters * - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) - * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) + * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) + * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) + * @param int $enum_query_integer Query parameter enum test (double) (optional) + * @param double $enum_query_double Query parameter enum test (double) (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1604,7 +1764,11 @@ public function testEnumParametersWithHttpInfo($enum_form_string_array = null, $ if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1625,22 +1789,26 @@ public function testEnumParametersWithHttpInfo($enum_form_string_array = null, $ * * To test enum parameters * - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) - * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) + * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) + * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) + * @param int $enum_query_integer Query parameter enum test (double) (optional) + * @param double $enum_query_double Query parameter enum test (double) (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEnumParametersAsync($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) { - return $this->testEnumParametersAsyncWithHttpInfo($enum_form_string_array, $enum_form_string, $enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double)->then(function ($response) { - return $response[0]; - }); + return $this->testEnumParametersAsyncWithHttpInfo($enum_form_string_array, $enum_form_string, $enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1648,14 +1816,15 @@ public function testEnumParametersAsync($enum_form_string_array = null, $enum_fo * * To test enum parameters * - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) - * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) + * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) + * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) + * @param int $enum_query_integer Query parameter enum test (double) (optional) + * @param double $enum_query_double Query parameter enum test (double) (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1664,31 +1833,41 @@ public function testEnumParametersAsyncWithHttpInfo($enum_form_string_array = nu $returnType = ''; $request = $this->testEnumParametersRequest($enum_form_string_array, $enum_form_string, $enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'testEnumParameters' * - * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) - * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) - * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) - * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) - * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) - * @param int $enum_query_integer Query parameter enum test (double) (optional) - * @param double $enum_query_double Query parameter enum test (double) (optional) + * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional) + * @param string $enum_form_string Form parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_header_string_array Header parameter enum test (string array) (optional) + * @param string $enum_header_string Header parameter enum test (string) (optional, default to -efg) + * @param string[] $enum_query_string_array Query parameter enum test (string array) (optional) + * @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg) + * @param int $enum_query_integer Query parameter enum test (double) (optional) + * @param double $enum_query_double Query parameter enum test (double) (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1742,6 +1921,8 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en if ($enum_query_double !== null) { $formParams['enum_query_double'] = ObjectSerializer::toFormValue($enum_query_double); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1767,20 +1948,19 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1792,9 +1972,10 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1805,8 +1986,9 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en * * test json serialization of form data * - * @param string $param field1 (required) - * @param string $param2 field2 (required) + * @param string $param field1 (required) + * @param string $param2 field2 (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1821,8 +2003,9 @@ public function testJsonFormData($param, $param2) * * test json serialization of form data * - * @param string $param field1 (required) - * @param string $param2 field2 (required) + * @param string $param field1 (required) + * @param string $param2 field2 (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1848,7 +2031,11 @@ public function testJsonFormDataWithHttpInfo($param, $param2) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1869,16 +2056,20 @@ public function testJsonFormDataWithHttpInfo($param, $param2) * * test json serialization of form data * - * @param string $param field1 (required) - * @param string $param2 field2 (required) + * @param string $param field1 (required) + * @param string $param2 field2 (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testJsonFormDataAsync($param, $param2) { - return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)->then(function ($response) { - return $response[0]; - }); + return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1886,8 +2077,9 @@ public function testJsonFormDataAsync($param, $param2) * * test json serialization of form data * - * @param string $param field1 (required) - * @param string $param2 field2 (required) + * @param string $param field1 (required) + * @param string $param2 field2 (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1896,25 +2088,35 @@ public function testJsonFormDataAsyncWithHttpInfo($param, $param2) $returnType = ''; $request = $this->testJsonFormDataRequest($param, $param2); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'testJsonFormData' * - * @param string $param field1 (required) - * @param string $param2 field2 (required) + * @param string $param field1 (required) + * @param string $param2 field2 (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1922,11 +2124,15 @@ protected function testJsonFormDataRequest($param, $param2) { // verify the required parameter 'param' is set if ($param === null) { - throw new \InvalidArgumentException('Missing the required parameter $param when calling testJsonFormData'); + throw new \InvalidArgumentException( + 'Missing the required parameter $param when calling testJsonFormData' + ); } // verify the required parameter 'param2' is set if ($param2 === null) { - throw new \InvalidArgumentException('Missing the required parameter $param2 when calling testJsonFormData'); + throw new \InvalidArgumentException( + 'Missing the required parameter $param2 when calling testJsonFormData' + ); } $resourcePath = '/fake/jsonFormData'; @@ -1946,6 +2152,8 @@ protected function testJsonFormDataRequest($param, $param2) if ($param2 !== null) { $formParams['param2'] = ObjectSerializer::toFormValue($param2); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1971,20 +2179,19 @@ protected function testJsonFormDataRequest($param, $param2) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1996,9 +2203,10 @@ protected function testJsonFormDataRequest($param, $param2) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php new file mode 100644 index 00000000000..dd25d6ae6f7 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php @@ -0,0 +1,341 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation testClassname + * + * To test class name in snake case + * + * @param \Swagger\Client\Model\Client $body client model (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Client + */ + public function testClassname($body) + { + list($response) = $this->testClassnameWithHttpInfo($body); + return $response; + } + + /** + * Operation testClassnameWithHttpInfo + * + * To test class name in snake case + * + * @param \Swagger\Client\Model\Client $body client model (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) + */ + public function testClassnameWithHttpInfo($body) + { + $returnType = '\Swagger\Client\Model\Client'; + $request = $this->testClassnameRequest($body); + + try { + + try { + $response = $this->client->send($request); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Client', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation testClassnameAsync + * + * To test class name in snake case + * + * @param \Swagger\Client\Model\Client $body client model (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testClassnameAsync($body) + { + return $this->testClassnameAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testClassnameAsyncWithHttpInfo + * + * To test class name in snake case + * + * @param \Swagger\Client\Model\Client $body client model (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testClassnameAsyncWithHttpInfo($body) + { + $returnType = '\Swagger\Client\Model\Client'; + $request = $this->testClassnameRequest($body); + + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testClassname' + * + * @param \Swagger\Client\Model\Client $body client model (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testClassnameRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling testClassname' + ); + } + + $resourcePath = '/fake_classname_test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key_query'); + if ($apiKey !== null) { + $queryParams['api_key_query'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} 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 989219ad924..3214d9769e2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -59,8 +59,8 @@ class PetApi /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -85,7 +85,8 @@ public function getConfig() * * Add a new pet to the store * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -100,7 +101,8 @@ public function addPet($body) * * Add a new pet to the store * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -126,7 +128,11 @@ public function addPetWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -147,15 +153,19 @@ public function addPetWithHttpInfo($body) * * Add a new pet to the store * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function addPetAsync($body) { - return $this->addPetAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->addPetAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -163,7 +173,8 @@ public function addPetAsync($body) * * Add a new pet to the store * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -172,24 +183,34 @@ public function addPetAsyncWithHttpInfo($body) $returnType = ''; $request = $this->addPetRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'addPet' * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -197,7 +218,9 @@ protected function addPetRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling addPet'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling addPet' + ); } $resourcePath = '/pet'; @@ -239,13 +262,15 @@ protected function addPetRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -254,9 +279,6 @@ protected function addPetRequest($body) $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -268,9 +290,10 @@ protected function addPetRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -281,8 +304,9 @@ protected function addPetRequest($body) * * Deletes a pet * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param int $pet_id Pet id to delete (required) + * @param string $api_key (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -297,8 +321,9 @@ public function deletePet($pet_id, $api_key = null) * * Deletes a pet * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param int $pet_id Pet id to delete (required) + * @param string $api_key (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -324,7 +349,11 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -345,16 +374,20 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) * * Deletes a pet * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param int $pet_id Pet id to delete (required) + * @param string $api_key (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deletePetAsync($pet_id, $api_key = null) { - return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key)->then(function ($response) { - return $response[0]; - }); + return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -362,8 +395,9 @@ public function deletePetAsync($pet_id, $api_key = null) * * Deletes a pet * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param int $pet_id Pet id to delete (required) + * @param string $api_key (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -372,25 +406,35 @@ public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) $returnType = ''; $request = $this->deletePetRequest($pet_id, $api_key); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'deletePet' * - * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param int $pet_id Pet id to delete (required) + * @param string $api_key (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -398,7 +442,9 @@ protected function deletePetRequest($pet_id, $api_key = null) { // verify the required parameter 'pet_id' is set if ($pet_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling deletePet'); + throw new \InvalidArgumentException( + 'Missing the required parameter $pet_id when calling deletePet' + ); } $resourcePath = '/pet/{petId}'; @@ -415,9 +461,15 @@ protected function deletePetRequest($pet_id, $api_key = null) // path params if ($pet_id !== null) { - $resourcePath = str_replace('{' . 'petId' . '}', ObjectSerializer::toPathValue($pet_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'petId' . '}', + ObjectSerializer::toPathValue($pet_id), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -443,13 +495,15 @@ protected function deletePetRequest($pet_id, $api_key = null) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -458,9 +512,6 @@ protected function deletePetRequest($pet_id, $api_key = null) $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -472,9 +523,10 @@ protected function deletePetRequest($pet_id, $api_key = null) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -485,7 +537,8 @@ protected function deletePetRequest($pet_id, $api_key = null) * * Finds Pets by status * - * @param string[] $status Status values that need to be considered for filter (required) + * @param string[] $status Status values that need to be considered for filter (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Pet[] @@ -501,7 +554,8 @@ public function findPetsByStatus($status) * * Finds Pets by status * - * @param string[] $status Status values that need to be considered for filter (required) + * @param string[] $status Status values that need to be considered for filter (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) @@ -527,7 +581,11 @@ public function findPetsByStatusWithHttpInfo($status) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -553,7 +611,11 @@ public function findPetsByStatusWithHttpInfo($status) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Pet[]', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -566,15 +628,19 @@ public function findPetsByStatusWithHttpInfo($status) * * Finds Pets by status * - * @param string[] $status Status values that need to be considered for filter (required) + * @param string[] $status Status values that need to be considered for filter (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByStatusAsync($status) { - return $this->findPetsByStatusAsyncWithHttpInfo($status)->then(function ($response) { - return $response[0]; - }); + return $this->findPetsByStatusAsyncWithHttpInfo($status) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -582,7 +648,8 @@ public function findPetsByStatusAsync($status) * * Finds Pets by status * - * @param string[] $status Status values that need to be considered for filter (required) + * @param string[] $status Status values that need to be considered for filter (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -591,38 +658,48 @@ public function findPetsByStatusAsyncWithHttpInfo($status) $returnType = '\Swagger\Client\Model\Pet[]'; $request = $this->findPetsByStatusRequest($status); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'findPetsByStatus' * - * @param string[] $status Status values that need to be considered for filter (required) + * @param string[] $status Status values that need to be considered for filter (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -630,7 +707,9 @@ protected function findPetsByStatusRequest($status) { // verify the required parameter 'status' is set if ($status === null) { - throw new \InvalidArgumentException('Missing the required parameter $status when calling findPetsByStatus'); + throw new \InvalidArgumentException( + 'Missing the required parameter $status when calling findPetsByStatus' + ); } $resourcePath = '/pet/findByStatus'; @@ -649,6 +728,8 @@ protected function findPetsByStatusRequest($status) } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -674,13 +755,15 @@ protected function findPetsByStatusRequest($status) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -689,9 +772,6 @@ protected function findPetsByStatusRequest($status) $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -703,9 +783,10 @@ protected function findPetsByStatusRequest($status) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -716,7 +797,8 @@ protected function findPetsByStatusRequest($status) * * Finds Pets by tags * - * @param string[] $tags Tags to filter by (required) + * @param string[] $tags Tags to filter by (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Pet[] @@ -732,7 +814,8 @@ public function findPetsByTags($tags) * * Finds Pets by tags * - * @param string[] $tags Tags to filter by (required) + * @param string[] $tags Tags to filter by (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) @@ -758,7 +841,11 @@ public function findPetsByTagsWithHttpInfo($tags) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -784,7 +871,11 @@ public function findPetsByTagsWithHttpInfo($tags) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Pet[]', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -797,15 +888,19 @@ public function findPetsByTagsWithHttpInfo($tags) * * Finds Pets by tags * - * @param string[] $tags Tags to filter by (required) + * @param string[] $tags Tags to filter by (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByTagsAsync($tags) { - return $this->findPetsByTagsAsyncWithHttpInfo($tags)->then(function ($response) { - return $response[0]; - }); + return $this->findPetsByTagsAsyncWithHttpInfo($tags) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -813,7 +908,8 @@ public function findPetsByTagsAsync($tags) * * Finds Pets by tags * - * @param string[] $tags Tags to filter by (required) + * @param string[] $tags Tags to filter by (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -822,38 +918,48 @@ public function findPetsByTagsAsyncWithHttpInfo($tags) $returnType = '\Swagger\Client\Model\Pet[]'; $request = $this->findPetsByTagsRequest($tags); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'findPetsByTags' * - * @param string[] $tags Tags to filter by (required) + * @param string[] $tags Tags to filter by (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -861,7 +967,9 @@ protected function findPetsByTagsRequest($tags) { // verify the required parameter 'tags' is set if ($tags === null) { - throw new \InvalidArgumentException('Missing the required parameter $tags when calling findPetsByTags'); + throw new \InvalidArgumentException( + 'Missing the required parameter $tags when calling findPetsByTags' + ); } $resourcePath = '/pet/findByTags'; @@ -880,6 +988,8 @@ protected function findPetsByTagsRequest($tags) } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -905,13 +1015,15 @@ protected function findPetsByTagsRequest($tags) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -920,9 +1032,6 @@ protected function findPetsByTagsRequest($tags) $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -934,9 +1043,10 @@ protected function findPetsByTagsRequest($tags) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -947,7 +1057,8 @@ protected function findPetsByTagsRequest($tags) * * Find pet by ID * - * @param int $pet_id ID of pet to return (required) + * @param int $pet_id ID of pet to return (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Pet @@ -963,7 +1074,8 @@ public function getPetById($pet_id) * * Find pet by ID * - * @param int $pet_id ID of pet to return (required) + * @param int $pet_id ID of pet to return (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings) @@ -989,7 +1101,11 @@ public function getPetByIdWithHttpInfo($pet_id) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1015,7 +1131,11 @@ public function getPetByIdWithHttpInfo($pet_id) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Pet', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -1028,15 +1148,19 @@ public function getPetByIdWithHttpInfo($pet_id) * * Find pet by ID * - * @param int $pet_id ID of pet to return (required) + * @param int $pet_id ID of pet to return (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getPetByIdAsync($pet_id) { - return $this->getPetByIdAsyncWithHttpInfo($pet_id)->then(function ($response) { - return $response[0]; - }); + return $this->getPetByIdAsyncWithHttpInfo($pet_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1044,7 +1168,8 @@ public function getPetByIdAsync($pet_id) * * Find pet by ID * - * @param int $pet_id ID of pet to return (required) + * @param int $pet_id ID of pet to return (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1053,38 +1178,48 @@ public function getPetByIdAsyncWithHttpInfo($pet_id) $returnType = '\Swagger\Client\Model\Pet'; $request = $this->getPetByIdRequest($pet_id); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'getPetById' * - * @param int $pet_id ID of pet to return (required) + * @param int $pet_id ID of pet to return (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1092,7 +1227,9 @@ protected function getPetByIdRequest($pet_id) { // verify the required parameter 'pet_id' is set if ($pet_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling getPetById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $pet_id when calling getPetById' + ); } $resourcePath = '/pet/{petId}'; @@ -1105,9 +1242,15 @@ protected function getPetByIdRequest($pet_id) // path params if ($pet_id !== null) { - $resourcePath = str_replace('{' . 'petId' . '}', ObjectSerializer::toPathValue($pet_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'petId' . '}', + ObjectSerializer::toPathValue($pet_id), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1133,13 +1276,15 @@ protected function getPetByIdRequest($pet_id) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1149,9 +1294,6 @@ protected function getPetByIdRequest($pet_id) $headers['api_key'] = $apiKey; } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1163,9 +1305,10 @@ protected function getPetByIdRequest($pet_id) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1176,7 +1319,8 @@ protected function getPetByIdRequest($pet_id) * * Update an existing pet * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1191,7 +1335,8 @@ public function updatePet($body) * * Update an existing pet * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1217,7 +1362,11 @@ public function updatePetWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1238,15 +1387,19 @@ public function updatePetWithHttpInfo($body) * * Update an existing pet * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetAsync($body) { - return $this->updatePetAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->updatePetAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1254,7 +1407,8 @@ public function updatePetAsync($body) * * Update an existing pet * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1263,24 +1417,34 @@ public function updatePetAsyncWithHttpInfo($body) $returnType = ''; $request = $this->updatePetRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'updatePet' * - * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1288,7 +1452,9 @@ protected function updatePetRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling updatePet'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updatePet' + ); } $resourcePath = '/pet'; @@ -1330,13 +1496,15 @@ protected function updatePetRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1345,9 +1513,6 @@ protected function updatePetRequest($body) $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1359,9 +1524,10 @@ protected function updatePetRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1372,9 +1538,10 @@ protected function updatePetRequest($body) * * Updates a pet in the store with form data * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param int $pet_id ID of pet that needs to be updated (required) + * @param string $name Updated name of the pet (optional) + * @param string $status Updated status of the pet (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1389,9 +1556,10 @@ public function updatePetWithForm($pet_id, $name = null, $status = null) * * Updates a pet in the store with form data * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param int $pet_id ID of pet that needs to be updated (required) + * @param string $name Updated name of the pet (optional) + * @param string $status Updated status of the pet (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1417,7 +1585,11 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1438,17 +1610,21 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n * * Updates a pet in the store with form data * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param int $pet_id ID of pet that needs to be updated (required) + * @param string $name Updated name of the pet (optional) + * @param string $status Updated status of the pet (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetWithFormAsync($pet_id, $name = null, $status = null) { - return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status)->then(function ($response) { - return $response[0]; - }); + return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1456,9 +1632,10 @@ public function updatePetWithFormAsync($pet_id, $name = null, $status = null) * * Updates a pet in the store with form data * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param int $pet_id ID of pet that needs to be updated (required) + * @param string $name Updated name of the pet (optional) + * @param string $status Updated status of the pet (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1467,26 +1644,36 @@ public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $statu $returnType = ''; $request = $this->updatePetWithFormRequest($pet_id, $name, $status); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'updatePetWithForm' * - * @param int $pet_id ID of pet that needs to be updated (required) - * @param string $name Updated name of the pet (optional) - * @param string $status Updated status of the pet (optional) + * @param int $pet_id ID of pet that needs to be updated (required) + * @param string $name Updated name of the pet (optional) + * @param string $status Updated status of the pet (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1494,7 +1681,9 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul { // verify the required parameter 'pet_id' is set if ($pet_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling updatePetWithForm'); + throw new \InvalidArgumentException( + 'Missing the required parameter $pet_id when calling updatePetWithForm' + ); } $resourcePath = '/pet/{petId}'; @@ -1507,7 +1696,11 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul // path params if ($pet_id !== null) { - $resourcePath = str_replace('{' . 'petId' . '}', ObjectSerializer::toPathValue($pet_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'petId' . '}', + ObjectSerializer::toPathValue($pet_id), + $resourcePath + ); } // form params @@ -1518,6 +1711,8 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul if ($status !== null) { $formParams['status'] = ObjectSerializer::toFormValue($status); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1543,13 +1738,15 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1558,9 +1755,6 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1572,9 +1766,10 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1585,9 +1780,10 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul * * uploads an image * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param int $pet_id ID of pet to update (required) + * @param string $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject $file file to upload (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\ApiResponse @@ -1603,9 +1799,10 @@ public function uploadFile($pet_id, $additional_metadata = null, $file = null) * * uploads an image * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param int $pet_id ID of pet to update (required) + * @param string $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject $file file to upload (optional) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) @@ -1631,7 +1828,11 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1657,7 +1858,11 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\ApiResponse', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\ApiResponse', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -1670,17 +1875,21 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi * * uploads an image * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param int $pet_id ID of pet to update (required) + * @param string $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject $file file to upload (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) { - return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file)->then(function ($response) { - return $response[0]; - }); + return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1688,9 +1897,10 @@ public function uploadFileAsync($pet_id, $additional_metadata = null, $file = nu * * uploads an image * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param int $pet_id ID of pet to update (required) + * @param string $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject $file file to upload (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1699,40 +1909,50 @@ public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null $returnType = '\Swagger\Client\Model\ApiResponse'; $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'uploadFile' * - * @param int $pet_id ID of pet to update (required) - * @param string $additional_metadata Additional data to pass to server (optional) - * @param \SplFileObject $file file to upload (optional) + * @param int $pet_id ID of pet to update (required) + * @param string $additional_metadata Additional data to pass to server (optional) + * @param \SplFileObject $file file to upload (optional) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1740,7 +1960,9 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file { // verify the required parameter 'pet_id' is set if ($pet_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $pet_id when calling uploadFile'); + throw new \InvalidArgumentException( + 'Missing the required parameter $pet_id when calling uploadFile' + ); } $resourcePath = '/pet/{petId}/uploadImage'; @@ -1753,7 +1975,11 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // path params if ($pet_id !== null) { - $resourcePath = str_replace('{' . 'petId' . '}', ObjectSerializer::toPathValue($pet_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'petId' . '}', + ObjectSerializer::toPathValue($pet_id), + $resourcePath + ); } // form params @@ -1765,6 +1991,8 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $multipart = true; $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1790,13 +2018,15 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -1805,9 +2035,6 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1819,9 +2046,10 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); 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 5cd336fe458..684f67f65d4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -59,8 +59,8 @@ class StoreApi /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -85,7 +85,8 @@ public function getConfig() * * Delete purchase order by ID * - * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $order_id ID of the order that needs to be deleted (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -100,7 +101,8 @@ public function deleteOrder($order_id) * * Delete purchase order by ID * - * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $order_id ID of the order that needs to be deleted (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -126,7 +128,11 @@ public function deleteOrderWithHttpInfo($order_id) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -147,15 +153,19 @@ public function deleteOrderWithHttpInfo($order_id) * * Delete purchase order by ID * - * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $order_id ID of the order that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteOrderAsync($order_id) { - return $this->deleteOrderAsyncWithHttpInfo($order_id)->then(function ($response) { - return $response[0]; - }); + return $this->deleteOrderAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -163,7 +173,8 @@ public function deleteOrderAsync($order_id) * * Delete purchase order by ID * - * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $order_id ID of the order that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -172,24 +183,34 @@ public function deleteOrderAsyncWithHttpInfo($order_id) $returnType = ''; $request = $this->deleteOrderRequest($order_id); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'deleteOrder' * - * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $order_id ID of the order that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -197,7 +218,9 @@ protected function deleteOrderRequest($order_id) { // verify the required parameter 'order_id' is set if ($order_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder'); + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling deleteOrder' + ); } $resourcePath = '/store/order/{order_id}'; @@ -210,9 +233,15 @@ protected function deleteOrderRequest($order_id) // path params if ($order_id !== null) { - $resourcePath = str_replace('{' . 'order_id' . '}', ObjectSerializer::toPathValue($order_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -238,20 +267,19 @@ protected function deleteOrderRequest($order_id) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -263,9 +291,10 @@ protected function deleteOrderRequest($order_id) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -276,6 +305,7 @@ protected function deleteOrderRequest($order_id) * * Returns pet inventories by status * + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return map[string,int] @@ -291,6 +321,7 @@ public function getInventory() * * Returns pet inventories by status * + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of map[string,int], HTTP status code, HTTP response headers (array of strings) @@ -316,7 +347,11 @@ public function getInventoryWithHttpInfo() if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -342,7 +377,11 @@ public function getInventoryWithHttpInfo() } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'map[string,int]', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -355,14 +394,18 @@ public function getInventoryWithHttpInfo() * * Returns pet inventories by status * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getInventoryAsync() { - return $this->getInventoryAsyncWithHttpInfo()->then(function ($response) { - return $response[0]; - }); + return $this->getInventoryAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -370,6 +413,7 @@ public function getInventoryAsync() * * Returns pet inventories by status * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -378,37 +422,47 @@ public function getInventoryAsyncWithHttpInfo() $returnType = 'map[string,int]'; $request = $this->getInventoryRequest(); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'getInventory' * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -424,6 +478,8 @@ protected function getInventoryRequest() + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -449,13 +505,15 @@ protected function getInventoryRequest() 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -465,9 +523,6 @@ protected function getInventoryRequest() $headers['api_key'] = $apiKey; } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -479,9 +534,10 @@ protected function getInventoryRequest() $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -492,7 +548,8 @@ protected function getInventoryRequest() * * Find purchase order by ID * - * @param int $order_id ID of pet that needs to be fetched (required) + * @param int $order_id ID of pet that needs to be fetched (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Order @@ -508,7 +565,8 @@ public function getOrderById($order_id) * * Find purchase order by ID * - * @param int $order_id ID of pet that needs to be fetched (required) + * @param int $order_id ID of pet that needs to be fetched (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) @@ -534,7 +592,11 @@ public function getOrderByIdWithHttpInfo($order_id) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -560,7 +622,11 @@ public function getOrderByIdWithHttpInfo($order_id) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Order', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -573,15 +639,19 @@ public function getOrderByIdWithHttpInfo($order_id) * * Find purchase order by ID * - * @param int $order_id ID of pet that needs to be fetched (required) + * @param int $order_id ID of pet that needs to be fetched (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getOrderByIdAsync($order_id) { - return $this->getOrderByIdAsyncWithHttpInfo($order_id)->then(function ($response) { - return $response[0]; - }); + return $this->getOrderByIdAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -589,7 +659,8 @@ public function getOrderByIdAsync($order_id) * * Find purchase order by ID * - * @param int $order_id ID of pet that needs to be fetched (required) + * @param int $order_id ID of pet that needs to be fetched (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -598,38 +669,48 @@ public function getOrderByIdAsyncWithHttpInfo($order_id) $returnType = '\Swagger\Client\Model\Order'; $request = $this->getOrderByIdRequest($order_id); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'getOrderById' * - * @param int $order_id ID of pet that needs to be fetched (required) + * @param int $order_id ID of pet that needs to be fetched (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -637,7 +718,9 @@ protected function getOrderByIdRequest($order_id) { // verify the required parameter 'order_id' is set if ($order_id === null) { - throw new \InvalidArgumentException('Missing the required parameter $order_id when calling getOrderById'); + throw new \InvalidArgumentException( + 'Missing the required parameter $order_id when calling getOrderById' + ); } if ($order_id > 5) { throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); @@ -657,9 +740,15 @@ protected function getOrderByIdRequest($order_id) // path params if ($order_id !== null) { - $resourcePath = str_replace('{' . 'order_id' . '}', ObjectSerializer::toPathValue($order_id), $resourcePath); + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -685,20 +774,19 @@ protected function getOrderByIdRequest($order_id) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -710,9 +798,10 @@ protected function getOrderByIdRequest($order_id) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -723,7 +812,8 @@ protected function getOrderByIdRequest($order_id) * * Place an order for a pet * - * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\Order @@ -739,7 +829,8 @@ public function placeOrder($body) * * Place an order for a pet * - * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) @@ -765,7 +856,11 @@ public function placeOrderWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -791,7 +886,11 @@ public function placeOrderWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Order', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -804,15 +903,19 @@ public function placeOrderWithHttpInfo($body) * * Place an order for a pet * - * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function placeOrderAsync($body) { - return $this->placeOrderAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->placeOrderAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -820,7 +923,8 @@ public function placeOrderAsync($body) * * Place an order for a pet * - * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -829,38 +933,48 @@ public function placeOrderAsyncWithHttpInfo($body) $returnType = '\Swagger\Client\Model\Order'; $request = $this->placeOrderRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'placeOrder' * - * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -868,7 +982,9 @@ protected function placeOrderRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling placeOrder'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling placeOrder' + ); } $resourcePath = '/store/order'; @@ -910,20 +1026,19 @@ protected function placeOrderRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -935,9 +1050,10 @@ protected function placeOrderRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); 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 321aa41ac75..b2517fd4479 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -59,8 +59,8 @@ class UserApi /** * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector + * @param Configuration $config + * @param HeaderSelector $selector */ public function __construct( ClientInterface $client = null, @@ -85,7 +85,8 @@ public function getConfig() * * Create user * - * @param \Swagger\Client\Model\User $body Created user object (required) + * @param \Swagger\Client\Model\User $body Created user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -100,7 +101,8 @@ public function createUser($body) * * Create user * - * @param \Swagger\Client\Model\User $body Created user object (required) + * @param \Swagger\Client\Model\User $body Created user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -126,7 +128,11 @@ public function createUserWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -147,15 +153,19 @@ public function createUserWithHttpInfo($body) * * Create user * - * @param \Swagger\Client\Model\User $body Created user object (required) + * @param \Swagger\Client\Model\User $body Created user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUserAsync($body) { - return $this->createUserAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->createUserAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -163,7 +173,8 @@ public function createUserAsync($body) * * Create user * - * @param \Swagger\Client\Model\User $body Created user object (required) + * @param \Swagger\Client\Model\User $body Created user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -172,24 +183,34 @@ public function createUserAsyncWithHttpInfo($body) $returnType = ''; $request = $this->createUserRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'createUser' * - * @param \Swagger\Client\Model\User $body Created user object (required) + * @param \Swagger\Client\Model\User $body Created user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -197,7 +218,9 @@ protected function createUserRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling createUser' + ); } $resourcePath = '/user'; @@ -239,20 +262,19 @@ protected function createUserRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -264,9 +286,10 @@ protected function createUserRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -277,7 +300,8 @@ protected function createUserRequest($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -292,7 +316,8 @@ public function createUsersWithArrayInput($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -318,7 +343,11 @@ public function createUsersWithArrayInputWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -339,15 +368,19 @@ public function createUsersWithArrayInputWithHttpInfo($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithArrayInputAsync($body) { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->createUsersWithArrayInputAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -355,7 +388,8 @@ public function createUsersWithArrayInputAsync($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -364,24 +398,34 @@ public function createUsersWithArrayInputAsyncWithHttpInfo($body) $returnType = ''; $request = $this->createUsersWithArrayInputRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'createUsersWithArrayInput' * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -389,7 +433,9 @@ protected function createUsersWithArrayInputRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithArrayInput'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling createUsersWithArrayInput' + ); } $resourcePath = '/user/createWithArray'; @@ -431,20 +477,19 @@ protected function createUsersWithArrayInputRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -456,9 +501,10 @@ protected function createUsersWithArrayInputRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -469,7 +515,8 @@ protected function createUsersWithArrayInputRequest($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -484,7 +531,8 @@ public function createUsersWithListInput($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -510,7 +558,11 @@ public function createUsersWithListInputWithHttpInfo($body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -531,15 +583,19 @@ public function createUsersWithListInputWithHttpInfo($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithListInputAsync($body) { - return $this->createUsersWithListInputAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->createUsersWithListInputAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -547,7 +603,8 @@ public function createUsersWithListInputAsync($body) * * Creates list of users with given input array * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -556,24 +613,34 @@ public function createUsersWithListInputAsyncWithHttpInfo($body) $returnType = ''; $request = $this->createUsersWithListInputRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'createUsersWithListInput' * - * @param \Swagger\Client\Model\User[] $body List of user object (required) + * @param \Swagger\Client\Model\User[] $body List of user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -581,7 +648,9 @@ protected function createUsersWithListInputRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling createUsersWithListInput'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling createUsersWithListInput' + ); } $resourcePath = '/user/createWithList'; @@ -623,20 +692,19 @@ protected function createUsersWithListInputRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -648,9 +716,10 @@ protected function createUsersWithListInputRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -661,7 +730,8 @@ protected function createUsersWithListInputRequest($body) * * Delete user * - * @param string $username The name that needs to be deleted (required) + * @param string $username The name that needs to be deleted (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -676,7 +746,8 @@ public function deleteUser($username) * * Delete user * - * @param string $username The name that needs to be deleted (required) + * @param string $username The name that needs to be deleted (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -702,7 +773,11 @@ public function deleteUserWithHttpInfo($username) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -723,15 +798,19 @@ public function deleteUserWithHttpInfo($username) * * Delete user * - * @param string $username The name that needs to be deleted (required) + * @param string $username The name that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteUserAsync($username) { - return $this->deleteUserAsyncWithHttpInfo($username)->then(function ($response) { - return $response[0]; - }); + return $this->deleteUserAsyncWithHttpInfo($username) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -739,7 +818,8 @@ public function deleteUserAsync($username) * * Delete user * - * @param string $username The name that needs to be deleted (required) + * @param string $username The name that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -748,24 +828,34 @@ public function deleteUserAsyncWithHttpInfo($username) $returnType = ''; $request = $this->deleteUserRequest($username); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'deleteUser' * - * @param string $username The name that needs to be deleted (required) + * @param string $username The name that needs to be deleted (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -773,7 +863,9 @@ protected function deleteUserRequest($username) { // verify the required parameter 'username' is set if ($username === null) { - throw new \InvalidArgumentException('Missing the required parameter $username when calling deleteUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling deleteUser' + ); } $resourcePath = '/user/{username}'; @@ -786,9 +878,15 @@ protected function deleteUserRequest($username) // path params if ($username !== null) { - $resourcePath = str_replace('{' . 'username' . '}', ObjectSerializer::toPathValue($username), $resourcePath); + $resourcePath = str_replace( + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -814,20 +912,19 @@ protected function deleteUserRequest($username) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -839,9 +936,10 @@ protected function deleteUserRequest($username) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -852,7 +950,8 @@ protected function deleteUserRequest($username) * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\User @@ -868,7 +967,8 @@ public function getUserByName($username) * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings) @@ -894,7 +994,11 @@ public function getUserByNameWithHttpInfo($username) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -920,7 +1024,11 @@ public function getUserByNameWithHttpInfo($username) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\User', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -933,15 +1041,19 @@ public function getUserByNameWithHttpInfo($username) * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getUserByNameAsync($username) { - return $this->getUserByNameAsyncWithHttpInfo($username)->then(function ($response) { - return $response[0]; - }); + return $this->getUserByNameAsyncWithHttpInfo($username) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -949,7 +1061,8 @@ public function getUserByNameAsync($username) * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -958,38 +1071,48 @@ public function getUserByNameAsyncWithHttpInfo($username) $returnType = '\Swagger\Client\Model\User'; $request = $this->getUserByNameRequest($username); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'getUserByName' * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -997,7 +1120,9 @@ protected function getUserByNameRequest($username) { // verify the required parameter 'username' is set if ($username === null) { - throw new \InvalidArgumentException('Missing the required parameter $username when calling getUserByName'); + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling getUserByName' + ); } $resourcePath = '/user/{username}'; @@ -1010,9 +1135,15 @@ protected function getUserByNameRequest($username) // path params if ($username !== null) { - $resourcePath = str_replace('{' . 'username' . '}', ObjectSerializer::toPathValue($username), $resourcePath); + $resourcePath = str_replace( + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1038,20 +1169,19 @@ protected function getUserByNameRequest($username) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1063,9 +1193,10 @@ protected function getUserByNameRequest($username) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1076,8 +1207,9 @@ protected function getUserByNameRequest($username) * * Logs user into the system * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) + * @param string $username The user name for login (required) + * @param string $password The password for login in clear text (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return string @@ -1093,8 +1225,9 @@ public function loginUser($username, $password) * * Logs user into the system * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) + * @param string $username The user name for login (required) + * @param string $password The password for login in clear text (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of string, HTTP status code, HTTP response headers (array of strings) @@ -1120,7 +1253,11 @@ public function loginUserWithHttpInfo($username, $password) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1146,7 +1283,11 @@ public function loginUserWithHttpInfo($username, $password) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -1159,16 +1300,20 @@ public function loginUserWithHttpInfo($username, $password) * * Logs user into the system * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) + * @param string $username The user name for login (required) + * @param string $password The password for login in clear text (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function loginUserAsync($username, $password) { - return $this->loginUserAsyncWithHttpInfo($username, $password)->then(function ($response) { - return $response[0]; - }); + return $this->loginUserAsyncWithHttpInfo($username, $password) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1176,8 +1321,9 @@ public function loginUserAsync($username, $password) * * Logs user into the system * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) + * @param string $username The user name for login (required) + * @param string $password The password for login in clear text (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1186,39 +1332,49 @@ public function loginUserAsyncWithHttpInfo($username, $password) $returnType = 'string'; $request = $this->loginUserRequest($username, $password); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'loginUser' * - * @param string $username The user name for login (required) - * @param string $password The password for login in clear text (required) + * @param string $username The user name for login (required) + * @param string $password The password for login in clear text (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1226,11 +1382,15 @@ protected function loginUserRequest($username, $password) { // verify the required parameter 'username' is set if ($username === null) { - throw new \InvalidArgumentException('Missing the required parameter $username when calling loginUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling loginUser' + ); } // verify the required parameter 'password' is set if ($password === null) { - throw new \InvalidArgumentException('Missing the required parameter $password when calling loginUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $password when calling loginUser' + ); } $resourcePath = '/user/login'; @@ -1250,6 +1410,8 @@ protected function loginUserRequest($username, $password) } + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1275,20 +1437,19 @@ protected function loginUserRequest($username, $password) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1300,9 +1461,10 @@ protected function loginUserRequest($username, $password) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1313,6 +1475,7 @@ protected function loginUserRequest($username, $password) * * Logs out current logged in user session * + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1327,6 +1490,7 @@ public function logoutUser() * * Logs out current logged in user session * + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1352,7 +1516,11 @@ public function logoutUserWithHttpInfo() if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1373,14 +1541,18 @@ public function logoutUserWithHttpInfo() * * Logs out current logged in user session * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function logoutUserAsync() { - return $this->logoutUserAsyncWithHttpInfo()->then(function ($response) { - return $response[0]; - }); + return $this->logoutUserAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1388,6 +1560,7 @@ public function logoutUserAsync() * * Logs out current logged in user session * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1396,23 +1569,33 @@ public function logoutUserAsyncWithHttpInfo() $returnType = ''; $request = $this->logoutUserRequest(); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'logoutUser' * + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1428,6 +1611,8 @@ protected function logoutUserRequest() + // body params + $_tempBody = null; if ($multipart) { $headers= $this->headerSelector->selectHeadersForMultipart( @@ -1453,20 +1638,19 @@ protected function logoutUserRequest() 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1478,9 +1662,10 @@ protected function logoutUserRequest() $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1491,8 +1676,9 @@ protected function logoutUserRequest() * * Updated user * - * @param string $username name that need to be deleted (required) - * @param \Swagger\Client\Model\User $body Updated user object (required) + * @param string $username name that need to be deleted (required) + * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void @@ -1507,8 +1693,9 @@ public function updateUser($username, $body) * * Updated user * - * @param string $username name that need to be deleted (required) - * @param \Swagger\Client\Model\User $body Updated user object (required) + * @param string $username name that need to be deleted (required) + * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) @@ -1534,7 +1721,11 @@ public function updateUserWithHttpInfo($username, $body) if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -1555,16 +1746,20 @@ public function updateUserWithHttpInfo($username, $body) * * Updated user * - * @param string $username name that need to be deleted (required) - * @param \Swagger\Client\Model\User $body Updated user object (required) + * @param string $username name that need to be deleted (required) + * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updateUserAsync($username, $body) { - return $this->updateUserAsyncWithHttpInfo($username, $body)->then(function ($response) { - return $response[0]; - }); + return $this->updateUserAsyncWithHttpInfo($username, $body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1572,8 +1767,9 @@ public function updateUserAsync($username, $body) * * Updated user * - * @param string $username name that need to be deleted (required) - * @param \Swagger\Client\Model\User $body Updated user object (required) + * @param string $username name that need to be deleted (required) + * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -1582,25 +1778,35 @@ public function updateUserAsyncWithHttpInfo($username, $body) $returnType = ''; $request = $this->updateUserRequest($username, $body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } ); - }); } /** * Create request for operation 'updateUser' * - * @param string $username name that need to be deleted (required) - * @param \Swagger\Client\Model\User $body Updated user object (required) + * @param string $username name that need to be deleted (required) + * @param \Swagger\Client\Model\User $body Updated user object (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -1608,11 +1814,15 @@ protected function updateUserRequest($username, $body) { // verify the required parameter 'username' is set if ($username === null) { - throw new \InvalidArgumentException('Missing the required parameter $username when calling updateUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $username when calling updateUser' + ); } // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling updateUser'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateUser' + ); } $resourcePath = '/user/{username}'; @@ -1625,7 +1835,11 @@ protected function updateUserRequest($username, $body) // path params if ($username !== null) { - $resourcePath = str_replace('{' . 'username' . '}', ObjectSerializer::toPathValue($username), $resourcePath); + $resourcePath = str_replace( + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); } // body params @@ -1658,20 +1872,19 @@ protected function updateUserRequest($username, $body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -1683,9 +1896,10 @@ protected function updateUserRequest($username, $body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/Fake_classname_tags123ApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/Fake_classname_tags123ApiTest.php new file mode 100644 index 00000000000..b9b64aeca97 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/Fake_classname_tags123ApiTest.php @@ -0,0 +1,83 @@ + Date: Sun, 24 Sep 2017 16:43:42 +0800 Subject: [PATCH 055/197] [Scala] Decommission "async-scala" generator (#6552) * remove async-scala generator * remove async-scala related scripts --- bin/scala-async-petstore.sh | 31 ----- bin/windows/async-scala-petstore.bat | 10 -- .../languages/AsyncScalaClientCodegen.java | 106 ------------------ .../services/io.swagger.codegen.CodegenConfig | 1 - .../main/resources/asyncscala/api.mustache | 67 ----------- .../main/resources/asyncscala/client.mustache | 26 ----- .../main/resources/asyncscala/model.mustache | 14 --- .../main/resources/asyncscala/sbt.mustache | 12 -- .../AsyncScalaClientOptionsTest.java | 39 ------- 9 files changed, 306 deletions(-) delete mode 100755 bin/scala-async-petstore.sh delete mode 100755 bin/windows/async-scala-petstore.bat delete mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AsyncScalaClientCodegen.java delete mode 100644 modules/swagger-codegen/src/main/resources/asyncscala/api.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/asyncscala/client.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/asyncscala/model.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache delete mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/asyncscala/AsyncScalaClientOptionsTest.java diff --git a/bin/scala-async-petstore.sh b/bin/scala-async-petstore.sh deleted file mode 100755 index 5456c98b27a..00000000000 --- a/bin/scala-async-petstore.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/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/asyncscala -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l async-scala -o samples/client/petstore/async-scala" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/async-scala-petstore.bat b/bin/windows/async-scala-petstore.bat deleted file mode 100755 index be7caec9f6e..00000000000 --- a/bin/windows/async-scala-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -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 -DloggerPath=conf/log4j.properties -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l async-scala -o samples\client\petstore\async-scala - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AsyncScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AsyncScalaClientCodegen.java deleted file mode 100644 index 03bc9505264..00000000000 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AsyncScalaClientCodegen.java +++ /dev/null @@ -1,106 +0,0 @@ -package io.swagger.codegen.languages; - -import io.swagger.codegen.CliOption; -import io.swagger.codegen.CodegenConfig; -import io.swagger.codegen.CodegenConstants; -import io.swagger.codegen.CodegenType; -import io.swagger.codegen.SupportingFile; - -import java.io.File; -import java.util.Arrays; -import java.util.HashMap; - -public class AsyncScalaClientCodegen extends AbstractScalaCodegen implements CodegenConfig { - protected String groupId = "io.swagger"; - protected String artifactId = "swagger-async-scala-client"; - protected String artifactVersion = "1.0.0"; - protected String clientName = "SwaggerClient"; - protected String authScheme = ""; - protected boolean authPreemptive; - protected boolean asyncHttpClient = !authScheme.isEmpty(); - - public AsyncScalaClientCodegen() { - super(); - outputFolder = "generated-code/async-scala"; - modelTemplateFiles.put("model.mustache", ".scala"); - apiTemplateFiles.put("api.mustache", ".scala"); - embeddedTemplateDir = templateDir = "asyncscala"; - apiPackage = "io.swagger.client.api"; - modelPackage = "io.swagger.client.model"; - - setReservedWordsLowerCase( - Arrays.asList( - // local variable names used in API methods (endpoints) - "config", "path", "contentTypes", "contentType", "queryParams", "headerParams", - "formParams", "postBody", "resFuture", "client", "reader", - - // 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") - ); - - additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); - additionalProperties.put(CodegenConstants.GROUP_ID, groupId); - additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId); - additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion); - additionalProperties.put("asyncHttpClient", asyncHttpClient); - additionalProperties.put("authScheme", authScheme); - additionalProperties.put("authPreemptive", authPreemptive); - additionalProperties.put("clientName", clientName); - - supportingFiles.add(new SupportingFile("sbt.mustache", "", "build.sbt")); - supportingFiles.add(new SupportingFile("client.mustache", - (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), clientName + ".scala")); - - importMapping.remove("List"); - importMapping.remove("Set"); - importMapping.remove("Map"); - - importMapping.put("DateTime", "org.joda.time.DateTime"); - 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("long", "Long"); - typeMapping.put("double", "Double"); - typeMapping.put("object", "Any"); - typeMapping.put("file", "File"); - - instantiationTypes.put("array", "ListBuffer"); - instantiationTypes.put("map", "HashMap"); - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "async-scala"; - } - - @Override - public String getHelp() { - return "Generates an Asynchronous Scala client library."; - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } -} 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 c8438e09a30..6a3706d3d5a 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 @@ -3,7 +3,6 @@ io.swagger.codegen.languages.AndroidClientCodegen io.swagger.codegen.languages.Apache2ConfigCodegen io.swagger.codegen.languages.ApexClientCodegen io.swagger.codegen.languages.AspNetCoreServerCodegen -io.swagger.codegen.languages.AsyncScalaClientCodegen io.swagger.codegen.languages.BashClientCodegen io.swagger.codegen.languages.CSharpClientCodegen io.swagger.codegen.languages.ClojureClientCodegen diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache deleted file mode 100644 index 3b823902094..00000000000 --- a/modules/swagger-codegen/src/main/resources/asyncscala/api.mustache +++ /dev/null @@ -1,67 +0,0 @@ -package {{package}} - -{{#imports}}import {{import}} -{{/imports}} -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -{{#operations}} -class {{classname}}(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - {{#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}} = { - // create path and map variables - val path = (addFmt("{{{path}}}"){{#pathParams}} - replaceAll ("\\{" + "{{baseName}}" + "\\}",{{paramName}}.toString){{/pathParams}}) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - {{#allParams}} - {{#required}} - {{^isPrimitiveType}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - {{/isPrimitiveType}} - {{#isString}} - if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") - - {{/isString}} - {{/required}} - {{/allParams}} - {{#queryParams}} - {{^required}} - {{paramName}} match { - case Some(param) => queryParams += "{{baseName}}" -> param.toString - case _ => queryParams - } - {{/required}} - {{#required}} - queryParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{/queryParams}} - {{#headerParams}} - {{^required}} - {{paramName}} match { - case Some(param) => headerParams += "{{baseName}}" -> param.toString - case _ => headerParams - } - {{/required}} - {{#required}} - headerParams += "{{baseName}}" -> {{paramName}}.toString - {{/required}} - {{/headerParams}} - - val resFuture = client.submit("{{httpMethod}}", path, queryParams.toMap, headerParams.toMap, {{#bodyParam}}writer.write({{paramName}}){{/bodyParam}}{{^bodyParam}}"{{emptyBodyParam}}"{{/bodyParam}}) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - {{/operation}} - -} -{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache deleted file mode 100644 index 87d830e3e6a..00000000000 --- a/modules/swagger-codegen/src/main/resources/asyncscala/client.mustache +++ /dev/null @@ -1,26 +0,0 @@ -package {{invokerPackage}} - -{{#imports}}import {{import}} -{{/imports}} -import {{apiPackage}}._ - -import com.wordnik.swagger.client._ - -import java.io.Closeable - -class {{clientName}}(config: SwaggerConfig) extends Closeable { - val locator = config.locator - val name = config.name - - private[this] val client = transportClient - - protected def transportClient: TransportClient = new RestClient(config) - {{#apiInfo}}{{#apis}} - val {{classVarName}} = new {{classname}}(client, config) - {{/apis}}{{/apiInfo}} - - def close() { - client.close() - } -} - diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/model.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/model.mustache deleted file mode 100644 index 68d361c4c59..00000000000 --- a/modules/swagger-codegen/src/main/resources/asyncscala/model.mustache +++ /dev/null @@ -1,14 +0,0 @@ -package {{package}} - -import org.joda.time.DateTime -import java.util.UUID - -{{#models}} - -{{#model}} -case class {{classname}} ( - {{#vars}}{{name}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}{{#description}} // {{description}}{{/description}} - {{/vars}} -) -{{/model}} -{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache b/modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache deleted file mode 100644 index b96e132d8a7..00000000000 --- a/modules/swagger-codegen/src/main/resources/asyncscala/sbt.mustache +++ /dev/null @@ -1,12 +0,0 @@ -organization := "{{package}}" - -name := "{{projectName}}-client" - -libraryDependencies ++= Seq( - "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5", - "joda-time" % "joda-time" % "2.3", - "org.joda" % "joda-convert" % "1.3.1", - "ch.qos.logback" % "logback-classic" % "1.0.13" % "provided", - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "junit" % "junit" % "4.11" % "test" -) diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/asyncscala/AsyncScalaClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/asyncscala/AsyncScalaClientOptionsTest.java deleted file mode 100644 index 12f4f19e379..00000000000 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/asyncscala/AsyncScalaClientOptionsTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.swagger.codegen.asyncscala; - -import io.swagger.codegen.AbstractOptionsTest; -import io.swagger.codegen.CodegenConfig; -import io.swagger.codegen.languages.AsyncScalaClientCodegen; -import io.swagger.codegen.options.AsyncScalaClientOptionsProvider; - -import mockit.Expectations; -import mockit.Tested; - -public class AsyncScalaClientOptionsTest extends AbstractOptionsTest { - - @Tested - private AsyncScalaClientCodegen clientCodegen; - - public AsyncScalaClientOptionsTest() { - super(new AsyncScalaClientOptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(AsyncScalaClientOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(AsyncScalaClientOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(AsyncScalaClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setSourceFolder(AsyncScalaClientOptionsProvider.SOURCE_FOLDER_VALUE); - times = 1; - }}; - } -} From c50110354027ea785b9836919007ee21862f9168 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 24 Sep 2017 17:48:11 +0800 Subject: [PATCH 056/197] add ackintosh to php tech committee --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec3968aad0b..d8d1fc54e5b 100644 --- a/README.md +++ b/README.md @@ -1063,7 +1063,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | Perl | @wing328 (2017/07) | -| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) | +| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) | | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | From 2d44d7f291fd9b63950d8a27dd52dc7fe06d425d Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 24 Sep 2017 21:18:49 +0800 Subject: [PATCH 057/197] use parameter name as description if not defined (#6557) --- .../src/main/resources/php/api.mustache | 2 +- .../main/resources/php/model_generic.mustache | 2 +- .../petstore/php/SwaggerClient-php/README.md | 12 +- .../docs/Api/AnotherFakeApi.md | 8 +- .../php/SwaggerClient-php/docs/Api/FakeApi.md | 2 +- .../SwaggerClient-php/docs/Api/StoreApi.md | 2 +- .../lib/Api/AnotherFakeApi.php | 7 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 4 +- .../lib/Api/FakeClassnameTags123Api.php | 113 +++++++++++------- .../php/SwaggerClient-php/lib/Api/PetApi.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 4 +- .../SwaggerClient-php/lib/Model/Animal.php | 4 +- .../lib/Model/ApiResponse.php | 6 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../lib/Model/ArrayOfNumberOnly.php | 2 +- .../SwaggerClient-php/lib/Model/ArrayTest.php | 6 +- .../lib/Model/Capitalization.php | 10 +- .../php/SwaggerClient-php/lib/Model/Cat.php | 2 +- .../SwaggerClient-php/lib/Model/Category.php | 4 +- .../lib/Model/ClassModel.php | 2 +- .../SwaggerClient-php/lib/Model/Client.php | 2 +- .../php/SwaggerClient-php/lib/Model/Dog.php | 2 +- .../lib/Model/EnumArrays.php | 4 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 8 +- .../lib/Model/FormatTest.php | 38 ++++-- .../lib/Model/HasOnlyReadOnly.php | 4 +- .../SwaggerClient-php/lib/Model/MapTest.php | 4 +- ...PropertiesAndAdditionalPropertiesClass.php | 6 +- .../lib/Model/Model200Response.php | 4 +- .../lib/Model/ModelInterface.php | 1 - .../SwaggerClient-php/lib/Model/ModelList.php | 2 +- .../lib/Model/ModelReturn.php | 2 +- .../php/SwaggerClient-php/lib/Model/Name.php | 8 +- .../lib/Model/NumberOnly.php | 2 +- .../php/SwaggerClient-php/lib/Model/Order.php | 10 +- .../lib/Model/OuterComposite.php | 6 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 10 +- .../lib/Model/ReadOnlyFirst.php | 4 +- .../lib/Model/SpecialModelName.php | 2 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 4 +- .../php/SwaggerClient-php/lib/Model/User.php | 14 +-- 41 files changed, 185 insertions(+), 148 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index a2247273df0..a360a0e87bf 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -84,7 +84,7 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * * @throws \{{invokerPackage}}\ApiException on non-2xx response diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 8305a7d293b..eab63f63a9c 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -335,7 +335,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa /** * Sets {{name}} * - * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}} + * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}} * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 7e6e53dd932..83b6d6e01a1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -56,14 +56,14 @@ Please follow the [installation procedure](#installation--usage) and then run th fakeOuterBooleanSerialize($body); + $result = $api_instance->testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -75,6 +75,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -83,7 +84,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*Fake_classname_tags123Api* | [**testClassname**](docs/Api/Fake_classname_tags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -104,7 +105,6 @@ Class | Method | HTTP request | Description *UserApi* | [**loginUser**](docs/Api/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system *UserApi* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -*AnotherfakeApi* | [**testSpecialTags**](docs/Api/AnotherfakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags ## Documentation For Models diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md index 53bd4be8062..5b443618999 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md @@ -1,10 +1,10 @@ -# Swagger\Client\AnotherfakeApi +# Swagger\Client\AnotherFakeApi All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherfakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags # **testSpecialTags** @@ -19,14 +19,14 @@ To test special tags testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherfakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> ``` 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 1691f3d27a8..20958d97da2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -259,7 +259,7 @@ $api_instance = new Swagger\Client\Api\FakeApi(new \Http\Adapter\Guzzle6\Client( $number = 3.4; // float | None $double = 1.2; // double | None $pattern_without_delimiter = "pattern_without_delimiter_example"; // string | None -$byte = "B"; // string | None +$byte = "byte_example"; // string | None $integer = 56; // int | None $int32 = 56; // int | None $int64 = 789; // int | None diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index a377df225db..9daa65eba7b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -87,7 +87,7 @@ This endpoint does not need any parameter. ### Return type -[**map[string,int]**](../Model/map.md) +**map[string,int]** ### Authorization 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 5e5ba412dd9..88ca1e9271f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -1,6 +1,6 @@ 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -153,7 +159,11 @@ public function testClassnameWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Client', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -166,15 +176,19 @@ public function testClassnameWithHttpInfo($body) * * To test class name in snake case * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClassnameAsync($body) { - return $this->testClassnameAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->testClassnameAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -182,7 +196,8 @@ public function testClassnameAsync($body) * * To test class name in snake case * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -191,38 +206,48 @@ public function testClassnameAsyncWithHttpInfo($body) $returnType = '\Swagger\Client\Model\Client'; $request = $this->testClassnameRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'testClassname' * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -230,7 +255,9 @@ protected function testClassnameRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClassname'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling testClassname' + ); } $resourcePath = '/fake_classname_test'; @@ -272,13 +299,15 @@ protected function testClassnameRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -288,9 +317,6 @@ protected function testClassnameRequest($body) $queryParams['api_key_query'] = $apiKey; } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -302,9 +328,10 @@ protected function testClassnameRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); 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 3214d9769e2..08b0596b7d5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -305,7 +305,7 @@ protected function addPetRequest($body) * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string $api_key api_key (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException 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 b7aa6634edb..1b0aed2b9dc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -223,7 +223,7 @@ public function getMapProperty() /** * Sets map_property * - * @param map[string,string] $map_property + * @param map[string,string] $map_property map_property * * @return $this */ @@ -247,7 +247,7 @@ public function getMapOfMapProperty() /** * Sets map_of_map_property * - * @param map[string,map[string,string]] $map_of_map_property + * @param map[string,map[string,string]] $map_of_map_property map_of_map_property * * @return $this */ 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 ef8f4146bfc..016dd5f65c9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -233,7 +233,7 @@ public function getClassName() /** * Sets class_name * - * @param string $class_name + * @param string $class_name class_name * * @return $this */ @@ -257,7 +257,7 @@ public function getColor() /** * Sets color * - * @param string $color + * @param string $color color * * @return $this */ 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 abdad1f0abf..5744956fe2a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -229,7 +229,7 @@ public function getCode() /** * Sets code * - * @param int $code + * @param int $code code * * @return $this */ @@ -253,7 +253,7 @@ public function getType() /** * Sets type * - * @param string $type + * @param string $type type * * @return $this */ @@ -277,7 +277,7 @@ public function getMessage() /** * Sets message * - * @param string $message + * @param string $message message * * @return $this */ 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 bbe57d45841..912e033cb0a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -217,7 +217,7 @@ public function getArrayArrayNumber() /** * Sets array_array_number * - * @param float[][] $array_array_number + * @param float[][] $array_array_number array_array_number * * @return $this */ 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 2469e34b7df..d15c791fc97 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php @@ -217,7 +217,7 @@ public function getArrayNumber() /** * Sets array_number * - * @param float[] $array_number + * @param float[] $array_number array_number * * @return $this */ 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 fdd9c9e6238..0d5498db254 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -229,7 +229,7 @@ public function getArrayOfString() /** * Sets array_of_string * - * @param string[] $array_of_string + * @param string[] $array_of_string array_of_string * * @return $this */ @@ -253,7 +253,7 @@ public function getArrayArrayOfInteger() /** * Sets array_array_of_integer * - * @param int[][] $array_array_of_integer + * @param int[][] $array_array_of_integer array_array_of_integer * * @return $this */ @@ -277,7 +277,7 @@ public function getArrayArrayOfModel() /** * Sets array_array_of_model * - * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model + * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model array_array_of_model * * @return $this */ 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 6beffb1c1e9..9c56f67aa5c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php @@ -247,7 +247,7 @@ public function getSmallCamel() /** * Sets small_camel * - * @param string $small_camel + * @param string $small_camel small_camel * * @return $this */ @@ -271,7 +271,7 @@ public function getCapitalCamel() /** * Sets capital_camel * - * @param string $capital_camel + * @param string $capital_camel capital_camel * * @return $this */ @@ -295,7 +295,7 @@ public function getSmallSnake() /** * Sets small_snake * - * @param string $small_snake + * @param string $small_snake small_snake * * @return $this */ @@ -319,7 +319,7 @@ public function getCapitalSnake() /** * Sets capital_snake * - * @param string $capital_snake + * @param string $capital_snake capital_snake * * @return $this */ @@ -343,7 +343,7 @@ public function getScaEthFlowPoints() /** * Sets sca_eth_flow_points * - * @param string $sca_eth_flow_points + * @param string $sca_eth_flow_points sca_eth_flow_points * * @return $this */ 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 467d001fcf5..b7f63dab35b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -214,7 +214,7 @@ public function getDeclawed() /** * Sets declawed * - * @param bool $declawed + * @param bool $declawed declawed * * @return $this */ 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 694f0f886fe..9f3cd6b4b76 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -223,7 +223,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -247,7 +247,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ 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 d3cffef6e30..901e3f7afdb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php @@ -218,7 +218,7 @@ public function getClass() /** * Sets _class * - * @param string $_class + * @param string $_class _class * * @return $this */ 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 6fe33372b6b..737005b1d34 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php @@ -217,7 +217,7 @@ public function getClient() /** * Sets client * - * @param string $client + * @param string $client client * * @return $this */ 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 33f32068721..d49c050b366 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -214,7 +214,7 @@ public function getBreed() /** * Sets breed * - * @param string $breed + * @param string $breed breed * * @return $this */ 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 d04608bd8dd..7d7ffaaea66 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php @@ -265,7 +265,7 @@ public function getJustSymbol() /** * Sets just_symbol * - * @param string $just_symbol + * @param string $just_symbol just_symbol * * @return $this */ @@ -298,7 +298,7 @@ public function getArrayEnum() /** * Sets array_enum * - * @param string[] $array_enum + * @param string[] $array_enum array_enum * * @return $this */ 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 8b749a79e60..e47b3a303f8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -318,7 +318,7 @@ public function getEnumString() /** * Sets enum_string * - * @param string $enum_string + * @param string $enum_string enum_string * * @return $this */ @@ -351,7 +351,7 @@ public function getEnumInteger() /** * Sets enum_integer * - * @param int $enum_integer + * @param int $enum_integer enum_integer * * @return $this */ @@ -384,7 +384,7 @@ public function getEnumNumber() /** * Sets enum_number * - * @param double $enum_number + * @param double $enum_number enum_number * * @return $this */ @@ -417,7 +417,7 @@ public function getOuterEnum() /** * Sets outer_enum * - * @param \Swagger\Client\Model\OuterEnum $outer_enum + * @param \Swagger\Client\Model\OuterEnum $outer_enum outer_enum * * @return $this */ 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 338b19c1aa1..909cb9ecc37 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -310,6 +310,10 @@ public function listInvalidProperties() if ($this->container['byte'] === null) { $invalidProperties[] = "'byte' can't be null"; } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { + $invalidProperties[] = "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + } + if ($this->container['date'] === null) { $invalidProperties[] = "'date' can't be null"; } @@ -375,6 +379,9 @@ public function valid() if ($this->container['byte'] === null) { return false; } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { + return false; + } if ($this->container['date'] === null) { return false; } @@ -404,7 +411,7 @@ public function getInteger() /** * Sets integer * - * @param int $integer + * @param int $integer integer * * @return $this */ @@ -436,7 +443,7 @@ public function getInt32() /** * Sets int32 * - * @param int $int32 + * @param int $int32 int32 * * @return $this */ @@ -468,7 +475,7 @@ public function getInt64() /** * Sets int64 * - * @param int $int64 + * @param int $int64 int64 * * @return $this */ @@ -492,7 +499,7 @@ public function getNumber() /** * Sets number * - * @param float $number + * @param float $number number * * @return $this */ @@ -524,7 +531,7 @@ public function getFloat() /** * Sets float * - * @param float $float + * @param float $float float * * @return $this */ @@ -556,7 +563,7 @@ public function getDouble() /** * Sets double * - * @param double $double + * @param double $double double * * @return $this */ @@ -588,7 +595,7 @@ public function getString() /** * Sets string * - * @param string $string + * @param string $string string * * @return $this */ @@ -617,12 +624,17 @@ public function getByte() /** * Sets byte * - * @param string $byte + * @param string $byte byte * * @return $this */ public function setByte($byte) { + + if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $byte))) { + throw new \InvalidArgumentException("invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + } + $this->container['byte'] = $byte; return $this; @@ -641,7 +653,7 @@ public function getBinary() /** * Sets binary * - * @param string $binary + * @param string $binary binary * * @return $this */ @@ -665,7 +677,7 @@ public function getDate() /** * Sets date * - * @param \DateTime $date + * @param \DateTime $date date * * @return $this */ @@ -689,7 +701,7 @@ public function getDateTime() /** * Sets date_time * - * @param \DateTime $date_time + * @param \DateTime $date_time date_time * * @return $this */ @@ -713,7 +725,7 @@ public function getUuid() /** * Sets uuid * - * @param string $uuid + * @param string $uuid uuid * * @return $this */ @@ -737,7 +749,7 @@ public function getPassword() /** * Sets password * - * @param string $password + * @param string $password password * * @return $this */ 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 9deab454ca8..d45fcb7fbe4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php @@ -223,7 +223,7 @@ public function getBar() /** * Sets bar * - * @param string $bar + * @param string $bar bar * * @return $this */ @@ -247,7 +247,7 @@ public function getFoo() /** * Sets foo * - * @param string $foo + * @param string $foo foo * * @return $this */ 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 e2cd49676b5..be3206dd9b5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php @@ -238,7 +238,7 @@ public function getMapMapOfString() /** * Sets map_map_of_string * - * @param map[string,map[string,string]] $map_map_of_string + * @param map[string,map[string,string]] $map_map_of_string map_map_of_string * * @return $this */ @@ -262,7 +262,7 @@ public function getMapOfEnumString() /** * Sets map_of_enum_string * - * @param map[string,string] $map_of_enum_string + * @param map[string,string] $map_of_enum_string map_of_enum_string * * @return $this */ 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 12cfd35160e..183f75381a8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -229,7 +229,7 @@ public function getUuid() /** * Sets uuid * - * @param string $uuid + * @param string $uuid uuid * * @return $this */ @@ -253,7 +253,7 @@ public function getDateTime() /** * Sets date_time * - * @param \DateTime $date_time + * @param \DateTime $date_time date_time * * @return $this */ @@ -277,7 +277,7 @@ public function getMap() /** * Sets map * - * @param map[string,\Swagger\Client\Model\Animal] $map + * @param map[string,\Swagger\Client\Model\Animal] $map map * * @return $this */ 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 ab75d0dee42..274368c3f06 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -224,7 +224,7 @@ public function getName() /** * Sets name * - * @param int $name + * @param int $name name * * @return $this */ @@ -248,7 +248,7 @@ public function getClass() /** * Sets class * - * @param string $class + * @param string $class class * * @return $this */ 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 29a20d70fb7..23adcb62ac7 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,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** 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 7c17be9b237..25b7d470e83 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php @@ -217,7 +217,7 @@ public function get123List() /** * Sets _123_list * - * @param string $_123_list + * @param string $_123_list _123_list * * @return $this */ 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 fe1b72ec7ab..980992de818 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -218,7 +218,7 @@ public function getReturn() /** * Sets return * - * @param int $return + * @param int $return return * * @return $this */ 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 90d8781e45a..c7604f6ca00 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -242,7 +242,7 @@ public function getName() /** * Sets name * - * @param int $name + * @param int $name name * * @return $this */ @@ -266,7 +266,7 @@ public function getSnakeCase() /** * Sets snake_case * - * @param int $snake_case + * @param int $snake_case snake_case * * @return $this */ @@ -290,7 +290,7 @@ public function getProperty() /** * Sets property * - * @param string $property + * @param string $property property * * @return $this */ @@ -314,7 +314,7 @@ public function get123Number() /** * Sets _123_number * - * @param int $_123_number + * @param int $_123_number _123_number * * @return $this */ 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 f59fbfd6e1f..d19d010dbfc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php @@ -217,7 +217,7 @@ public function getJustNumber() /** * Sets just_number * - * @param float $just_number + * @param float $just_number just_number * * @return $this */ 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 5a70366e2d6..649eaace628 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -276,7 +276,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -300,7 +300,7 @@ public function getPetId() /** * Sets pet_id * - * @param int $pet_id + * @param int $pet_id pet_id * * @return $this */ @@ -324,7 +324,7 @@ public function getQuantity() /** * Sets quantity * - * @param int $quantity + * @param int $quantity quantity * * @return $this */ @@ -348,7 +348,7 @@ public function getShipDate() /** * Sets ship_date * - * @param \DateTime $ship_date + * @param \DateTime $ship_date ship_date * * @return $this */ @@ -405,7 +405,7 @@ public function getComplete() /** * Sets complete * - * @param bool $complete + * @param bool $complete complete * * @return $this */ 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 36c4a3856b3..a6b71edb108 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php @@ -229,7 +229,7 @@ public function getMyNumber() /** * Sets my_number * - * @param \Swagger\Client\Model\OuterNumber $my_number + * @param \Swagger\Client\Model\OuterNumber $my_number my_number * * @return $this */ @@ -253,7 +253,7 @@ public function getMyString() /** * Sets my_string * - * @param \Swagger\Client\Model\OuterString $my_string + * @param \Swagger\Client\Model\OuterString $my_string my_string * * @return $this */ @@ -277,7 +277,7 @@ public function getMyBoolean() /** * Sets my_boolean * - * @param \Swagger\Client\Model\OuterBoolean $my_boolean + * @param \Swagger\Client\Model\OuterBoolean $my_boolean my_boolean * * @return $this */ 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 382e5ee7672..30d04ccb2b0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -288,7 +288,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -312,7 +312,7 @@ public function getCategory() /** * Sets category * - * @param \Swagger\Client\Model\Category $category + * @param \Swagger\Client\Model\Category $category category * * @return $this */ @@ -336,7 +336,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ @@ -360,7 +360,7 @@ public function getPhotoUrls() /** * Sets photo_urls * - * @param string[] $photo_urls + * @param string[] $photo_urls photo_urls * * @return $this */ @@ -384,7 +384,7 @@ public function getTags() /** * Sets tags * - * @param \Swagger\Client\Model\Tag[] $tags + * @param \Swagger\Client\Model\Tag[] $tags tags * * @return $this */ 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 36e14e910f1..f4931794d25 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -223,7 +223,7 @@ public function getBar() /** * Sets bar * - * @param string $bar + * @param string $bar bar * * @return $this */ @@ -247,7 +247,7 @@ public function getBaz() /** * Sets baz * - * @param string $baz + * @param string $baz baz * * @return $this */ 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 dba1e2d730e..7c69d553364 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -217,7 +217,7 @@ public function getSpecialPropertyName() /** * Sets special_property_name * - * @param int $special_property_name + * @param int $special_property_name special_property_name * * @return $this */ 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 d9ec6d40dcf..6223f4da216 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -223,7 +223,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -247,7 +247,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ 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 16553380b64..fef11caad56 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -259,7 +259,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -283,7 +283,7 @@ public function getUsername() /** * Sets username * - * @param string $username + * @param string $username username * * @return $this */ @@ -307,7 +307,7 @@ public function getFirstName() /** * Sets first_name * - * @param string $first_name + * @param string $first_name first_name * * @return $this */ @@ -331,7 +331,7 @@ public function getLastName() /** * Sets last_name * - * @param string $last_name + * @param string $last_name last_name * * @return $this */ @@ -355,7 +355,7 @@ public function getEmail() /** * Sets email * - * @param string $email + * @param string $email email * * @return $this */ @@ -379,7 +379,7 @@ public function getPassword() /** * Sets password * - * @param string $password + * @param string $password password * * @return $this */ @@ -403,7 +403,7 @@ public function getPhone() /** * Sets phone * - * @param string $phone + * @param string $phone phone * * @return $this */ From 53d34caa4ff7f466ff560379cc3dcab4b113f263 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 24 Sep 2017 21:32:28 +0800 Subject: [PATCH 058/197] add scala test, rearrange test order --- pom.xml.circleci | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml.circleci b/pom.xml.circleci index c06631b8af2..9ae687499d7 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -821,8 +821,8 @@ - samples/client/petstore/go + samples/client/petstore/scala samples/client/petstore/clojure samples/client/petstore/java/feign samples/client/petstore/java/jersey1 @@ -836,10 +836,10 @@ samples/client/petstore/java/resttemplate-withXml samples/client/petstore/java/vertx samples/client/petstore/java/resteasy - samples/client/petstore/ruby samples/client/petstore/kotlin/ - + + samples/client/petstore/go + samples/client/petstore/ruby samples/server/petstore/java-inflector samples/server/petstore/java-play-framework From 4b0314498bbf993927c2f3224f68dd790ce44a32 Mon Sep 17 00:00:00 2001 From: Kenny Jones Date: Sun, 24 Sep 2017 11:07:12 -0400 Subject: [PATCH 059/197] Bugfix: Handle all different types of security (#6528) The only special handling was for security definition type `apiKey` in `query`. All the other security configurations should result in the same generated code. Moves the handling of the special query parameters outside of the `parameters without specific cardinality` section. To cover the scenario where `elif` was being used, simply leverage the builtin `continue` statement to stop processing the specific query parameter and continue to the next available query parameter, if any. Manually test with multiple different combinations. Resolves: #6526 --- .../src/main/resources/bash/client.mustache | 20 ++- samples/client/petstore/bash/Dockerfile | 1 + samples/client/petstore/bash/_petstore-cli | 8 +- samples/client/petstore/bash/petstore-cli | 131 +++++++++++++++++- .../bash/petstore-cli.bash-completion | 2 + 5 files changed, 145 insertions(+), 17 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index e4c7ee2b61e..d351fbd213d 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -411,15 +411,7 @@ build_request_path() { query_request_part+="&" fi fi - - # - # Append parameters without specific cardinality - # - local collection_type="${operation_parameters_collection_type["${operation}:::${qparam}"]}" -{{#hasAuthMethods}} -{{#authMethods}} -{{#isApiKey}} -{{#isKeyInQuery}} +{{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} if [[ ${qparam} == "{{keyParamName}}" ]]; then if [[ -n "${parameter_values[@]}" ]]; then parameter_value+="${qparam}=${parameter_values}" @@ -431,8 +423,14 @@ build_request_path() { echo "Missing ApiKey!!! {{#x-codegen-apikey-env}}Define env variable {{x-codegen-apikey-env}} like 'export {{x-codegen-apikey-env}}=...' or{{/x-codegen-apikey-env}}{{^x-codegen-apikey-env}}You have to{{/x-codegen-apikey-env}} provide on command line option '{{keyParamName}}=...'" exit 1 fi - elif{{/isKeyInQuery}}{{^isKeyInQuery}} - if{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/hasAuthMethods}} [[ "${collection_type}" == "" ]]; then + continue + fi{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/hasAuthMethods}} + + # + # Append parameters without specific cardinality + # + local collection_type="${operation_parameters_collection_type["${operation}:::${qparam}"]}" + if [[ "${collection_type}" == "" ]]; then local vcount=0 for qvalue in "${parameter_values[@]}"; do if [[ $((vcount++)) -gt 0 ]]; then diff --git a/samples/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile index 2d4a88cdfd0..71dcb96ed5b 100644 --- a/samples/client/petstore/bash/Dockerfile +++ b/samples/client/petstore/bash/Dockerfile @@ -39,6 +39,7 @@ For convenience, you can export the following environment variables:\n\ \n\ $(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com:8080\n\ $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ +$(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ \n\ $(tput setaf 7)Basic usage:$(tput sgr0)\n\ diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index dc33ceaabf8..37565241a91 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,7 +296,7 @@ case $state in ops) # Operations _values "Operations" \ - "fakeOuterBooleanSerialize[]" \ + "testSpecialTags[To test special tags]" "fakeOuterBooleanSerialize[]" \ "fakeOuterCompositeSerialize[]" \ "fakeOuterNumberSerialize[]" \ "fakeOuterStringSerialize[]" \ @@ -330,6 +330,12 @@ case $state in ;; args) case $line[1] in + testSpecialTags) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; fakeOuterBooleanSerialize) local -a _op_arguments _op_arguments=( diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index bbf14fc9e01..d3e6720e1fc 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -95,6 +95,7 @@ declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$ # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurences +operation_parameters_minimum_occurences["testSpecialTags:::body"]=1 operation_parameters_minimum_occurences["fakeOuterBooleanSerialize:::body"]=0 operation_parameters_minimum_occurences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_minimum_occurences["fakeOuterNumberSerialize:::body"]=0 @@ -158,6 +159,7 @@ operation_parameters_minimum_occurences["updateUser:::body"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurences +operation_parameters_maximum_occurences["testSpecialTags:::body"]=0 operation_parameters_maximum_occurences["fakeOuterBooleanSerialize:::body"]=0 operation_parameters_maximum_occurences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_maximum_occurences["fakeOuterNumberSerialize:::body"]=0 @@ -218,6 +220,7 @@ operation_parameters_maximum_occurences["updateUser:::body"]=0 # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type +operation_parameters_collection_type["testSpecialTags:::body"]="" operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" @@ -527,11 +530,22 @@ build_request_path() { fi fi + if [[ ${qparam} == "api_key_query" ]]; then + if [[ -n "${parameter_values[@]}" ]]; then + parameter_value+="${qparam}=${parameter_values}" + elif [[ -n "$MATRIX_API_KEY" ]]; then + parameter_value+="${qparam}=$PETSTORE_API_KEY" + else + echo "Missing ApiKey!!! Define env variable PETSTORE_API_KEY like 'export PETSTORE_API_KEY=...' or provide on command line option 'api_key_query=...'" + exit 1 + fi + continue + fi + # # Append parameters without specific cardinality # local collection_type="${operation_parameters_collection_type["${operation}:::${qparam}"]}" - if [[ "${collection_type}" == "" ]]; then local vcount=0 for qvalue in "${parameter_values[@]}"; do @@ -648,6 +662,8 @@ EOF echo -e "" echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key:${OFF}' after ${YELLOW}${OFF}" echo -e " or export ${RED}PETSTORE_API_KEY=''${OFF}" + echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key_query=${OFF}' after ${YELLOW}${OFF}" + echo -e " or export ${RED}PETSTORE_API_KEY=''${OFF}" echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" @@ -658,6 +674,12 @@ EOF echo -e " * read:pets - read your pets" echo "" echo -e "${BOLD}${WHITE}Operations (grouped by tags)${OFF}" + echo "" + echo -e "${BOLD}${WHITE}[anotherFake]${OFF}" +read -d '' ops < Date: Mon, 25 Sep 2017 12:49:58 +0800 Subject: [PATCH 060/197] [Bash] Add test setting for Bash client (#6558) * add pom.xml and travis.yml for bash * create travis.yml.bak, test .travis.yml.bash * restore travis.yml --- .travis.yml.bash | 37 ++ pom.xml.bash | 930 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 967 insertions(+) create mode 100644 .travis.yml.bash create mode 100644 pom.xml.bash diff --git a/.travis.yml.bash b/.travis.yml.bash new file mode 100644 index 00000000000..f224cac3958 --- /dev/null +++ b/.travis.yml.bash @@ -0,0 +1,37 @@ +sudo: required +language: java +jdk: + - openjdk8 + +cache: + directories: + - $HOME/.m2 + - $HOME/.ivy2 + +services: + - docker + +addons: + hosts: + - petstore.swagger.io + +before_install: + # to run petstore server locally via docker + - docker pull swaggerapi/petstore + - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore + - docker ps -a + # Add bats test framework and cURL for Bash script integration tests + - sudo add-apt-repository ppa:duggan/bats --yes + - sudo apt-get update -qq + - sudo apt-get install -qq bats + - sudo apt-get install -qq curl + + # show host table to confirm petstore.swagger.io is mapped to localhost + - cat /etc/hosts + +script: + # fail fast + - set -e + # run integration tests defined in maven pom.xml + - cp pom.xml.bash pom.xml + - mvn --batch-mode verify -Psamples diff --git a/pom.xml.bash b/pom.xml.bash new file mode 100644 index 00000000000..6d43fe6829d --- /dev/null +++ b/pom.xml.bash @@ -0,0 +1,930 @@ + + + org.sonatype.oss + oss-parent + 5 + + 4.0.0 + io.swagger + swagger-codegen-project + pom + swagger-codegen-project + 2.3.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 + + + + 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-checkstyle-plugin + 2.17 + + + validate + validate + + google_checkstyle.xml + + ${project.build.sourceDirectory} + UTF-8 + true + true + false + + + check + + + + + + com.puppycrawl.tools + checkstyle + 6.19 + + + + + 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 + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.4.1 + + + enforce-versions + + enforce + + + + + 3.2.5 + + + + + + + + + + + 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 + + + + haskell-http-client + + + env + haskell-http-client + + + + samples/client/petstore/haskell-http-client + + + + haskell-http-client-integration-test + + + env + haskell-http-client + + + + samples/client/petstore/haskell-http-client/tests-integration + + + + 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-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-angular-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-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/bash + + + + + 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.32 + 2.11.1 + 3.3.0 + 1.5.16 + 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 + + From 419ee1cc79f372d6ac8a66c888179c2e44178e1d Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 25 Sep 2017 15:23:27 +0800 Subject: [PATCH 061/197] Add class prefix to tag with numbers (#6561) * add class prefix to tag with numbers, update java to default tag name * update codegen test --- .../src/main/java/io/swagger/codegen/DefaultCodegen.java | 2 +- .../io/swagger/codegen/languages/AbstractJavaCodegen.java | 5 ----- .../src/test/java/io/swagger/codegen/CodegenTest.java | 3 ++- 3 files changed, 3 insertions(+), 7 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 61a4dc1ba61..aa3c3f318a9 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 @@ -3502,7 +3502,7 @@ public String sanitizeTag(String tag) { // tag starts with numbers if (tag.matches("^\\d.*")) { - tag = "_" + tag; + tag = "Class" + tag; } return tag; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 13310ecc5c3..64460b2f5fc 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -1229,11 +1229,6 @@ public void writePropertyBack(String propertyKey, boolean value) { additionalProperties.put(propertyKey, value); } - @Override - public String sanitizeTag(String tag) { - return camelize(sanitizeName(tag)); - } - /** * Output the Getter name for boolean property, e.g. isActive * diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index ef54ec0fc79..53adbaea006 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -17,11 +17,12 @@ public class CodegenTest { public void sanitizeTagTest() { final DefaultCodegen codegen = new DefaultCodegen(); Assert.assertEquals(codegen.sanitizeTag("foo"), "Foo"); + Assert.assertEquals(codegen.sanitizeTag("$foo!"), "Foo"); Assert.assertEquals(codegen.sanitizeTag("foo bar"), "FooBar"); Assert.assertEquals(codegen.sanitizeTag("foo_bar"), "FooBar"); Assert.assertEquals(codegen.sanitizeTag("foo1 bar2"), "Foo1Bar2"); Assert.assertEquals(codegen.sanitizeTag("foo bar 1"), "FooBar1"); - Assert.assertEquals(codegen.sanitizeTag("1foo"), "_1foo"); + Assert.assertEquals(codegen.sanitizeTag("1foo"), "Class1foo"); } @Test(description = "test camelize") From 96137e5677765816fed1164d80798835ab4d898f Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 25 Sep 2017 16:28:30 +0800 Subject: [PATCH 062/197] add encodeURIComponent to encode path parameters (#6551) --- .../typescript-angularjs/api.mustache | 7 +- .../resources/typescript-aurelia/api.mustache | 15 +- .../resources/typescript-fetch/api.mustache | 2 +- .../resources/typescript-jquery/api.mustache | 10 +- .../resources/typescript-node/api.mustache | 15 +- .../typescript-angularjs/api/PetApi.ts | 8 + .../typescript-angularjs/api/StoreApi.ts | 3 + .../typescript-angularjs/api/UserApi.ts | 9 + .../typescript-aurelia/default/PetApi.ts | 16 +- .../typescript-aurelia/default/StoreApi.ts | 8 +- .../typescript-aurelia/default/UserApi.ts | 14 +- .../typescript-fetch/builds/default/api.ts | 18 +- .../typescript-fetch/builds/es6-target/api.ts | 18 +- .../builds/with-npm-version/api.ts | 18 +- .../typescript-jquery/default/api/PetApi.ts | 13 +- .../typescript-jquery/default/api/StoreApi.ts | 4 +- .../typescript-jquery/default/api/UserApi.ts | 6 +- .../typescript-jquery/npm/api/PetApi.ts | 13 +- .../typescript-jquery/npm/api/StoreApi.ts | 4 +- .../typescript-jquery/npm/api/UserApi.ts | 6 +- .../petstore/typescript-node/default/api.ts | 38 +--- .../petstore/typescript-node/npm/api.ts | 162 +++++++++++++----- 22 files changed, 237 insertions(+), 170 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache index b6aa0b6ae96..7d400e8f2b6 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache @@ -29,8 +29,10 @@ export class {{classname}} { {{#summary}} * @summary {{&summary}} {{/summary}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ + {{#allParams}} + * @param {{paramName}} {{description}} + {{/allParams}} + */ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; @@ -47,6 +49,7 @@ export class {{classname}} { if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } + {{/required}} {{/allParams}} {{#queryParams}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-aurelia/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-aurelia/api.mustache index df1a64d36ba..89d08c3c527 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-aurelia/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-aurelia/api.mustache @@ -36,11 +36,16 @@ export class {{classname}} extends Api { } {{#operation}} - /**{{#summary}} + /** + {{#summary}} * {{summary}} - *{{/summary}}{{#notes}} - * {{notes}}{{/notes}}{{#allParams}} - * @param params.{{paramName}} {{description}}{{/allParams}} + {{/summary}} + {{#notes}} + * {{notes}} + {{/notes}} + {{#allParams}} + * @param params.{{paramName}} {{description}} + {{/allParams}} */ async {{nickname}}({{#hasParams}}params: I{{operationIdCamelCase}}Params{{/hasParams}}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { // Verify required parameters are set @@ -52,7 +57,7 @@ export class {{classname}} extends Api { // Create URL to call const url = `${this.basePath}{{{path}}}`{{#pathParams}} - .replace(`{${'{{baseName}}'}}`, `${params['{{paramName}}']}`){{/pathParams}}; + .replace(`{${'{{baseName}}'}}`, encodeURIComponent(String(${params['{{paramName}}']}))){{/pathParams}}; const response = await this.httpClient.createRequest(url) // Set HTTP method diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache index 62db1d029c4..b209fed6add 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -99,7 +99,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/required}} {{/allParams}} const path = `{{{path}}}`{{#pathParams}} - .replace(`{${"{{baseName}}"}}`, String({{paramName}})){{/pathParams}}; + .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: '{{httpMethod}}' }, options); const headerParameter = {} as any; 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 2191d52f965..004867abef9 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache @@ -48,10 +48,12 @@ export class {{classname}} { {{#summary}} * @summary {{&summary}} {{/summary}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ + {{#allParams}} + * @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}} }> { - let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = {}; @@ -66,8 +68,8 @@ export class {{classname}} { if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } -{{/required}} +{{/required}} {{/allParams}} {{#queryParams}} {{#isListContainer}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index 0aed7f531b8..bbcc9cce84c 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -364,21 +364,26 @@ export class {{classname}} { {{#summary}} * @summary {{&summary}} {{/summary}} - {{#allParams}}* @param {{paramName}} {{description}} - {{/allParams}}*/ + {{#allParams}} + * @param {{paramName}} {{description}} + {{/allParams}} + */ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; -{{#allParams}}{{#required}} +{{#allParams}} +{{#required}} // verify required parameter '{{paramName}}' is not null or undefined if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } -{{/required}}{{/allParams}} + +{{/required}} +{{/allParams}} {{#queryParams}} if ({{paramName}} !== undefined) { queryParameters['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); diff --git a/samples/client/petstore/typescript-angularjs/api/PetApi.ts b/samples/client/petstore/typescript-angularjs/api/PetApi.ts index a830833d94b..1db89920e73 100644 --- a/samples/client/petstore/typescript-angularjs/api/PetApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/PetApi.ts @@ -40,6 +40,7 @@ export class PetApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, @@ -70,6 +71,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + headerParams['api_key'] = apiKey; let httpRequestParams: ng.IRequestConfig = { @@ -99,6 +101,7 @@ export class PetApi { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } + if (status !== undefined) { queryParameters['status'] = status; } @@ -130,6 +133,7 @@ export class PetApi { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } + if (tags !== undefined) { queryParameters['tags'] = tags; } @@ -162,6 +166,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'GET', url: localVarPath, @@ -189,6 +194,7 @@ export class PetApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, @@ -222,6 +228,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } + headerParams['Content-Type'] = 'application/x-www-form-urlencoded'; formParams['name'] = name; @@ -261,6 +268,7 @@ export class PetApi { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } + headerParams['Content-Type'] = 'application/x-www-form-urlencoded'; formParams['additionalMetadata'] = additionalMetadata; diff --git a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts index 93199134ab8..1d26cfa0312 100644 --- a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts @@ -41,6 +41,7 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'DELETE', url: localVarPath, @@ -91,6 +92,7 @@ export class StoreApi { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'GET', url: localVarPath, @@ -118,6 +120,7 @@ export class StoreApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, diff --git a/samples/client/petstore/typescript-angularjs/api/UserApi.ts b/samples/client/petstore/typescript-angularjs/api/UserApi.ts index 903abecb803..091ad8b5dca 100644 --- a/samples/client/petstore/typescript-angularjs/api/UserApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/UserApi.ts @@ -40,6 +40,7 @@ export class UserApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, @@ -68,6 +69,7 @@ export class UserApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, @@ -96,6 +98,7 @@ export class UserApi { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'POST', url: localVarPath, @@ -125,6 +128,7 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'DELETE', url: localVarPath, @@ -153,6 +157,7 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'GET', url: localVarPath, @@ -181,10 +186,12 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } + // verify required parameter 'password' is not null or undefined if (password === null || password === undefined) { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } + if (username !== undefined) { queryParameters['username'] = username; } @@ -244,10 +251,12 @@ export class UserApi { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } + // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } + let httpRequestParams: ng.IRequestConfig = { method: 'PUT', url: localVarPath, diff --git a/samples/client/petstore/typescript-aurelia/default/PetApi.ts b/samples/client/petstore/typescript-aurelia/default/PetApi.ts index 5d4a980b283..2d0cf2d84f1 100644 --- a/samples/client/petstore/typescript-aurelia/default/PetApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/PetApi.ts @@ -99,7 +99,6 @@ export class PetApi extends Api { /** * Add a new pet to the store - * * * @param params.body Pet object that needs to be added to the store */ @@ -131,7 +130,6 @@ export class PetApi extends Api { /** * Deletes a pet - * * * @param params.petId Pet id to delete * @param params.apiKey @@ -142,7 +140,7 @@ export class PetApi extends Api { // Create URL to call const url = `${this.basePath}/pet/{petId}` - .replace(`{${'petId'}}`, `${params['petId']}`); + .replace(`{${'petId'}}`, encodeURIComponent(String(${params['petId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -162,7 +160,6 @@ export class PetApi extends Api { /** * Finds Pets by status - * * Multiple status values can be provided with comma separated strings * @param params.status Status values that need to be considered for filter */ @@ -195,7 +192,6 @@ export class PetApi extends Api { /** * Finds Pets by tags - * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param params.tags Tags to filter by */ @@ -228,7 +224,6 @@ export class PetApi extends Api { /** * Find pet by ID - * * Returns a single pet * @param params.petId ID of pet to return */ @@ -238,7 +233,7 @@ export class PetApi extends Api { // Create URL to call const url = `${this.basePath}/pet/{petId}` - .replace(`{${'petId'}}`, `${params['petId']}`); + .replace(`{${'petId'}}`, encodeURIComponent(String(${params['petId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -259,7 +254,6 @@ export class PetApi extends Api { /** * Update an existing pet - * * * @param params.body Pet object that needs to be added to the store */ @@ -291,7 +285,6 @@ export class PetApi extends Api { /** * Updates a pet in the store with form data - * * * @param params.petId ID of pet that needs to be updated * @param params.name Updated name of the pet @@ -303,7 +296,7 @@ export class PetApi extends Api { // Create URL to call const url = `${this.basePath}/pet/{petId}` - .replace(`{${'petId'}}`, `${params['petId']}`); + .replace(`{${'petId'}}`, encodeURIComponent(String(${params['petId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -329,7 +322,6 @@ export class PetApi extends Api { /** * uploads an image - * * * @param params.petId ID of pet to update * @param params.additionalMetadata Additional data to pass to server @@ -341,7 +333,7 @@ export class PetApi extends Api { // Create URL to call const url = `${this.basePath}/pet/{petId}/uploadImage` - .replace(`{${'petId'}}`, `${params['petId']}`); + .replace(`{${'petId'}}`, encodeURIComponent(String(${params['petId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method diff --git a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts index bd618b888dc..fbc4dabdee5 100644 --- a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts @@ -62,7 +62,6 @@ export class StoreApi extends Api { /** * Delete purchase order by ID - * * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param params.orderId ID of the order that needs to be deleted */ @@ -72,7 +71,7 @@ export class StoreApi extends Api { // Create URL to call const url = `${this.basePath}/store/order/{orderId}` - .replace(`{${'orderId'}}`, `${params['orderId']}`); + .replace(`{${'orderId'}}`, encodeURIComponent(String(${params['orderId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -91,7 +90,6 @@ export class StoreApi extends Api { /** * Returns pet inventories by status - * * Returns a map of status codes to quantities */ async getInventory(): Promise<{ [key: string]: number; }> { @@ -119,7 +117,6 @@ export class StoreApi extends Api { /** * Find purchase order by ID - * * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param params.orderId ID of pet that needs to be fetched */ @@ -129,7 +126,7 @@ export class StoreApi extends Api { // Create URL to call const url = `${this.basePath}/store/order/{orderId}` - .replace(`{${'orderId'}}`, `${params['orderId']}`); + .replace(`{${'orderId'}}`, encodeURIComponent(String(${params['orderId']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -148,7 +145,6 @@ export class StoreApi extends Api { /** * Place an order for a pet - * * * @param params.body order placed for purchasing the pet */ diff --git a/samples/client/petstore/typescript-aurelia/default/UserApi.ts b/samples/client/petstore/typescript-aurelia/default/UserApi.ts index c569b2a4b79..ff0eae5238d 100644 --- a/samples/client/petstore/typescript-aurelia/default/UserApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/UserApi.ts @@ -93,7 +93,6 @@ export class UserApi extends Api { /** * Create user - * * This can only be done by the logged in user. * @param params.body Created user object */ @@ -124,7 +123,6 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * * * @param params.body List of user object */ @@ -155,7 +153,6 @@ export class UserApi extends Api { /** * Creates list of users with given input array - * * * @param params.body List of user object */ @@ -186,7 +183,6 @@ export class UserApi extends Api { /** * Delete user - * * This can only be done by the logged in user. * @param params.username The name that needs to be deleted */ @@ -196,7 +192,7 @@ export class UserApi extends Api { // Create URL to call const url = `${this.basePath}/user/{username}` - .replace(`{${'username'}}`, `${params['username']}`); + .replace(`{${'username'}}`, encodeURIComponent(String(${params['username']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -215,7 +211,6 @@ export class UserApi extends Api { /** * Get user by user name - * * * @param params.username The name that needs to be fetched. Use user1 for testing. */ @@ -225,7 +220,7 @@ export class UserApi extends Api { // Create URL to call const url = `${this.basePath}/user/{username}` - .replace(`{${'username'}}`, `${params['username']}`); + .replace(`{${'username'}}`, encodeURIComponent(String(${params['username']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method @@ -244,7 +239,6 @@ export class UserApi extends Api { /** * Logs user into the system - * * * @param params.username The user name for login * @param params.password The password for login in clear text @@ -279,7 +273,6 @@ export class UserApi extends Api { /** * Logs out current logged in user session - * * */ async logoutUser(): Promise { @@ -305,7 +298,6 @@ export class UserApi extends Api { /** * Updated user - * * This can only be done by the logged in user. * @param params.username name that need to be deleted * @param params.body Updated user object @@ -317,7 +309,7 @@ export class UserApi extends Api { // Create URL to call const url = `${this.basePath}/user/{username}` - .replace(`{${'username'}}`, `${params['username']}`); + .replace(`{${'username'}}`, encodeURIComponent(String(${params['username']}))); const response = await this.httpClient.createRequest(url) // Set HTTP method diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 858d0469fdb..b31bd51457e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -380,7 +380,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -504,7 +504,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -583,7 +583,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -635,7 +635,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } const path = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -1064,7 +1064,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1124,7 +1124,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1474,7 +1474,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1503,7 +1503,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1601,7 +1601,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'PUT' }, options); const headerParameter = {} as any; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index 858d0469fdb..b31bd51457e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -380,7 +380,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -504,7 +504,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -583,7 +583,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -635,7 +635,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } const path = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -1064,7 +1064,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1124,7 +1124,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1474,7 +1474,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1503,7 +1503,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1601,7 +1601,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'PUT' }, options); const headerParameter = {} as any; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 858d0469fdb..b31bd51457e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -380,7 +380,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -504,7 +504,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -583,7 +583,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } const path = `/pet/{petId}` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -635,7 +635,7 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } const path = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, String(petId)); + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'POST' }, options); const headerParameter = {} as any; @@ -1064,7 +1064,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1124,7 +1124,7 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } const path = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, String(orderId)); + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1474,7 +1474,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'DELETE' }, options); const headerParameter = {} as any; @@ -1503,7 +1503,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'GET' }, options); const headerParameter = {} as any; @@ -1601,7 +1601,7 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } const path = `/user/{username}` - .replace(`{${"username"}}`, String(username)); + .replace(`{${"username"}}`, encodeURIComponent(String(username))); const urlObj = url.parse(path, true); const requestOptions = Object.assign({ method: 'PUT' }, options); const headerParameter = {} as any; diff --git a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts index 3a2844ef25c..7c893cfe242 100644 --- a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts @@ -112,7 +112,7 @@ export class PetApi { * @param apiKey */ public deletePet(petId: number, apiKey?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -122,7 +122,6 @@ export class PetApi { } - localVarPath = localVarPath + "?" + $.param(queryParameters); headerParams['api_key'] = String(apiKey); @@ -295,7 +294,7 @@ export class PetApi { * @param petId ID of pet to return */ public getPetById(petId: number): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -414,7 +413,7 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithForm(petId: number, name?: string, status?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -427,8 +426,6 @@ export class PetApi { } - - localVarPath = localVarPath + "?" + $.param(queryParameters); if (name !== null && name !== undefined) { formParams.append('name', name); @@ -494,7 +491,7 @@ export class PetApi { * @param file file to upload */ public uploadFile(petId: number, additionalMetadata?: string, file?: any): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { - let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -507,8 +504,6 @@ export class PetApi { } - - localVarPath = localVarPath + "?" + $.param(queryParameters); if (additionalMetadata !== null && additionalMetadata !== undefined) { formParams.append('additionalMetadata', additionalMetadata); diff --git a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts index f7e3edc1ccd..7ccfc57a4d5 100644 --- a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts @@ -48,7 +48,7 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', String(orderId)); + let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -144,7 +144,7 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { - let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', String(orderId)); + let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = {}; diff --git a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts index 3daa0f67940..afb6cfd883e 100644 --- a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts @@ -204,7 +204,7 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUser(username: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; @@ -253,7 +253,7 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; @@ -407,7 +407,7 @@ export class UserApi { * @param body Updated user object */ public updateUser(username: string, body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index 3a2844ef25c..7c893cfe242 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -112,7 +112,7 @@ export class PetApi { * @param apiKey */ public deletePet(petId: number, apiKey?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -122,7 +122,6 @@ export class PetApi { } - localVarPath = localVarPath + "?" + $.param(queryParameters); headerParams['api_key'] = String(apiKey); @@ -295,7 +294,7 @@ export class PetApi { * @param petId ID of pet to return */ public getPetById(petId: number): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -414,7 +413,7 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithForm(petId: number, name?: string, status?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -427,8 +426,6 @@ export class PetApi { } - - localVarPath = localVarPath + "?" + $.param(queryParameters); if (name !== null && name !== undefined) { formParams.append('name', name); @@ -494,7 +491,7 @@ export class PetApi { * @param file file to upload */ public uploadFile(petId: number, additionalMetadata?: string, file?: any): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { - let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', String(petId)); + let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -507,8 +504,6 @@ export class PetApi { } - - localVarPath = localVarPath + "?" + $.param(queryParameters); if (additionalMetadata !== null && additionalMetadata !== undefined) { formParams.append('additionalMetadata', additionalMetadata); diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index f7e3edc1ccd..7ccfc57a4d5 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -48,7 +48,7 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', String(orderId)); + let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = {}; @@ -144,7 +144,7 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { - let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', String(orderId)); + let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = {}; diff --git a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts index 3daa0f67940..afb6cfd883e 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts @@ -204,7 +204,7 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUser(username: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; @@ -253,7 +253,7 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; @@ -407,7 +407,7 @@ export class UserApi { * @param body Updated user object */ public updateUser(username: string, body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { - let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', String(username)); + let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = {}; diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 4a357e76d4e..45fabd8e1d5 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -532,7 +532,6 @@ export class PetApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); @@ -584,12 +583,11 @@ export class PetApi { */ public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); @@ -644,7 +642,6 @@ export class PetApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); @@ -703,7 +700,6 @@ export class PetApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); @@ -758,12 +754,11 @@ export class PetApi { */ public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); @@ -818,7 +813,6 @@ export class PetApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); @@ -871,12 +865,11 @@ export class PetApi { */ public updatePetWithForm (petId: number, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); @@ -936,12 +929,11 @@ export class PetApi { */ public uploadFile (petId: number, additionalMetadata?: string, file?: Buffer) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); @@ -1053,12 +1045,11 @@ export class StoreApi { */ public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); @@ -1110,7 +1101,6 @@ export class StoreApi { let formParams: any = {}; - let useFormData = false; let requestOptions: request.Options = { @@ -1155,12 +1145,11 @@ export class StoreApi { */ public getOrderById (orderId: number) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); @@ -1213,7 +1202,6 @@ export class StoreApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); @@ -1319,7 +1307,6 @@ export class UserApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); @@ -1372,7 +1359,6 @@ export class UserApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); @@ -1425,7 +1411,6 @@ export class UserApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); @@ -1474,12 +1459,11 @@ export class UserApi { */ public deleteUser (username: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); @@ -1527,12 +1511,11 @@ export class UserApi { */ public getUserByName (username: string) : Promise<{ response: http.ClientResponse; body: User; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); @@ -1586,7 +1569,6 @@ export class UserApi { let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); @@ -1652,7 +1634,6 @@ export class UserApi { let formParams: any = {}; - let useFormData = false; let requestOptions: request.Options = { @@ -1695,12 +1676,11 @@ export class UserApi { */ public updateUser (username: string, body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index b505139e8ab..45fabd8e1d5 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -1,9 +1,9 @@ /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * 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@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -136,6 +136,41 @@ class ObjectSerializer { } } +/** +* Describes the result of uploading an image resource +*/ +export class ApiResponse { + 'code': number; + 'type': string; + 'message': string; + + static discriminator = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ApiResponse.attributeTypeMap; + } +} + +/** +* A category for a pet +*/ export class Category { 'id': number; 'name': string; @@ -159,6 +194,9 @@ export class Category { } } +/** +* An order for a pets from the pet store +*/ export class Order { 'id': number; 'petId': number; @@ -216,6 +254,9 @@ export namespace Order { Delivered = 'delivered' } } +/** +* A pet for sale in the pet store +*/ export class Pet { 'id': number; 'category': Category; @@ -273,6 +314,9 @@ export namespace Pet { Sold = 'sold' } } +/** +* A tag for a pet +*/ export class Tag { 'id': number; 'name': string; @@ -296,6 +340,9 @@ export class Tag { } } +/** +* A User who is purchasing from the pet store +*/ export class User { 'id': number; 'username': string; @@ -365,6 +412,7 @@ let enumsMap = { } let typeMap = { + "ApiResponse": ApiResponse, "Category": Category, "Order": Order, "Pet": Pet, @@ -478,12 +526,16 @@ 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?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { + public addPet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } let useFormData = false; @@ -531,12 +583,11 @@ export class PetApi { */ public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); @@ -585,12 +636,16 @@ export class PetApi { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus (status?: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { + public findPetsByStatus (status: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByStatus'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } if (status !== undefined) { queryParameters['status'] = ObjectSerializer.serialize(status, "Array"); @@ -639,12 +694,16 @@ export class PetApi { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags (tags?: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { + public findPetsByTags (tags: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByTags'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } if (tags !== undefined) { queryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); @@ -689,18 +748,17 @@ export class PetApi { }); } /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * Returns a single pet * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched + * @param petId ID of pet to return */ public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); @@ -720,8 +778,6 @@ export class PetApi { this.authentications.api_key.applyToRequest(requestOptions); - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { @@ -751,12 +807,16 @@ export class PetApi { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet (body?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { + public updatePet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } let useFormData = false; @@ -803,14 +863,13 @@ export class PetApi { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm (petId: string, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { + public updatePetWithForm (petId: number, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); @@ -868,14 +927,13 @@ export class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile (petId: number, additionalMetadata?: string, file?: Buffer) : Promise<{ response: http.ClientResponse; body?: any; }> { + public uploadFile (petId: number, additionalMetadata?: string, file?: Buffer) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); @@ -913,11 +971,12 @@ export class PetApi { requestOptions.form = formParams; } } - return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { + return new Promise<{ response: http.ClientResponse; body: ApiResponse; }>((resolve, reject) => { request(requestOptions, (error, response, body) => { if (error) { reject(error); } else { + body = ObjectSerializer.deserialize(body, "ApiResponse"); if (response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { @@ -986,12 +1045,11 @@ export class StoreApi { */ public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); @@ -1043,7 +1101,6 @@ export class StoreApi { let formParams: any = {}; - let useFormData = false; let requestOptions: request.Options = { @@ -1086,14 +1143,13 @@ export class StoreApi { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById (orderId: string) : Promise<{ response: http.ClientResponse; body: Order; }> { + public getOrderById (orderId: number) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); @@ -1140,12 +1196,16 @@ export class StoreApi { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder (body?: Order) : Promise<{ response: http.ClientResponse; body: Order; }> { + public placeOrder (body: Order) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } let useFormData = false; @@ -1241,12 +1301,16 @@ export class UserApi { * @summary Create user * @param body Created user object */ - public createUser (body?: User) : Promise<{ response: http.ClientResponse; body?: any; }> { + public createUser (body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } let useFormData = false; @@ -1289,12 +1353,16 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput (body?: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { + public createUsersWithArrayInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } let useFormData = false; @@ -1337,12 +1405,16 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput (body?: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { + public createUsersWithListInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } let useFormData = false; @@ -1387,12 +1459,11 @@ export class UserApi { */ public deleteUser (username: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); @@ -1440,12 +1511,11 @@ export class UserApi { */ public getUserByName (username: string) : Promise<{ response: http.ClientResponse; body: User; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); @@ -1493,12 +1563,21 @@ 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) : Promise<{ response: http.ClientResponse; body: string; }> { + public loginUser (username: string, password: string) : Promise<{ response: http.ClientResponse; body: string; }> { const localVarPath = this.basePath + '/user/login'; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } if (username !== undefined) { queryParameters['username'] = ObjectSerializer.serialize(username, "string"); @@ -1555,7 +1634,6 @@ export class UserApi { let formParams: any = {}; - let useFormData = false; let requestOptions: request.Options = { @@ -1596,19 +1674,23 @@ export class UserApi { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser (username: string, body?: User) : Promise<{ response: http.ClientResponse; body?: any; }> { + public updateUser (username: string, body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); let formParams: any = {}; - // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + let useFormData = false; From d75e4ae4dea1bb4d6f7a4188e415325e2dd047ea Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 25 Sep 2017 17:22:41 +0800 Subject: [PATCH 063/197] add link to netflix blog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d8d1fc54e5b..1a02469a9f1 100644 --- a/README.md +++ b/README.md @@ -857,6 +857,7 @@ Presentations/Videos/Tutorials/Books ---------------------------------------- - 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](https://twitter.com/fehguy) - 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](https://twitter.com/fehguy) at [Gluecon](http://gluecon.com/) +- 2014/11/11 - [Genie 2.0: Second Wish Granted!](https://medium.com/netflix-techblog/genie-2-0-second-wish-granted-d888d79455c6) by [Tom Gianos](http://www.linkedin.com/in/thomasgianos/) and [Amit Sharma](https://www.linkedin.com/pub/amit-sharma/5/163/a83) @ [Netflix](https://www.netflix.com/) Big Data Platform Team - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) From c09c7d2fac31dc65886532e7e2c766bcb4cc6fe0 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 26 Sep 2017 11:11:24 +0800 Subject: [PATCH 064/197] add new item to copy technical committee in PR --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e0bfde6208b..b5882aaf535 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,8 @@ - [ ] Read the [contribution guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). - [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`. -- [ ] Filed the PR against the correct branch: master for non-breaking changes and `3.0.0` branch for breaking (non-backward compatible) changes. +- [ ] Filed the PR against the correct branch: `3.0.0` branch for changes related to OpenAPI spec 3.0. Default: `master`. +- [ ] Copied the [technical committee](https://github.com/swagger-api/swagger-codegen/#swagger-codegen-technical-committee) to review the pull request ### Description of the PR From d325c6ee7703466d89fd0b8ba99a55d05288c6de Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 26 Sep 2017 11:14:54 +0800 Subject: [PATCH 065/197] revise wording for PR template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b5882aaf535..c67ee71d48b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ - [ ] Read the [contribution guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md). - [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`. - [ ] Filed the PR against the correct branch: `3.0.0` branch for changes related to OpenAPI spec 3.0. Default: `master`. -- [ ] Copied the [technical committee](https://github.com/swagger-api/swagger-codegen/#swagger-codegen-technical-committee) to review the pull request +- [ ] Copied the [technical committee](https://github.com/swagger-api/swagger-codegen/#swagger-codegen-technical-committee) to review the pull request if your PR is targeting a particular programming langauge. ### Description of the PR From 0a9e3782c536145f8908b766215f817a574c6548 Mon Sep 17 00:00:00 2001 From: Greg Marzouka Date: Tue, 26 Sep 2017 00:22:01 -0400 Subject: [PATCH 066/197] [Scala] Add support for PATCH via X-HTTP-Method-Override (#6539) * Added support for http PATCH to the scala client using X-HTTP-Method-Override header * Update Petstore sample --- .../main/resources/scala/apiInvoker.mustache | 5 ++ .../scala/.swagger-codegen/VERSION | 1 + .../petstore-security-test/scala/build.gradle | 7 ++ .../petstore-security-test/scala/build.sbt | 67 +++++++------- .../petstore-security-test/scala/pom.xml | 6 ++ .../scala/io/swagger/client/ApiInvoker.scala | 5 ++ .../scala/io/swagger/client/AsyncClient.scala | 20 +++++ .../scala/io/swagger/client/api/FakeApi.scala | 90 +++++++++++++------ .../scala/io/swagger/client/ApiInvoker.scala | 5 ++ 9 files changed, 146 insertions(+), 60 deletions(-) create mode 100644 samples/client/petstore-security-test/scala/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index e1e420d7c6d..f5f3bbce3f3 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -142,6 +142,11 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case "DELETE" => { builder.delete(classOf[ClientResponse]) } + case "PATCH" => { + if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } case _ => null } response.getStatusInfo().getStatusCode() match { diff --git a/samples/client/petstore-security-test/scala/.swagger-codegen/VERSION b/samples/client/petstore-security-test/scala/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/scala/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/scala/build.gradle b/samples/client/petstore-security-test/scala/build.gradle index 979db7783c4..707c4f9e988 100644 --- a/samples/client/petstore-security-test/scala/build.gradle +++ b/samples/client/petstore-security-test/scala/build.gradle @@ -104,6 +104,12 @@ ext { jackson_version = "2.4.2" junit_version = "4.8.1" scala_test_version = "2.2.4" + swagger_async_httpclient_version = "0.3.5" +} + +repositories { + mavenLocal() + mavenCentral() } dependencies { @@ -117,4 +123,5 @@ dependencies { testCompile "junit:junit:$junit_version" compile "joda-time:joda-time:$jodatime_version" compile "org.joda:joda-convert:$joda_version" + compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version" } diff --git a/samples/client/petstore-security-test/scala/build.sbt b/samples/client/petstore-security-test/scala/build.sbt index 063b2b0d490..bececaf181b 100644 --- a/samples/client/petstore-security-test/scala/build.sbt +++ b/samples/client/petstore-security-test/scala/build.sbt @@ -1,33 +1,34 @@ -lazy val root = (project in file(".")). - settings( - version := "1.0.0", - name := "swagger-scala-client", - organization := "io.swagger", - scalaVersion := "2.11.8", - - libraryDependencies ++= Seq( - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", - "com.sun.jersey" % "jersey-core" % "1.19", - "com.sun.jersey" % "jersey-client" % "1.19", - "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", - "org.jfarcand" % "jersey-ahc-client" % "1.0.5", - "io.swagger" % "swagger-core" % "1.5.8", - "joda-time" % "joda-time" % "2.2", - "org.joda" % "joda-convert" % "1.2", - "org.scalatest" %% "scalatest" % "2.2.4" % "test", - "junit" % "junit" % "4.8.1" % "test" - ), - - resolvers ++= Seq( - Resolver.jcenterRepo, - Resolver.mavenLocal - ), - - scalacOptions := Seq( - "-unchecked", - "-deprecation", - "-feature" - ), - - publishArtifact in (Compile, packageDoc) := false - ) \ No newline at end of file +version := "1.0.0" + +name := "swagger-scala-client" + +organization := "io.swagger" + +scalaVersion := "2.11.8" + +libraryDependencies ++= Seq( + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", + "com.sun.jersey" % "jersey-core" % "1.19", + "com.sun.jersey" % "jersey-client" % "1.19", + "com.sun.jersey.contribs" % "jersey-multipart" % "1.19", + "org.jfarcand" % "jersey-ahc-client" % "1.0.5", + "io.swagger" % "swagger-core" % "1.5.8", + "joda-time" % "joda-time" % "2.2", + "org.joda" % "joda-convert" % "1.2", + "org.scalatest" %% "scalatest" % "2.2.4" % "test", + "junit" % "junit" % "4.8.1" % "test", + "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" +) + +resolvers ++= Seq( + Resolver.mavenLocal +) + +scalacOptions := Seq( + "-unchecked", + "-deprecation", + "-feature" +) + +publishArtifact in (Compile, packageDoc) := false + diff --git a/samples/client/petstore-security-test/scala/pom.xml b/samples/client/petstore-security-test/scala/pom.xml index 283256f2489..81bcd8887f4 100644 --- a/samples/client/petstore-security-test/scala/pom.xml +++ b/samples/client/petstore-security-test/scala/pom.xml @@ -209,6 +209,11 @@ joda-convert ${joda-version} + + com.wordnik.swagger + swagger-async-httpclient_2.10 + ${swagger-async-httpclient-version} + 2.10.4 @@ -223,6 +228,7 @@ 4.8.1 3.1.5 2.2.4 + 0.3.5 UTF-8 diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 5003aa4a9fb..9ea846dbab6 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -153,6 +153,11 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case "DELETE" => { builder.delete(classOf[ClientResponse]) } + case "PATCH" => { + if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } case _ => null } response.getStatusInfo().getStatusCode() match { diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala new file mode 100644 index 00000000000..c518277f577 --- /dev/null +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala @@ -0,0 +1,20 @@ +package io.swagger.client + +import io.swagger.client.api._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class AsyncClient(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala index 7cd1c12faec..83acded275f 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala @@ -12,8 +12,9 @@ package io.swagger.client.api -import io.swagger.client.ApiInvoker -import io.swagger.client.ApiException +import java.text.SimpleDateFormat + +import io.swagger.client.{ApiInvoker, ApiException} import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.file.FileDataBodyPart @@ -25,12 +26,41 @@ import java.util.Date import scala.collection.mutable.HashMap +import com.wordnik.swagger.client._ +import scala.concurrent.Future +import collection.mutable + +import java.net.URI + +import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ +import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent._ +import scala.concurrent.duration._ +import scala.util.{Failure, Success, Try} + class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r", defApiInvoker: ApiInvoker = ApiInvoker) { + + implicit val formats = new org.json4s.DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") + } + implicit val stringReader = ClientResponseReaders.StringReader + implicit val unitReader = ClientResponseReaders.UnitReader + implicit val jvalueReader = ClientResponseReaders.JValueReader + implicit val jsonReader = JsonFormatsReader + implicit val stringWriter = RequestWriters.StringWriter + implicit val jsonWriter = JsonFormatsWriter + var basePath = defBasePath var apiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + + val config = SwaggerConfig.forUrl(new URI(defBasePath)) + val client = new RestClient(config) + val helper = new FakeApiAsyncHelper(client, config) /** * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r @@ -39,37 +69,43 @@ class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =e * @return void */ def testCodeInject * ' " =end rn n r(testCodeInjectEndRnNR: Option[String] = None) = { - // create path and map variables - val path = "/fake".replaceAll("\\{format\\}", "json") + val await = Try(Await.result(testCodeInject * ' " =end rn n rAsync(testCodeInjectEndRnNR), Duration.Inf)) + await match { + case Success(i) => Some(await.get) + case Failure(t) => None + } + } - val contentTypes = List("application/json", "*_/ ' =end -- ") - val contentType = contentTypes(0) + /** + * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r asynchronously + * + * @param testCodeInjectEndRnNR To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) + * @return Future(void) + */ + def testCodeInject * ' " =end rn n rAsync(testCodeInjectEndRnNR: Option[String] = None) = { + helper.testCodeInject * ' " =end rn n r(testCodeInjectEndRnNR) + } - val queryParams = new HashMap[String, String] - val headerParams = new HashMap[String, String] - val formParams = new HashMap[String, String] - +} - var postBody: AnyRef = null +class FakeApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - if (contentType.startsWith("multipart/form-data")) { - val mp = new FormDataMultiPart - testCodeInjectEndRnNR.map(paramVal => mp.field("test code inject */ ' " =end -- \r\n \n \r", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE)) - postBody = mp - } else { - testCodeInjectEndRnNR.map(paramVal => formParams += "test code inject */ ' " =end -- \r\n \n \r" -> paramVal.toString) - } + def testCodeInject * ' " =end rn n r(testCodeInjectEndRnNR: Option[String] = None + )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { + // create path and map variables + val path = (addFmt("/fake")) + + // query params + val queryParams = new mutable.HashMap[String, String] + val headerParams = new mutable.HashMap[String, String] - try { - apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match { - case s: String => - case _ => None - } - } catch { - case ex: ApiException if ex.code == 404 => None - case ex: ApiException => throw ex + + val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, "") + resFuture flatMap { resp => + process(reader.read(resp)) } } + } diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 0db8a5c88e6..c39ac6d52fb 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -153,6 +153,11 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case "DELETE" => { builder.delete(classOf[ClientResponse]) } + case "PATCH" => { + if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } case _ => null } response.getStatusInfo().getStatusCode() match { From e2916fdc1366f759138a8c4620703beff0a9daa7 Mon Sep 17 00:00:00 2001 From: lukoyanov Date: Tue, 26 Sep 2017 09:14:04 +0300 Subject: [PATCH 067/197] [Java] Play! framework + retrofit2 client exception converter, bug fixes (#6543) * added exception converter * underscore removal fix * samples updated * added test * test whitespace --- .../io/swagger/codegen/DefaultCodegen.java | 8 ++- .../play25/Play25CallAdapterFactory.mustache | 20 +++++-- .../java/io/swagger/codegen/CodegenTest.java | 2 + .../retrofit2-play24/docs/AnotherFakeApi.md | 54 +++++++++++++++++++ .../io/swagger/client/api/AnotherFakeApi.java | 37 +++++++++++++ .../client/api/AnotherFakeApiTest.java | 37 +++++++++++++ .../retrofit2-play25/docs/AnotherFakeApi.md | 54 +++++++++++++++++++ .../client/Play25CallAdapterFactory.java | 20 +++++-- .../io/swagger/client/api/AnotherFakeApi.java | 37 +++++++++++++ .../client/api/AnotherFakeApiTest.java | 37 +++++++++++++ .../java/retrofit2/docs/AnotherFakeApi.md | 54 +++++++++++++++++++ .../io/swagger/client/api/AnotherFakeApi.java | 33 ++++++++++++ .../client/api/AnotherFakeApiTest.java | 37 +++++++++++++ .../java/retrofit2rx/docs/AnotherFakeApi.md | 54 +++++++++++++++++++ .../io/swagger/client/api/AnotherFakeApi.java | 33 ++++++++++++ .../client/api/AnotherFakeApiTest.java | 37 +++++++++++++ .../java/retrofit2rx2/docs/AnotherFakeApi.md | 54 +++++++++++++++++++ .../io/swagger/client/api/AnotherFakeApi.java | 33 ++++++++++++ .../client/api/AnotherFakeApiTest.java | 37 +++++++++++++ 19 files changed, 671 insertions(+), 7 deletions(-) create mode 100644 samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java 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 aa3c3f318a9..63e42e82f10 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 @@ -3255,7 +3255,13 @@ public static String camelize(String word, boolean lowercaseFirstLetter) { p = Pattern.compile("(_)(.)"); m = p.matcher(word); while (m.find()) { - word = m.replaceFirst(m.group(2).toUpperCase()); + String original = m.group(2); + String upperCase = original.toUpperCase(); + if (original.equals(upperCase)) { + word = word.replaceFirst("_", ""); + } else { + word = m.replaceFirst(upperCase); + } m = p.matcher(word); } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index d5bb1199084..e72ee4aa7ab 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -9,12 +9,23 @@ import java.lang.reflect.Type; import java.lang.reflect.WildcardType; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.function.Function; /** * Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage} */ public class Play25CallAdapterFactory extends CallAdapter.Factory { + private Function exceptionConverter = Function.identity(); + + public Play25CallAdapterFactory() { + } + + public Play25CallAdapterFactory( + Function exceptionConverter) { + this.exceptionConverter = exceptionConverter; + } + @Override public CallAdapter get(Type returnType, Annotation[] annotations, Retrofit retrofit) { if (!(returnType instanceof ParameterizedType)) { @@ -49,7 +60,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory { includeResponse = true; } - return new ValueAdapter(resultType, includeResponse); + return new ValueAdapter(resultType, includeResponse, exceptionConverter); } /** @@ -59,10 +70,13 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory { private final Type responseType; private final boolean includeResponse; + private Function exceptionConverter; - ValueAdapter(Type responseType, boolean includeResponse) { + ValueAdapter(Type responseType, boolean includeResponse, + Function exceptionConverter) { this.responseType = responseType; this.includeResponse = includeResponse; + this.exceptionConverter = exceptionConverter; } @Override @@ -85,7 +99,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory { promise.complete(response.body()); } } else { - promise.completeExceptionally(new HttpException(response)); + promise.completeExceptionally(exceptionConverter.apply(new HttpException(response))); } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index 53adbaea006..18acd4757a9 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -33,6 +33,8 @@ public void camelizeNamesTest() { Assert.assertEquals(codegen.camelize(".foo"), "Foo"); Assert.assertEquals(codegen.camelize(".foo.bar"), "FooBar"); Assert.assertEquals(codegen.camelize("foo$bar"), "Foo$bar"); + Assert.assertEquals(codegen.camelize("foo_$bar"), "Foo$bar"); + Assert.assertEquals(codegen.camelize("foo_bar"), "FooBar"); Assert.assertEquals(codegen.camelize("foo_bar_baz"), "FooBarBaz"); Assert.assertEquals(codegen.camelize("foo/bar.baz"), "FooBarBaz"); diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..bcc1a3a45ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..24b3310021c --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + + + +import retrofit2.Call; +import retrofit2.http.*; + +import okhttp3.RequestBody; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import play.libs.F; +import retrofit2.Response; + +public interface AnotherFakeApi { + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @PATCH("another-fake/dummy") + F.Promise> testSpecialTags( + @retrofit2.http.Body Client body + ); + +} diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c32ef080d65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..bcc1a3a45ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java index 39ed8ef632f..3f64cea1b74 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java @@ -9,12 +9,23 @@ import java.lang.reflect.WildcardType; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; +import java.util.function.Function; /** * Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage} */ public class Play25CallAdapterFactory extends CallAdapter.Factory { + private Function exceptionConverter = Function.identity(); + + public Play25CallAdapterFactory() { + } + + public Play25CallAdapterFactory( + Function exceptionConverter) { + this.exceptionConverter = exceptionConverter; + } + @Override public CallAdapter get(Type returnType, Annotation[] annotations, Retrofit retrofit) { if (!(returnType instanceof ParameterizedType)) { @@ -49,7 +60,7 @@ private CallAdapter> createAdapter(ParameterizedType retur includeResponse = true; } - return new ValueAdapter(resultType, includeResponse); + return new ValueAdapter(resultType, includeResponse, exceptionConverter); } /** @@ -59,10 +70,13 @@ private static final class ValueAdapter implements CallAdapter exceptionConverter; - ValueAdapter(Type responseType, boolean includeResponse) { + ValueAdapter(Type responseType, boolean includeResponse, + Function exceptionConverter) { this.responseType = responseType; this.includeResponse = includeResponse; + this.exceptionConverter = exceptionConverter; } @Override @@ -85,7 +99,7 @@ public void onResponse(Call call, Response response) { promise.complete(response.body()); } } else { - promise.completeExceptionally(new HttpException(response)); + promise.completeExceptionally(exceptionConverter.apply(new HttpException(response))); } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..8a8b70536ad --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + + + +import retrofit2.Call; +import retrofit2.http.*; + +import okhttp3.RequestBody; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import java.util.concurrent.*; +import retrofit2.Response; + +public interface AnotherFakeApi { + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @PATCH("another-fake/dummy") + CompletionStage> testSpecialTags( + @retrofit2.http.Body Client body + ); + +} diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c32ef080d65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..bcc1a3a45ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..dd5886b3bdd --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,33 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + +import retrofit2.Call; +import retrofit2.http.*; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface AnotherFakeApi { + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @PATCH("another-fake/dummy") + Call testSpecialTags( + @retrofit2.http.Body Client body + ); + +} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c32ef080d65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..bcc1a3a45ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3d71a91b2ab --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,33 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + +import rx.Observable; +import retrofit2.http.*; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface AnotherFakeApi { + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @PATCH("another-fake/dummy") + Observable testSpecialTags( + @retrofit2.http.Body Client body + ); + +} diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c32ef080d65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..bcc1a3a45ce --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..a9eb671bfe0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,33 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + +import io.reactivex.Observable; +import retrofit2.http.*; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface AnotherFakeApi { + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Call<Client> + */ + @Headers({ + "Content-Type:application/json" + }) + @PATCH("another-fake/dummy") + Observable testSpecialTags( + @retrofit2.http.Body Client body + ); + +} diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c32ef080d65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,37 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } +} From d2b91073e1fc499fea67141ff4c17740d25f8e83 Mon Sep 17 00:00:00 2001 From: Mehdy Bohlool Date: Mon, 25 Sep 2017 23:16:48 -0700 Subject: [PATCH 068/197] [python] Add default Configuration (#6554) * Add default configuration * Fix assert_hostname bug in rest.py * Update petstore sample --- .../resources/python/configuration.mustache | 17 ++++++++++++++++- .../src/main/resources/python/rest.mustache | 2 +- .../petstore_api/configuration.py | 17 ++++++++++++++++- .../petstore_api/configuration.py | 17 ++++++++++++++++- .../python/petstore_api/configuration.py | 17 ++++++++++++++++- .../client/petstore/python/petstore_api/rest.py | 2 +- 6 files changed, 66 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 512e755c24f..744b277455a 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -6,15 +6,30 @@ from __future__ import absolute_import import urllib3 +import copy import logging import multiprocessing import sys from six import iteritems +from six import with_metaclass from six.moves import http_client as httplib +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None -class Configuration(object): + def __call__(cls): + if cls._default == None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(with_metaclass(TypeWithDefault, object)): """ NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index 49508f77324..aa92c7eba73 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -69,7 +69,7 @@ class RESTClientObject(object): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = config.assert_hostname + addition_pool_args['assert_hostname'] = configuration.assert_hostname if maxsize is None: if configuration.connection_pool_maxsize is not None: diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 9e1fcf24089..29bf22034aa 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -15,15 +15,30 @@ import urllib3 +import copy import logging import multiprocessing import sys from six import iteritems +from six import with_metaclass from six.moves import http_client as httplib +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None -class Configuration(object): + def __call__(cls): + if cls._default == None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(with_metaclass(TypeWithDefault, object)): """ NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 9e1fcf24089..29bf22034aa 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -15,15 +15,30 @@ import urllib3 +import copy import logging import multiprocessing import sys from six import iteritems +from six import with_metaclass from six.moves import http_client as httplib +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None -class Configuration(object): + def __call__(cls): + if cls._default == None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(with_metaclass(TypeWithDefault, object)): """ NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 9e1fcf24089..29bf22034aa 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -15,15 +15,30 @@ import urllib3 +import copy import logging import multiprocessing import sys from six import iteritems +from six import with_metaclass from six.moves import http_client as httplib +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None -class Configuration(object): + def __call__(cls): + if cls._default == None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(with_metaclass(TypeWithDefault, object)): """ NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index c0807c2fb19..5a73a2b908c 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -78,7 +78,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = config.assert_hostname + addition_pool_args['assert_hostname'] = configuration.assert_hostname if maxsize is None: if configuration.connection_pool_maxsize is not None: From c53ebf6c458da1e249ed46b36c3a4ade66a853f2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 26 Sep 2017 17:10:08 +0800 Subject: [PATCH 069/197] add "npm run build" to ts angular --- .../petstore/typescript-angular-v2/npm/pom.xml | 14 ++++++++++++++ .../typescript-angular-v4/npm/package.json | 2 +- .../petstore/typescript-angular-v4/npm/pom.xml | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/typescript-angular-v2/npm/pom.xml b/samples/client/petstore/typescript-angular-v2/npm/pom.xml index 2fa94375062..ef93997a825 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/pom.xml +++ b/samples/client/petstore/typescript-angular-v2/npm/pom.xml @@ -39,6 +39,20 @@ + + npm-run-build + integration-test + + exec + + + npm + + run + build + + + diff --git a/samples/client/petstore/typescript-angular-v4/npm/package.json b/samples/client/petstore/typescript-angular-v4/npm/package.json index a15c011fe29..2b62278a434 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/package.json +++ b/samples/client/petstore/typescript-angular-v4/npm/package.json @@ -35,6 +35,6 @@ "typescript": "^2.1.5" }, "publishConfig": { - "registry":"https://skimdb.npmjs.com/registry" + "registry": "https://skimdb.npmjs.com/registry" } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/pom.xml b/samples/client/petstore/typescript-angular-v4/npm/pom.xml index f819205f53d..0fd558145ef 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/pom.xml +++ b/samples/client/petstore/typescript-angular-v4/npm/pom.xml @@ -39,6 +39,20 @@ + + npm-run-build + integration-test + + exec + + + npm + + run + build + + + From 5e9d977a03756b0445f026dec0a4f1b6095ff8b1 Mon Sep 17 00:00:00 2001 From: Kenny Jones Date: Tue, 26 Sep 2017 09:53:05 -0400 Subject: [PATCH 070/197] Bugfix: Resolve lint errors for generated client (#6563) Updates the bash client template to allow the generated client code to be free of lint errors. Resolves: #6562 --- .../src/main/resources/bash/client.mustache | 109 +++-- samples/client/petstore/bash/petstore-cli | 397 ++++++++++++------ 2 files changed, 326 insertions(+), 180 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index d351fbd213d..0922d286b83 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -51,7 +51,7 @@ fi ## # The filename of this script for help messages -script_name=`basename "$0"` +script_name=$(basename "$0") ## # Map for headers passed after operation as KEY:VALUE @@ -162,9 +162,17 @@ host="{{#x-codegen-host-env}}${{x-codegen-host-env}}{{/x-codegen-host-env}}" # The user credentials for basic authentication basic_auth_credential="{{#x-codegen-basicauth-env}}${{x-codegen-basicauth-env}}{{/x-codegen-basicauth-env}}" +{{#hasAuthMethods}} +{{#authMethods}} +{{#isApiKey}} +{{#isKeyInHeader}} ## # The user API key apikey_auth_credential="{{#x-codegen-apikey-env}}${{x-codegen-apikey-env}}{{/x-codegen-apikey-env}}" +{{/isKeyInHeader}} +{{/isApiKey}} +{{/authMethods}} +{{/hasAuthMethods}} ## # If true, the script will only output the actual cURL command that would be @@ -238,9 +246,9 @@ url_escape() { -e 's/)/%29/g' \ -e 's/:/%3A/g' \ -e 's/\t/%09/g' \ - -e 's/?/%3F/g' <<<$raw_url); + -e 's/?/%3F/g' <<<"$raw_url"); - echo $value + echo "$value" } ############################################################################## @@ -250,12 +258,12 @@ url_escape() { # ############################################################################## lookup_mime_type() { - local mime_type=$1 + local mime_type="$1" if [[ ${mime_type_abbreviations[$mime_type]} ]]; then - echo ${mime_type_abbreviations[$mime_type]} + echo "${mime_type_abbreviations[$mime_type]}" else - echo $1 + echo "$mime_type" fi } @@ -267,12 +275,12 @@ lookup_mime_type() { ############################################################################## header_arguments_to_curl() { local headers_curl="" - local api_key_header="" - local api_key_header_in_cli="" {{#hasAuthMethods}} {{#authMethods}} {{#isApiKey}} {{#isKeyInHeader}} + local api_key_header="" + local api_key_header_in_cli="" api_key_header="{{keyParamName}}" {{/isKeyInHeader}} {{/isApiKey}} @@ -281,9 +289,17 @@ header_arguments_to_curl() { for key in "${!header_arguments[@]}"; do headers_curl+="-H \"${key}: ${header_arguments[${key}]}\" " +{{#hasAuthMethods}} +{{#authMethods}} +{{#isApiKey}} +{{#isKeyInHeader}} if [[ "${key}XX" == "${api_key_header}XX" ]]; then api_key_header_in_cli="YES" fi +{{/isKeyInHeader}} +{{/isApiKey}} +{{/authMethods}} +{{/hasAuthMethods}} done {{#hasAuthMethods}} {{#authMethods}} @@ -315,7 +331,6 @@ header_arguments_to_curl() { ############################################################################## body_parameters_to_json() { local body_json="-d '{" - local body_parameter_count=${#body_parameters[@]} local count=0 for key in "${!body_parameters[@]}"; do if [[ $((count++)) -gt 0 ]]; then @@ -366,7 +381,8 @@ build_request_path() { if [[ "$force" = false ]]; then local was_error="" for qparam in "${query_params[@]}" "${path_params[@]}"; do - local parameter_values=($(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}")) + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") # # Check if the number of provided values is not less than minimum required @@ -391,29 +407,30 @@ build_request_path() { fi # First replace all path parameters in the path + local path_regex="(.*)(\\{$pparam\\})(.*)" for pparam in "${path_params[@]}"; do - if [[ $path_template =~ (.*)(\{$pparam\})(.*) ]]; then + if [[ $path_template =~ $path_regex ]]; then path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} fi done local query_request_part="" - local query_parameter_count=${#query_params[@]} local count=0 for qparam in "${query_params[@]}"; do # Get the array of parameter values - local parameter_values=($(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}")) local parameter_value="" + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - if [[ -n "${parameter_values[@]}" ]]; then + if [[ -n "${parameter_values[*]}" ]]; then if [[ $((count++)) -gt 0 ]]; then query_request_part+="&" fi fi {{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} if [[ ${qparam} == "{{keyParamName}}" ]]; then - if [[ -n "${parameter_values[@]}" ]]; then + if [[ -n "${parameter_values[*]}" ]]; then parameter_value+="${qparam}=${parameter_values}" {{#x-codegen-apikey-env}} elif [[ -n "$MATRIX_API_KEY" ]]; then @@ -481,7 +498,7 @@ build_request_path() { local vcount=0 for qvalue in "${parameter_values[@]}"; do if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="\t" + parameter_value+="\\t" fi parameter_value+="${qvalue}" done @@ -502,7 +519,7 @@ build_request_path() { path_template+="?${query_request_part}" fi - echo $path_template + echo "$path_template" } @@ -576,7 +593,7 @@ EOF {{#apis}} echo "" echo -e "${BOLD}${WHITE}[{{classVarName}}]${OFF}" -read -d '' ops <${OFF}\t\t\t\tSpecify the host URL " + echo -e " -h,--help\\t\\t\\t\\tPrint this help" + echo -e " -V,--version\\t\\t\\t\\tPrint API version" + echo -e " --about\\t\\t\\t\\tPrint the information about service" + echo -e " --host ${CYAN}${OFF}\\t\\t\\t\\tSpecify the host URL " {{#swagger}} -{{#host}}echo -e " \t\t\t\t(e.g. 'https://{{host}}')"{{/host}} -{{^host}}echo -e " \t\t\t\t(e.g. 'https://127.0.0.1:8080')"{{/host}} +{{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{host}}')"{{/host}} +{{^host}}echo -e " \\t\\t\\t\\t(e.g. 'https://127.0.0.1:8080')"{{/host}} {{/swagger}} - echo -e " --force\t\t\t\tForce command invocation in spite of missing" - echo -e " \t\t\t\trequired parameters or wrong content type" - echo -e " --dry-run\t\t\t\tPrint out the cURL command without" - echo -e " \t\t\t\texecuting it" - echo -e " -nc,--no-colors\t\t\tEnforce print without colors, otherwise autodected" - echo -e " -ac,--accept ${YELLOW}${OFF}\t\tSet the 'Accept' header in the request" - echo -e " -ct,--content-type ${YELLOW}${OFF}\tSet the 'Content-type' header in " - echo -e " \tthe request" + echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" + echo -e " \\t\\t\\t\\trequired parameters or wrong content type" + echo -e " --dry-run\\t\\t\\t\\tPrint out the cURL command without" + echo -e " \\t\\t\\t\\texecuting it" + echo -e " -nc,--no-colors\\t\\t\\tEnforce print without colors, otherwise autodected" + echo -e " -ac,--accept ${YELLOW}${OFF}\\t\\tSet the 'Accept' header in the request" + echo -e " -ct,--content-type ${YELLOW}${OFF}\\tSet the 'Content-type' header in " + echo -e " \\tthe request" echo "" } @@ -620,7 +637,7 @@ print_about() { echo -e "License: {{#swagger}}{{#info}}{{#license}}{{name}}{{/license}}{{/info}}{{/swagger}}" echo -e "Contact: {{#swagger}}{{#info}}{{#contact}}{{email}}{{/contact}}{{/info}}{{/swagger}}" echo "" -read -d '' appdescription < $body_content_temp_file + cat - > "$body_content_temp_file" ;; *=*) # Parse operation arguments and convert them into curl # only after the operation argument if [[ "$operation" ]]; then - IFS='=' read parameter_name parameter_value <<< "$key" + IFS='=' read -r parameter_name parameter_value <<< "$key" if [[ -z "${operation_parameters[$parameter_name]+foo}" ]]; then operation_parameters[$parameter_name]=$(url_escape "${parameter_value}") else diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index d3e6720e1fc..04b0fd2f634 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -50,7 +50,7 @@ fi ## # The filename of this script for help messages -script_name=`basename "$0"` +script_name=$(basename "$0") ## # Map for headers passed after operation as KEY:VALUE @@ -372,9 +372,9 @@ url_escape() { -e 's/)/%29/g' \ -e 's/:/%3A/g' \ -e 's/\t/%09/g' \ - -e 's/?/%3F/g' <<<$raw_url); + -e 's/?/%3F/g' <<<"$raw_url"); - echo $value + echo "$value" } ############################################################################## @@ -384,12 +384,12 @@ url_escape() { # ############################################################################## lookup_mime_type() { - local mime_type=$1 + local mime_type="$1" if [[ ${mime_type_abbreviations[$mime_type]} ]]; then - echo ${mime_type_abbreviations[$mime_type]} + echo "${mime_type_abbreviations[$mime_type]}" else - echo $1 + echo "$mime_type" fi } @@ -433,7 +433,6 @@ header_arguments_to_curl() { ############################################################################## body_parameters_to_json() { local body_json="-d '{" - local body_parameter_count=${#body_parameters[@]} local count=0 for key in "${!body_parameters[@]}"; do if [[ $((count++)) -gt 0 ]]; then @@ -484,7 +483,8 @@ build_request_path() { if [[ "$force" = false ]]; then local was_error="" for qparam in "${query_params[@]}" "${path_params[@]}"; do - local parameter_values=($(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}")) + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") # # Check if the number of provided values is not less than minimum required @@ -509,29 +509,30 @@ build_request_path() { fi # First replace all path parameters in the path + local path_regex="(.*)(\\{$pparam\\})(.*)" for pparam in "${path_params[@]}"; do - if [[ $path_template =~ (.*)(\{$pparam\})(.*) ]]; then + if [[ $path_template =~ $path_regex ]]; then path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} fi done local query_request_part="" - local query_parameter_count=${#query_params[@]} local count=0 for qparam in "${query_params[@]}"; do # Get the array of parameter values - local parameter_values=($(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}")) local parameter_value="" + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - if [[ -n "${parameter_values[@]}" ]]; then + if [[ -n "${parameter_values[*]}" ]]; then if [[ $((count++)) -gt 0 ]]; then query_request_part+="&" fi fi if [[ ${qparam} == "api_key_query" ]]; then - if [[ -n "${parameter_values[@]}" ]]; then + if [[ -n "${parameter_values[*]}" ]]; then parameter_value+="${qparam}=${parameter_values}" elif [[ -n "$MATRIX_API_KEY" ]]; then parameter_value+="${qparam}=$PETSTORE_API_KEY" @@ -597,7 +598,7 @@ build_request_path() { local vcount=0 for qvalue in "${parameter_values[@]}"; do if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="\t" + parameter_value+="\\t" fi parameter_value+="${qvalue}" done @@ -618,7 +619,7 @@ build_request_path() { path_template+="?${query_request_part}" fi - echo $path_template + echo "$path_template" } @@ -676,13 +677,13 @@ EOF echo -e "${BOLD}${WHITE}Operations (grouped by tags)${OFF}" echo "" echo -e "${BOLD}${WHITE}[anotherFake]${OFF}" -read -d '' ops <${OFF}\t\t\t\tSpecify the host URL " -echo -e " \t\t\t\t(e.g. 'https://petstore.swagger.io:80')" + echo -e " -h,--help\\t\\t\\t\\tPrint this help" + echo -e " -V,--version\\t\\t\\t\\tPrint API version" + echo -e " --about\\t\\t\\t\\tPrint the information about service" + echo -e " --host ${CYAN}${OFF}\\t\\t\\t\\tSpecify the host URL " +echo -e " \\t\\t\\t\\t(e.g. 'https://petstore.swagger.io:80')" - echo -e " --force\t\t\t\tForce command invocation in spite of missing" - echo -e " \t\t\t\trequired parameters or wrong content type" - echo -e " --dry-run\t\t\t\tPrint out the cURL command without" - echo -e " \t\t\t\texecuting it" - echo -e " -nc,--no-colors\t\t\tEnforce print without colors, otherwise autodected" - echo -e " -ac,--accept ${YELLOW}${OFF}\t\tSet the 'Accept' header in the request" - echo -e " -ct,--content-type ${YELLOW}${OFF}\tSet the 'Content-type' header in " - echo -e " \tthe request" + echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" + echo -e " \\t\\t\\t\\trequired parameters or wrong content type" + echo -e " --dry-run\\t\\t\\t\\tPrint out the cURL command without" + echo -e " \\t\\t\\t\\texecuting it" + echo -e " -nc,--no-colors\\t\\t\\tEnforce print without colors, otherwise autodected" + echo -e " -ac,--accept ${YELLOW}${OFF}\\t\\tSet the 'Accept' header in the request" + echo -e " -ct,--content-type ${YELLOW}${OFF}\\tSet the 'Content-type' header in " + echo -e " \\tthe request" echo "" } @@ -769,7 +770,7 @@ print_about() { echo -e "License: Apache 2.0" echo -e "Contact: apiteam@swagger.io" echo "" -read -d '' appdescription < $body_content_temp_file + cat - > "$body_content_temp_file" ;; *=*) # Parse operation arguments and convert them into curl # only after the operation argument if [[ "$operation" ]]; then - IFS='=' read parameter_name parameter_value <<< "$key" + IFS='=' read -r parameter_name parameter_value <<< "$key" if [[ -z "${operation_parameters[$parameter_name]+foo}" ]]; then operation_parameters[$parameter_name]=$(url_escape "${parameter_value}") else From e3ba06cabb94f7da530655750608b49b06094eab Mon Sep 17 00:00:00 2001 From: Jakob Schelbert Date: Tue, 26 Sep 2017 18:06:53 +0200 Subject: [PATCH 071/197] Fix some bugs for the R client (#6535) * * Fix bugs in api.mustache, model.mustache, mostly bracket errors or small typos * Added section about installation in README.mustace TODO: fix tests in testthat TODO: fix bug in description.mustace regarding package name * Updates to sample for R client caused by running ./bin/r-petstore.sh (or .\bin\windows\r-petstore.bat) * Add R specific files to .gitignore * [R] add additional files generated by the petstore sample. (see #6520) --- .gitignore | 3 + .../src/main/resources/r/README.mustache | 16 +- .../src/main/resources/r/api.mustache | 1 + .../src/main/resources/r/model.mustache | 6 +- samples/client/petstore/R/.gitignore | 34 +++- .../client/petstore/R/.swagger-codegen-ignore | 23 +++ .../petstore/R/.swagger-codegen/VERSION | 1 + samples/client/petstore/R/.travis.yml | 3 + samples/client/petstore/R/DESCRIPTION | 11 +- samples/client/petstore/R/NAMESPACE | 5 + samples/client/petstore/R/R/ApiResponse.r | 93 +++++++++++ samples/client/petstore/R/R/Category.r | 85 ++++++++++ samples/client/petstore/R/R/Order.r | 116 +++++++++++++ samples/client/petstore/R/R/PetApi.r | 154 ++++++++++++++++++ samples/client/petstore/R/R/StoreApi.r | 82 ++++++++++ samples/client/petstore/R/R/Tag.r | 85 ++++++++++ samples/client/petstore/R/R/User.r | 133 +++++++++++++++ samples/client/petstore/R/R/UserApi.r | 144 ++++++++++++++++ samples/client/petstore/R/R/pet.R | 107 ++++++------ samples/client/petstore/R/README.md | 34 +++- samples/client/petstore/R/git_push.sh | 52 ++++++ samples/client/petstore/R/man/Element.Rd | 28 +++- samples/client/petstore/R/man/Response.Rd | 28 +++- samples/client/petstore/R/petstore.Rproj | 5 + 24 files changed, 1189 insertions(+), 60 deletions(-) create mode 100644 samples/client/petstore/R/.swagger-codegen-ignore create mode 100644 samples/client/petstore/R/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/R/.travis.yml create mode 100644 samples/client/petstore/R/R/ApiResponse.r create mode 100644 samples/client/petstore/R/R/Category.r create mode 100644 samples/client/petstore/R/R/Order.r create mode 100644 samples/client/petstore/R/R/PetApi.r create mode 100644 samples/client/petstore/R/R/StoreApi.r create mode 100644 samples/client/petstore/R/R/Tag.r create mode 100644 samples/client/petstore/R/R/User.r create mode 100644 samples/client/petstore/R/R/UserApi.r create mode 100644 samples/client/petstore/R/git_push.sh diff --git a/.gitignore b/.gitignore index 7f6a9b4e5f0..3eb0f095343 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,6 @@ samples/client/petstore/kotlin/src/main/kotlin/test/ .stack-work .cabal-sandbox cabal.project.local + +# R +.Rproj.user diff --git a/modules/swagger-codegen/src/main/resources/r/README.mustache b/modules/swagger-codegen/src/main/resources/r/README.mustache index 0bf65d4f3ab..a79bef44805 100644 --- a/modules/swagger-codegen/src/main/resources/r/README.mustache +++ b/modules/swagger-codegen/src/main/resources/r/README.mustache @@ -18,8 +18,22 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} ## Installation +You'll need the `devtools` package in order to build the API. +Make sure you have a proper CRAN repository from which you can download packages. -TODO +### Prerequisites +Install the `devtools` package with the following command. +```R +if(!require(devtools)) { install.packages("devtools") } +``` + +### Installation of the API package +Make sure you set the working directory to where the API code is located. +Then execute +```R +library(devtools) +install(".") +``` ## Author diff --git a/modules/swagger-codegen/src/main/resources/r/api.mustache b/modules/swagger-codegen/src/main/resources/r/api.mustache index b863deee4d0..74d07116c1f 100644 --- a/modules/swagger-codegen/src/main/resources/r/api.mustache +++ b/modules/swagger-codegen/src/main/resources/r/api.mustache @@ -36,6 +36,7 @@ {{#queryParams}} "{{baseName}}" = {{paramName}}{{#hasMore}},{{/hasMore}} {{/queryParams}} + ) {{/hasQueryParams}} ) diff --git a/modules/swagger-codegen/src/main/resources/r/model.mustache b/modules/swagger-codegen/src/main/resources/r/model.mustache index dcd3fa4febf..bcdbf152b5e 100644 --- a/modules/swagger-codegen/src/main/resources/r/model.mustache +++ b/modules/swagger-codegen/src/main/resources/r/model.mustache @@ -81,14 +81,14 @@ {{classname}}Object <- jsonlite::fromJSON({{classname}}Json) {{#vars}} {{#isPrimitiveType}} - self$`{{baseName}}` <- {{classname}}Object`${{baseName}}` + self$`{{baseName}}` <- {{classname}}Object$`{{baseName}}` {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) {{datatype}}$new()$fromJSON(jsonlite::toJSON(x)) + self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) {{datatype}}$new()$fromJSON(jsonlite::toJSON(x))) {{/isListContainer}} {{^isListContainer}} - self$`{{baseName}}` <- {{datatype}}$new()$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName})) + self$`{{baseName}}` <- {{datatype}}$new()$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName}})) {{/isListContainer}} {{/isPrimitiveType}} {{/vars}} diff --git a/samples/client/petstore/R/.gitignore b/samples/client/petstore/R/.gitignore index 807ea251739..5d21150e0ca 100644 --- a/samples/client/petstore/R/.gitignore +++ b/samples/client/petstore/R/.gitignore @@ -1,3 +1,35 @@ -.Rproj.user +# ref: https://github.com/github/gitignore/blob/master/R.gitignore + +# History files .Rhistory +.Rapp.history + +# Session Data files .RData + +# Example code in package build process +*-Ex.R + +# Output files from R CMD build +/*.tar.gz + +# Output files from R CMD check +/*.Rcheck/ + +# RStudio files +.Rproj.user/ + +# produced vignettes +vignettes/*.html +vignettes/*.pdf + +# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 +.httr-oauth + +# knitr and R markdown default cache directories +/*_cache/ +/cache/ + +# Temporary files created by R markdown +*.utf8.md +*.knit.md diff --git a/samples/client/petstore/R/.swagger-codegen-ignore b/samples/client/petstore/R/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/R/.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/R/.swagger-codegen/VERSION b/samples/client/petstore/R/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/R/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/R/.travis.yml b/samples/client/petstore/R/.travis.yml new file mode 100644 index 00000000000..3f05544a724 --- /dev/null +++ b/samples/client/petstore/R/.travis.yml @@ -0,0 +1,3 @@ +# ref: https://docs.travis-ci.com/user/languages/r/ +language: r +cache: packages diff --git a/samples/client/petstore/R/DESCRIPTION b/samples/client/petstore/R/DESCRIPTION index 85732b23fd9..a4aa2089c8b 100644 --- a/samples/client/petstore/R/DESCRIPTION +++ b/samples/client/petstore/R/DESCRIPTION @@ -1,13 +1,12 @@ Package: petstore -Title: R Package Client for Petstore APIs -Version: 0.0.0.9000 -Authors@R: person("Ramkumar", "Chandrasekaran", email = "ramkumar.november@gmail.com", role = c("aut", "cre")) -Description: R Package Client for Petstore APIs. +Title: R Package Client for Swagger Petstore +Version: 1.0.0 +Authors@R: person("Swagger Codegen community", email = "apiteam@swagger.io", role = c("aut", "cre")) +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. Depends: R (>= 3.3.3) Encoding: UTF-8 -License: MIT +License: Unlicense LazyData: true Suggests: testthat Imports: jsonlite, httr, R6 RoxygenNote: 6.0.1.9000 - diff --git a/samples/client/petstore/R/NAMESPACE b/samples/client/petstore/R/NAMESPACE index 5c892f91298..dfeda0ceae8 100644 --- a/samples/client/petstore/R/NAMESPACE +++ b/samples/client/petstore/R/NAMESPACE @@ -1,6 +1,11 @@ # Generated by roxygen2: do not edit by hand +export(ApiResponse) +export(Category) export(Element) +export(Order) export(Pet) export(PetStoreClient) export(Response) +export(Tag) +export(User) diff --git a/samples/client/petstore/R/R/ApiResponse.r b/samples/client/petstore/R/R/ApiResponse.r new file mode 100644 index 00000000000..79789288baf --- /dev/null +++ b/samples/client/petstore/R/R/ApiResponse.r @@ -0,0 +1,93 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + +#' ApiResponse Class +#' @export +ApiResponse <- R6::R6Class( + 'ApiResponse', + public = list( + `code` = NULL, + `type` = NULL, + `message` = NULL, + initialize = function(`code`, `type`, `message`){ + if (!missing(`code`)) { + stopifnot(is.numeric(`code`), length(`code`) == 1) + self$`code` <- `code` + } + if (!missing(`type`)) { + stopifnot(is.character(`type`), length(`type`) == 1) + self$`type` <- `type` + } + if (!missing(`message`)) { + stopifnot(is.character(`message`), length(`message`) == 1) + self$`message` <- `message` + } + }, + toJSON = function() { + sprintf( + '{ + "code": "%s", + "type": "%s", + "message": "%s" + }', + self$`code`, + self$`type`, + self$`message` + ) + }, + fromJSON = function(ApiResponseJson) { + ApiResponseObject <- jsonlite::fromJSON(ApiResponseJson) + self$`code` <- ApiResponseObject$`code` + self$`type` <- ApiResponseObject$`type` + self$`message` <- ApiResponseObject$`message` + } + ) +) + +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) + +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) diff --git a/samples/client/petstore/R/R/Category.r b/samples/client/petstore/R/R/Category.r new file mode 100644 index 00000000000..5ae5581ef23 --- /dev/null +++ b/samples/client/petstore/R/R/Category.r @@ -0,0 +1,85 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + +#' Category Class +#' @export +Category <- R6::R6Class( + 'Category', + public = list( + `id` = NULL, + `name` = NULL, + initialize = function(`id`, `name`){ + if (!missing(`id`)) { + stopifnot(is.numeric(`id`), length(`id`) == 1) + self$`id` <- `id` + } + if (!missing(`name`)) { + stopifnot(is.character(`name`), length(`name`) == 1) + self$`name` <- `name` + } + }, + toJSON = function() { + sprintf( + '{ + "id": %d, + "name": "%s" + }', + self$`id`, + self$`name` + ) + }, + fromJSON = function(CategoryJson) { + CategoryObject <- jsonlite::fromJSON(CategoryJson) + self$`id` <- CategoryObject$`id` + self$`name` <- CategoryObject$`name` + } + ) +) + +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) + +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) diff --git a/samples/client/petstore/R/R/Order.r b/samples/client/petstore/R/R/Order.r new file mode 100644 index 00000000000..b622b3d96ea --- /dev/null +++ b/samples/client/petstore/R/R/Order.r @@ -0,0 +1,116 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + +#' Order Class +#' @export +Order <- R6::R6Class( + 'Order', + public = list( + `id` = NULL, + `petId` = NULL, + `quantity` = NULL, + `shipDate` = NULL, + `status` = NULL, + `complete` = NULL, + initialize = function(`id`, `petId`, `quantity`, `shipDate`, `status`, `complete`){ + if (!missing(`id`)) { + stopifnot(is.numeric(`id`), length(`id`) == 1) + self$`id` <- `id` + } + if (!missing(`petId`)) { + stopifnot(is.numeric(`petId`), length(`petId`) == 1) + self$`petId` <- `petId` + } + if (!missing(`quantity`)) { + stopifnot(is.numeric(`quantity`), length(`quantity`) == 1) + self$`quantity` <- `quantity` + } + if (!missing(`shipDate`)) { + stopifnot(is.character(`shipDate`), length(`shipDate`) == 1) + self$`shipDate` <- `shipDate` + } + if (!missing(`status`)) { + stopifnot(is.character(`status`), length(`status`) == 1) + self$`status` <- `status` + } + if (!missing(`complete`)) { + self$`complete` <- `complete` + } + }, + toJSON = function() { + sprintf( + '{ + "id": %d, + "petId": %d, + "quantity": "%s", + "shipDate": "%s", + "status": "%s", + "complete": "%s" + }', + self$`id`, + self$`petId`, + self$`quantity`, + self$`shipDate`, + self$`status`, + self$`complete` + ) + }, + fromJSON = function(OrderJson) { + OrderObject <- jsonlite::fromJSON(OrderJson) + self$`id` <- OrderObject$`id` + self$`petId` <- OrderObject$`petId` + self$`quantity` <- OrderObject$`quantity` + self$`shipDate` <- OrderObject$`shipDate` + self$`status` <- OrderObject$`status` + self$`complete` <- OrderObject$`complete` + } + ) +) + +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) + +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) diff --git a/samples/client/petstore/R/R/PetApi.r b/samples/client/petstore/R/R/PetApi.r new file mode 100644 index 00000000000..7e7aa3ef6bc --- /dev/null +++ b/samples/client/petstore/R/R/PetApi.r @@ -0,0 +1,154 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + +PetApi <- R6::R6Class( + 'PetApi', + public = list( + userAgent = "Swagger-Codegen/1.0.0/r", + basePath = "http://petstore.swagger.io/v2", + initialize = function(basePath){ + if (!missing(basePath)) { + stopifnot(is.character(basePath), length(basePath) == 1) + self$basePath <- basePath + } + }, + + add_pet = function(body){ + resp <- httr::POST(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/json", "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + delete_pet = function(pet_id, api_key){ + resp <- httr::DELETE(paste0(self$basePath, pet_id), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml", "api_key" = api_key) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + find_pets_by_status = function(status){ + resp <- httr::GET(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,query = list( + "status" = status + ) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + find_pets_by_tags = function(tags){ + resp <- httr::GET(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,query = list( + "tags" = tags + ) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + get_pet_by_id = function(pet_id){ + resp <- httr::GET(paste0(self$basePath, pet_id), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + update_pet = function(body){ + resp <- httr::PUT(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/json", "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + update_pet_with_form = function(pet_id, name, status){ + resp <- httr::POST(paste0(self$basePath, pet_id), + httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/x-www-form-urlencoded", "content-type" = "application/xml") + ,body = list( + "name" = name, + "status" = status + ) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + upload_file = function(pet_id, additional_metadata, file){ + resp <- httr::POST(paste0(self$basePath, pet_id), + httr::add_headers("User-Agent" = self$userAgent, "accept" = "multipart/form-data", "content-type" = "application/json") + ,body = list( + "additionalMetadata" = additional_metadata, + "file" = httr::upload_file(file) + ) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- ApiResponse$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + } + ) +) diff --git a/samples/client/petstore/R/R/StoreApi.r b/samples/client/petstore/R/R/StoreApi.r new file mode 100644 index 00000000000..944efdf6602 --- /dev/null +++ b/samples/client/petstore/R/R/StoreApi.r @@ -0,0 +1,82 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + +StoreApi <- R6::R6Class( + 'StoreApi', + public = list( + userAgent = "Swagger-Codegen/1.0.0/r", + basePath = "http://petstore.swagger.io/v2", + initialize = function(basePath){ + if (!missing(basePath)) { + stopifnot(is.character(basePath), length(basePath) == 1) + self$basePath <- basePath + } + }, + + delete_order = function(order_id){ + resp <- httr::DELETE(paste0(self$basePath, order_id), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + get_inventory = function(){ + resp <- httr::GET(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/json") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Integer$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + get_order_by_id = function(order_id){ + resp <- httr::GET(paste0(self$basePath, order_id), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Order$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + place_order = function(body){ + resp <- httr::POST(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Order$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + } + ) +) diff --git a/samples/client/petstore/R/R/Tag.r b/samples/client/petstore/R/R/Tag.r new file mode 100644 index 00000000000..77ccd88e0f2 --- /dev/null +++ b/samples/client/petstore/R/R/Tag.r @@ -0,0 +1,85 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + +#' Tag Class +#' @export +Tag <- R6::R6Class( + 'Tag', + public = list( + `id` = NULL, + `name` = NULL, + initialize = function(`id`, `name`){ + if (!missing(`id`)) { + stopifnot(is.numeric(`id`), length(`id`) == 1) + self$`id` <- `id` + } + if (!missing(`name`)) { + stopifnot(is.character(`name`), length(`name`) == 1) + self$`name` <- `name` + } + }, + toJSON = function() { + sprintf( + '{ + "id": %d, + "name": "%s" + }', + self$`id`, + self$`name` + ) + }, + fromJSON = function(TagJson) { + TagObject <- jsonlite::fromJSON(TagJson) + self$`id` <- TagObject$`id` + self$`name` <- TagObject$`name` + } + ) +) + +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) + +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) diff --git a/samples/client/petstore/R/R/User.r b/samples/client/petstore/R/R/User.r new file mode 100644 index 00000000000..2137dcc7d81 --- /dev/null +++ b/samples/client/petstore/R/R/User.r @@ -0,0 +1,133 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + +#' User Class +#' @export +User <- R6::R6Class( + 'User', + public = list( + `id` = NULL, + `username` = NULL, + `firstName` = NULL, + `lastName` = NULL, + `email` = NULL, + `password` = NULL, + `phone` = NULL, + `userStatus` = NULL, + initialize = function(`id`, `username`, `firstName`, `lastName`, `email`, `password`, `phone`, `userStatus`){ + if (!missing(`id`)) { + stopifnot(is.numeric(`id`), length(`id`) == 1) + self$`id` <- `id` + } + if (!missing(`username`)) { + stopifnot(is.character(`username`), length(`username`) == 1) + self$`username` <- `username` + } + if (!missing(`firstName`)) { + stopifnot(is.character(`firstName`), length(`firstName`) == 1) + self$`firstName` <- `firstName` + } + if (!missing(`lastName`)) { + stopifnot(is.character(`lastName`), length(`lastName`) == 1) + self$`lastName` <- `lastName` + } + if (!missing(`email`)) { + stopifnot(is.character(`email`), length(`email`) == 1) + self$`email` <- `email` + } + if (!missing(`password`)) { + stopifnot(is.character(`password`), length(`password`) == 1) + self$`password` <- `password` + } + if (!missing(`phone`)) { + stopifnot(is.character(`phone`), length(`phone`) == 1) + self$`phone` <- `phone` + } + if (!missing(`userStatus`)) { + stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) + self$`userStatus` <- `userStatus` + } + }, + toJSON = function() { + sprintf( + '{ + "id": %d, + "username": "%s", + "firstName": "%s", + "lastName": "%s", + "email": "%s", + "password": "%s", + "phone": "%s", + "userStatus": "%s" + }', + self$`id`, + self$`username`, + self$`firstName`, + self$`lastName`, + self$`email`, + self$`password`, + self$`phone`, + self$`userStatus` + ) + }, + fromJSON = function(UserJson) { + UserObject <- jsonlite::fromJSON(UserJson) + self$`id` <- UserObject$`id` + self$`username` <- UserObject$`username` + self$`firstName` <- UserObject$`firstName` + self$`lastName` <- UserObject$`lastName` + self$`email` <- UserObject$`email` + self$`password` <- UserObject$`password` + self$`phone` <- UserObject$`phone` + self$`userStatus` <- UserObject$`userStatus` + } + ) +) + +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) + +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) diff --git a/samples/client/petstore/R/R/UserApi.r b/samples/client/petstore/R/R/UserApi.r new file mode 100644 index 00000000000..dd2686434ca --- /dev/null +++ b/samples/client/petstore/R/R/UserApi.r @@ -0,0 +1,144 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + +UserApi <- R6::R6Class( + 'UserApi', + public = list( + userAgent = "Swagger-Codegen/1.0.0/r", + basePath = "http://petstore.swagger.io/v2", + initialize = function(basePath){ + if (!missing(basePath)) { + stopifnot(is.character(basePath), length(basePath) == 1) + self$basePath <- basePath + } + }, + + create_user = function(body){ + resp <- httr::POST(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + create_users_with_array_input = function(body){ + resp <- httr::POST(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + create_users_with_list_input = function(body){ + resp <- httr::POST(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + delete_user = function(username){ + resp <- httr::DELETE(paste0(self$basePath, username), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + get_user_by_name = function(username){ + resp <- httr::GET(paste0(self$basePath, username), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- User$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + login_user = function(username, password){ + resp <- httr::GET(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,query = list( + "username" = username, + "password" = password + ) + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + result <- Character$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) + Response$new(result, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + logout_user = function(){ + resp <- httr::GET(paste0(self$basePath), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + }, + update_user = function(username, body){ + resp <- httr::PUT(paste0(self$basePath, username), + httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") + ,body = body$toJSON() + ) + + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { + # void response, no need to return anything + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + Response$new("API client error", resp) + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + Response$new("API server error", resp) + } + + } + ) +) diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index e51d8a7eb23..849a0d5c642 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -1,64 +1,79 @@ -#' Pet Class -#' +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + + #' Pet Class #' @export -Pet <- R6::R6Class( +Pet <- R6::R6Class( 'Pet', public = list( - id = NULL, - category = NULL, - name = NULL, - photoUrls = NULL, - tags = NULL, - status = NULL, - initialize = function(id,category,name,photoUrls,tags,status){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id + `id` = NULL, + `category` = NULL, + `name` = NULL, + `photoUrls` = NULL, + `tags` = NULL, + `status` = NULL, + initialize = function(`id`, `category`, `name`, `photoUrls`, `tags`, `status`){ + if (!missing(`id`)) { + stopifnot(is.numeric(`id`), length(`id`) == 1) + self$`id` <- `id` } - if (!missing(category)) { - stopifnot("Element" %in% class(category), !is.list(category)) - self$category <- category + if (!missing(`category`)) { + stopifnot(is.list(tags), length(tags) != 0) + lapply(`category`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + self$`category` <- `category` } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name + if (!missing(`name`)) { + stopifnot(is.character(`name`), length(`name`) == 1) + self$`name` <- `name` } - if (!missing(photoUrls)) { - stopifnot(is.list(photoUrls), length(photoUrls) != 0) - lapply(photoUrls, function(x) stopifnot(is.character(x))) - self$photoUrls <- photoUrls + if (!missing(`photoUrls`)) { + stopifnot(is.list(`photoUrls`), length(`photoUrls`) != 0) + lapply(`photoUrls`, function(x) stopifnot(is.character(x))) + self$`photoUrls` <- `photoUrls` } - if (!missing(tags)) { + if (!missing(`tags`)) { stopifnot(is.list(tags), length(tags) != 0) - lapply(tags, function(x) stopifnot("Element" %in% class(x), !is.list(x))) - self$tags <- tags + lapply(`tags`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + self$`tags` <- `tags` } - if (!missing(status)) { - stopifnot(is.character(status), length(status) == 1) - self$status <- status + if (!missing(`status`)) { + stopifnot(is.character(`status`), length(`status`) == 1) + self$`status` <- `status` } }, - toJson = function() { + toJSON = function() { sprintf( '{ "id": %d, - "category": { - "id": %d, - "name": "%s" - }, + "category": %s, "name": "%s", - "photoUrls": [%s], - "tags": [%s], - "status": "%s" + "photoUrls": ["%s"], + "tags": [%s], + "status": "%s" }', - self$id, - self$category$id, - self$category$name, - self$name, - lapply(self$photoUrls, function(x) paste(paste0('"', x, '"'), sep=",")), - lapply(self$tags, function(x) paste(x$toJson(), sep=",")), - self$status) + self$`id`, + self$`category`$toJSON(), + self$`name`, + lapply(self$`photoUrls`, function(x) paste(paste0('"', x, '"'), sep=",")), + lapply(self$`tags`, function(x) paste(x$toJSON(), sep=",")), + self$`status` + ) + }, + fromJSON = function(PetJson) { + PetObject <- jsonlite::fromJSON(PetJson) + self$`id` <- PetObject$`id` + self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(PetObject$category)) + self$`name` <- PetObject$`name` + self$`photoUrls` <- PetObject$`photoUrls` + self$`tags` <- lapply(PetObject$`tags`, function(x) Tag$new()$fromJSON(jsonlite::toJSON(x))) + self$`status` <- PetObject$`status` } ) ) @@ -82,7 +97,7 @@ Element <- R6::R6Class( self$name <- name } }, - toJson = function() { + toJSON = function() { sprintf('{"id":%d,"name":"%s"}', self$id, self$name) } ) @@ -102,4 +117,4 @@ Response <- R6::R6Class( self$response <- response } ) -) \ No newline at end of file +) diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index 17e1b0fed67..a1659d974a7 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -1 +1,33 @@ -https://github.com/swagger-api/swagger-codegen/issues/2231 \ No newline at end of file +# R API client for swagger + +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. + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI/Swagger spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.RClientCodegen + +## Installation +You'll need the `devtools` package in order to build the API. +Make sure you have a proper CRAN repository from which you can download packages. + +### Prerequisites +Install the `devtools` package with the following command. +```R +if(!require(devtools)) { install.packages("devtools") } +``` + +### Installation of the API package +Make sure you set the working directory to where the API code is located. +Then execute +```R +library(devtools) +install(".") +``` + +## Author + +apiteam@swagger.io + diff --git a/samples/client/petstore/R/git_push.sh b/samples/client/petstore/R/git_push.sh new file mode 100644 index 00000000000..ed374619b13 --- /dev/null +++ b/samples/client/petstore/R/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/R/man/Element.Rd b/samples/client/petstore/R/man/Element.Rd index 38dcd7b4070..636ac170d50 100644 --- a/samples/client/petstore/R/man/Element.Rd +++ b/samples/client/petstore/R/man/Element.Rd @@ -1,14 +1,40 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pet.R +% Please edit documentation in R/ApiResponse.r, R/Category.r, R/Order.r, +% R/Tag.r, R/User.r, R/pet.R \docType{data} \name{Element} \alias{Element} +\alias{Element} +\alias{Element} +\alias{Element} +\alias{Element} +\alias{Element} \title{Element Class} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ +Element + +Element + +Element + +Element + +Element + Element } \description{ +Element Class + +Element Class + +Element Class + +Element Class + +Element Class + Element Class } \keyword{datasets} diff --git a/samples/client/petstore/R/man/Response.Rd b/samples/client/petstore/R/man/Response.Rd index c9fb6beddef..334e5cadd6b 100644 --- a/samples/client/petstore/R/man/Response.Rd +++ b/samples/client/petstore/R/man/Response.Rd @@ -1,14 +1,40 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pet.R +% Please edit documentation in R/ApiResponse.r, R/Category.r, R/Order.r, +% R/Tag.r, R/User.r, R/pet.R \docType{data} \name{Response} \alias{Response} +\alias{Response} +\alias{Response} +\alias{Response} +\alias{Response} +\alias{Response} \title{Response Class} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ +Response + +Response + +Response + +Response + +Response + Response } \description{ +Response Class + +Response Class + +Response Class + +Response Class + +Response Class + Response Class } \keyword{datasets} diff --git a/samples/client/petstore/R/petstore.Rproj b/samples/client/petstore/R/petstore.Rproj index d848a9ff573..bfa3107e042 100644 --- a/samples/client/petstore/R/petstore.Rproj +++ b/samples/client/petstore/R/petstore.Rproj @@ -5,8 +5,13 @@ SaveWorkspace: No AlwaysSaveHistory: Default EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 4 Encoding: UTF-8 +RnwWeave: Sweave +LaTeX: pdfLaTeX + AutoAppendNewline: Yes StripTrailingWhitespace: Yes From 2a284fa1aa3e5bdf3f1fac68d4a3a8890731579e Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 27 Sep 2017 10:41:38 +0800 Subject: [PATCH 072/197] add SAP blog post by Radu Simen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a02469a9f1..7b3fe6be542 100644 --- a/README.md +++ b/README.md @@ -892,7 +892,7 @@ Presentations/Videos/Tutorials/Books - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from Shine Solutions @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - +- 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) # Swagger Codegen Core Team From 2917829eb0b3ed57b13f2d6334c5c6b72c8a5183 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 27 Sep 2017 10:44:16 +0800 Subject: [PATCH 073/197] add links to https://shinesolutions.com/ --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7b3fe6be542..d1700ecd9b2 100644 --- a/README.md +++ b/README.md @@ -869,7 +869,7 @@ Presentations/Videos/Tutorials/Books - 2016/10/10 - [Using swagger-codegen with Marketo](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) by [Kenny Elkington](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) - 2016/10/12 - [Designing a Swagger API](https://sookocheff.com/post/api/swagger/) by [Kevin Sookocheff](https://sookocheff.com/) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 -- 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from Shine Solutions @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) +- 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from [Shine Solutions](https://shinesolutions.com/) @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2016/12/08 - [Generate client side code using Swagger Codegen](https://carra-lucia-ltd.co.uk/2016/12/08/generate-client-side-code-using-swagger-codegen/) by [theFerkel](https://carra-lucia-ltd.co.uk/author/theferkel/) @@ -889,7 +889,7 @@ Presentations/Videos/Tutorials/Books - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) -- 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from Shine Solutions @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) +- 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) From 28a3206d163e3c87399f63f659190b64dd99dd7b Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 27 Sep 2017 11:52:44 +0800 Subject: [PATCH 074/197] update swift link, add kotlin, powershell --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67dabb029b7..491b56b5808 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,16 +47,18 @@ Code change should conform to the programming style guide of the respective lang - Haskell: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md - Java: https://google.github.io/styleguide/javaguide.html - JavaScript: https://github.com/airbnb/javascript/ +- Kotlin: https://kotlinlang.org/docs/reference/coding-conventions.html - Groovy: http://groovy-lang.org/style-guide.html - Go: https://github.com/golang/go/wiki/CodeReviewComments - ObjC: https://github.com/NYTimes/objective-c-style-guide - Perl: http://perldoc.perl.org/perlstyle.html - PHP: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md +- PowerShell: https://msdn.microsoft.com/en-us/library/dd878270(v=vs.85).aspx - Python: https://www.python.org/dev/peps/pep-0008/ - R: https://google.github.io/styleguide/Rguide.xml - Ruby: https://github.com/bbatsov/ruby-style-guide - Scala: http://docs.scala-lang.org/style/ -- Swift: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html +- Swift: [Apple Developer](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html) - TypeScript: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines For other languages, feel free to suggest. From 3ac2b803f972d3919f1b8d04e0b32ef20613b15d Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 27 Sep 2017 20:53:27 +0800 Subject: [PATCH 075/197] [Elixir] Add Elixir Petstore sample to Shippable CI (#6575) * add elixir petstore to shippable ci * use oracle sdk --- .gitignore | 5 + pom.xml.shippable | 931 ++++++++++++++++++ .../petstore/elixir/.swagger-codegen/VERSION | 2 +- .../lib/swagger_petstore/api/anotherFake.ex | 29 + .../elixir/lib/swagger_petstore/api/fake.ex | 17 + .../api/fakeClassnameTags123.ex | 29 + samples/client/petstore/elixir/pom.xml | 62 ++ shippable.yml | 14 +- 8 files changed, 1085 insertions(+), 4 deletions(-) create mode 100644 pom.xml.shippable create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex create mode 100644 samples/client/petstore/elixir/pom.xml diff --git a/.gitignore b/.gitignore index 3eb0f095343..cce9df3dcfd 100644 --- a/.gitignore +++ b/.gitignore @@ -177,3 +177,8 @@ cabal.project.local # R .Rproj.user + +# elixir +samples/client/petstore/elixir/_build/ +samples/client/petstore/elixir/deps/ +samples/client/petstore/elixir/mix.lock diff --git a/pom.xml.shippable b/pom.xml.shippable new file mode 100644 index 00000000000..7f04b3262e7 --- /dev/null +++ b/pom.xml.shippable @@ -0,0 +1,931 @@ + + + org.sonatype.oss + oss-parent + 5 + + 4.0.0 + io.swagger + swagger-codegen-project + pom + swagger-codegen-project + 2.3.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 + + + + 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-checkstyle-plugin + 2.17 + + + validate + validate + + google_checkstyle.xml + + ${project.build.sourceDirectory} + UTF-8 + true + true + false + + + check + + + + + + com.puppycrawl.tools + checkstyle + 6.19 + + + + + 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 + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.4.1 + + + enforce-versions + + enforce + + + + + 3.2.5 + + + + + + + + + + + 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 + + + + haskell-http-client + + + env + haskell-http-client + + + + samples/client/petstore/haskell-http-client + + + + haskell-http-client-integration-test + + + env + haskell-http-client + + + + samples/client/petstore/haskell-http-client/tests-integration + + + + 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-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-angular-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-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/elixir + + + + + 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.32 + 2.11.1 + 3.3.0 + 1.5.16 + 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/client/petstore/elixir/.swagger-codegen/VERSION b/samples/client/petstore/elixir/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/elixir/.swagger-codegen/VERSION +++ b/samples/client/petstore/elixir/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex new file mode 100644 index 00000000000..2a16a710eac --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex @@ -0,0 +1,29 @@ +defmodule SwaggerPetstore.Api.AnotherFake do + @moduledoc """ + Documentation for SwaggerPetstore.Api.AnotherFake. + """ + + use Tesla + + plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" + plug Tesla.Middleware.JSON + + @doc """ + To test special tags + + To test special tags + """ + def test_special_tags(body) do + method = [method: :patch] + url = [url: "/another-fake/dummy"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end +end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index 9537680a4a5..ae5e577003a 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -140,4 +140,21 @@ defmodule SwaggerPetstore.Api.Fake do request(options) end + + @doc """ + test json serialization of form data + """ + def test_json_form_data(param, param2) do + method = [method: :get] + url = [url: "/fake/jsonFormData"] + query_params = [] + header_params = [] + body_params = [] + form_params = [body: Enum.map_join([{:"param", param}, {:"param2", param2}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex new file mode 100644 index 00000000000..cc0c2be0835 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex @@ -0,0 +1,29 @@ +defmodule SwaggerPetstore.Api.FakeClassnameTags123 do + @moduledoc """ + Documentation for SwaggerPetstore.Api.FakeClassnameTags123. + """ + + use Tesla + + plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" + plug Tesla.Middleware.JSON + + @doc """ + To test class name in snake case + + + """ + def test_classname(body) do + method = [method: :patch] + url = [url: "/fake_classname_test"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end +end diff --git a/samples/client/petstore/elixir/pom.xml b/samples/client/petstore/elixir/pom.xml new file mode 100644 index 00000000000..8ea376a48db --- /dev/null +++ b/samples/client/petstore/elixir/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + io.swagger + ElixirPetstoreClientTests + pom + 1.0-SNAPSHOT + Elixir Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + dep-install + pre-integration-test + + exec + + + mix + + local.hex + --force + + + + + compile + integration-test + + exec + + + mix + + do + deps.get, + compile + + + + + + + + diff --git a/shippable.yml b/shippable.yml index 166bad9c3ae..6d6bb697c39 100644 --- a/shippable.yml +++ b/shippable.yml @@ -1,15 +1,23 @@ language: java jdk: -- oraclejdk8 -# no need to test jdk7 as smoke test is already covered by travis-ci -#- openjdk7 +- oraclejdk8 build: cache: true cache_dir_list: - $HOME/.m2 ci: + # install elixir + - wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb + - sudo apt-get update + - sudo apt-get install esl-erlang + - sudo apt-get install elixir + - elixir --version + - mix --version + # test samples defined in pom.xml + - cp pom.xml.shippable pom.xml + - mvn verify -P samples # generate all petstore sampless (client, servers, doc) - ./bin/run-all-petstore 2>&1 > run-all-petstore.log post_ci: From 4b9ee1f1940dba349d49dfb499b813f4cbb5858c Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 27 Sep 2017 18:32:17 -0700 Subject: [PATCH 076/197] [Elixir] Improve Elixir client (#6550) * Fix dependencies and generate model classes * Better elixir client generation. Responses are parsed and serialized by Poison into the model structs. Use shared helper functions to generate the request. Extract client connection configuration from api calls. Elixir client can sanitize the operationId Correctly output the model variables. Fix typos Fix path replacement when there are multiple replacements Cannot separate globally shared parameters from operations Error handling for the tesla response update templates Can generate clients that compile Can make requests - parse optional params, build query Add oauth to connection. Fix connection directory Add basic auth helper for creating a connection Fix map types. Fix guard clauses for creaing connections Add licenceInfo template. Parse config for moduleName via standard invokerPackage option Can provide and inject a license header into all source files fix location of connection.ex Move shared code into reusable modules Elixir filenames should be underscored Fix visibility of helper functions Parse the packageName from config options Handle date and datetime fields with DateTime.from_iso8601 Fix indentation Update documentation, add typespecs Generate a standard elixir .gitignore typespec is calculated recursively in java Use the JSON middleware and using Poison.Decoder.decode on already parsed structs move decoded struct into java Fix handling of non-json responses Switch basic auth to use the provided Tesla.Middleware.BasicAuth Update README template to include the appDescription Update sample elixir client remove junk client models that don't belong with petstore Only implement Poison.Decoder protocol if needed Update samples with skipped Poison.Deocder impl * Handle multipart file uploads Handle building form params in the body Files are handled as strings for input * Requests with no defined return type will return the Tesla.Env response * Run the bin/elixir-petstore.sh --- .../languages/ElixirClientCodegen.java | 337 +++++++++++++++++- .../main/resources/elixir/README.md.mustache | 10 +- .../src/main/resources/elixir/api.mustache | 68 ++-- .../resources/elixir/connection.ex.mustache | 92 +++++ .../resources/elixir/deserializer.ex.mustache | 31 ++ .../main/resources/elixir/gitignore.mustache | 20 ++ .../resources/elixir/licenseInfo.mustache | 6 + .../main/resources/elixir/mix.exs.mustache | 4 +- .../src/main/resources/elixir/model.mustache | 32 ++ .../elixir/request_builder.ex.mustache | 127 +++++++ .../elixir/ElixirClientOptionsTest.java | 3 + .../options/ElixirClientOptionsProvider.java | 4 + samples/client/petstore/elixir/.gitignore | 20 ++ samples/client/petstore/elixir/README.md | 2 +- .../lib/swagger_petstore/api/another_fake.ex | 39 ++ .../elixir/lib/swagger_petstore/api/fake.ex | 330 ++++++++++++----- .../api/fake_classname_tags123.ex | 46 ++- .../elixir/lib/swagger_petstore/api/pet.ex | 290 +++++++++------ .../elixir/lib/swagger_petstore/api/store.ex | 139 +++++--- .../elixir/lib/swagger_petstore/api/user.ex | 274 ++++++++------ .../elixir/lib/swagger_petstore/connection.ex | 86 +++++ .../lib/swagger_petstore/deserializer.ex | 34 ++ .../model/$special[model.name].ex | 0 .../swagger_petstore/model/200_response.ex | 22 ++ .../model/__special[model/name].ex | 21 ++ .../model/additionalPropertiesClass.ex | 0 .../model/additional_properties_class.ex | 22 ++ .../lib/swagger_petstore/model/animal.ex | 22 ++ .../lib/swagger_petstore/model/animalFarm.ex | 0 .../lib/swagger_petstore/model/animal_farm.ex | 21 ++ .../lib/swagger_petstore/model/apiResponse.ex | 0 .../swagger_petstore/model/api_response.ex | 23 ++ .../model/arrayOfArrayOfNumberOnly.ex | 0 .../model/arrayOfNumberOnly.ex | 0 .../lib/swagger_petstore/model/arrayTest.ex | 0 .../model/array_of_array_of_number_only.ex | 21 ++ .../model/array_of_number_only.ex | 21 ++ .../lib/swagger_petstore/model/array_test.ex | 23 ++ .../swagger_petstore/model/capitalization.ex | 26 ++ .../elixir/lib/swagger_petstore/model/cat.ex | 23 ++ .../lib/swagger_petstore/model/category.ex | 22 ++ .../lib/swagger_petstore/model/classModel.ex | 0 .../lib/swagger_petstore/model/class_model.ex | 21 ++ .../lib/swagger_petstore/model/client.ex | 21 ++ .../elixir/lib/swagger_petstore/model/dog.ex | 23 ++ .../lib/swagger_petstore/model/enumArrays.ex | 0 .../lib/swagger_petstore/model/enumClass.ex | 0 .../lib/swagger_petstore/model/enum_Test.ex | 0 .../lib/swagger_petstore/model/enum_arrays.ex | 22 ++ .../lib/swagger_petstore/model/enum_class.ex | 21 ++ .../lib/swagger_petstore/model/enum_test.ex | 26 ++ .../lib/swagger_petstore/model/format_test.ex | 35 ++ .../swagger_petstore/model/hasOnlyReadOnly.ex | 0 .../model/has_only_read_only.ex | 22 ++ .../lib/swagger_petstore/model/mapTest.ex | 0 .../lib/swagger_petstore/model/map_test.ex | 22 ++ ...dPropertiesAndAdditionalPropertiesClass.ex | 0 ...perties_and_additional_properties_class.ex | 25 ++ .../elixir/lib/swagger_petstore/model/name.ex | 24 ++ .../lib/swagger_petstore/model/numberOnly.ex | 0 .../lib/swagger_petstore/model/number_only.ex | 21 ++ .../lib/swagger_petstore/model/order.ex | 26 ++ .../swagger_petstore/model/outerBoolean.ex | 0 .../swagger_petstore/model/outerComposite.ex | 0 .../lib/swagger_petstore/model/outerEnum.ex | 0 .../lib/swagger_petstore/model/outerNumber.ex | 0 .../lib/swagger_petstore/model/outerString.ex | 0 .../swagger_petstore/model/outer_boolean.ex | 21 ++ .../swagger_petstore/model/outer_composite.ex | 27 ++ .../lib/swagger_petstore/model/outer_enum.ex | 21 ++ .../swagger_petstore/model/outer_number.ex | 21 ++ .../swagger_petstore/model/outer_string.ex | 21 ++ .../elixir/lib/swagger_petstore/model/pet.ex | 29 ++ .../swagger_petstore/model/readOnlyFirst.ex | 0 .../swagger_petstore/model/read_only_first.ex | 22 ++ .../lib/swagger_petstore/model/return.ex | 21 ++ .../elixir/lib/swagger_petstore/model/tag.ex | 22 ++ .../elixir/lib/swagger_petstore/model/user.ex | 28 ++ .../lib/swagger_petstore/request_builder.ex | 130 +++++++ samples/client/petstore/elixir/mix.exs | 2 +- 80 files changed, 2514 insertions(+), 421 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/elixir/connection.ex.mustache create mode 100644 modules/swagger-codegen/src/main/resources/elixir/deserializer.ex.mustache create mode 100644 modules/swagger-codegen/src/main/resources/elixir/gitignore.mustache create mode 100644 modules/swagger-codegen/src/main/resources/elixir/licenseInfo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/elixir/request_builder.ex.mustache create mode 100644 samples/client/petstore/elixir/.gitignore create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/api/another_fake.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/connection.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/deserializer.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/$special[model.name].ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/additionalPropertiesClass.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/animalFarm.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/apiResponse.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfArrayOfNumberOnly.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfNumberOnly.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/arrayTest.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/classModel.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enumArrays.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enumClass.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enum_Test.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/hasOnlyReadOnly.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/mapTest.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/mixedPropertiesAndAdditionalPropertiesClass.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/numberOnly.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outerBoolean.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outerComposite.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outerEnum.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outerNumber.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outerString.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/readOnlyFirst.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex create mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/request_builder.ex diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java index 21a237dd1b6..c62cf74cd04 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java @@ -6,6 +6,10 @@ import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; +import io.swagger.models.Info; +import io.swagger.models.Model; +import io.swagger.models.Swagger; +import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.io.Writer; @@ -14,14 +18,17 @@ import java.util.regex.Pattern; public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig { - // source folder where to write the files - protected String sourceFolder = "lib"; protected String apiVersion = "1.0.0"; + protected String moduleName; + protected static final String defaultModuleName = "Swagger.Client"; + + // This is the name of elixir project name; + protected static final String defaultPackageName = "swagger_client"; String supportedElixirVersion = "1.4"; List extraApplications = Arrays.asList(":logger"); List deps = Arrays.asList( - "{:tesla, \"~> 0.5.0\"}", + "{:tesla, \"~> 0.8\"}", "{:poison, \">= 1.0.0\"}" ); @@ -32,7 +39,7 @@ public ElixirClientCodegen() { // set the output folder here outputFolder = "generated-code/elixir"; - /** + /* * Models. You can write model files using the modelTemplateFiles map. * if you want to create one template for file, you can do so here. * for multiple files for model, just put another entry in the `modelTemplateFiles` with @@ -62,8 +69,14 @@ public ElixirClientCodegen() { */ reservedWords = new HashSet( Arrays.asList( - "sample1", // replace with static values - "sample2") + "nil", + "true", + "false", + "__MODULE__", + "__FILE__", + "__DIR__", + "__ENV__", + "__CALLER__") ); /** @@ -93,6 +106,10 @@ public ElixirClientCodegen() { "test", "test_helper.exs") ); + supportingFiles.add(new SupportingFile("gitignore.mustache", + "", + ".gitignore") + ); /** * Language Specific Primitives. These types will not trigger imports by @@ -100,9 +117,43 @@ public ElixirClientCodegen() { */ languageSpecificPrimitives = new HashSet( Arrays.asList( - "Type1", // replace these with your types - "Type2") + "Integer", + "Float", + "Boolean", + "String", + "List", + "Atom", + "Map", + "Tuple", + "PID", + "DateTime" + ) ); + + // ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types + typeMapping = new HashMap(); + typeMapping.put("integer", "Integer"); + typeMapping.put("long", "Integer"); + typeMapping.put("number", "Float"); + typeMapping.put("float", "Float"); + typeMapping.put("double", "Float"); + typeMapping.put("string", "String"); + typeMapping.put("byte", "Integer"); + typeMapping.put("boolean", "Boolean"); + typeMapping.put("Date", "DateTime"); + typeMapping.put("DateTime", "DateTime"); + typeMapping.put("file", "String"); + typeMapping.put("map", "Map"); + typeMapping.put("array", "List"); + typeMapping.put("list", "List"); + // typeMapping.put("object", "Map"); + typeMapping.put("binary", "String"); + typeMapping.put("ByteArray", "String"); + typeMapping.put("UUID", "String"); + + cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay.Pets")); + cliOptions.add(new CliOption("licenseHeader", "The license header to prepend to the top of all source files.")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Elixir package name (convention: lowercase).")); } /** @@ -153,6 +204,41 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio writer.write(modulized(fragment.execute())); } }); + + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { + setModuleName((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); + } + } + + @Override + public void preprocessSwagger(Swagger swagger) { + Info info = swagger.getInfo(); + if (moduleName == null) { + if (info.getTitle() != null) { + // default to the appName (from title field) + setModuleName(modulized(escapeText(info.getTitle()))); + } else { + setModuleName(defaultModuleName); + } + } + additionalProperties.put("moduleName", moduleName); + + if (!additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + additionalProperties.put(CodegenConstants.PACKAGE_NAME, underscored(moduleName)); + } + + supportingFiles.add(new SupportingFile("connection.ex.mustache", + sourceFolder(), + "connection.ex")); + + supportingFiles.add(new SupportingFile("request_builder.ex.mustache", + sourceFolder(), + "request_builder.ex")); + + + supportingFiles.add(new SupportingFile("deserializer.ex.mustache", + sourceFolder(), + "deserializer.ex")); } @Override @@ -160,14 +246,14 @@ public Map postProcessOperations(Map objs) { Map operations = (Map) super.postProcessOperations(objs).get("operations"); List os = (List) operations.get("operation"); List newOs = new ArrayList(); - Pattern pattern = Pattern.compile("(.*)\\{([^\\}]+)\\}(.*)"); + Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}([^\\{]*)"); for (CodegenOperation o : os) { ArrayList pathTemplateNames = new ArrayList(); Matcher matcher = pattern.matcher(o.path); StringBuffer buffer = new StringBuffer(); while (matcher.find()) { - String pathTemplateName = matcher.group(2); - matcher.appendReplacement(buffer, "$1" + "#{" + underscore(pathTemplateName) + "}" + "$3"); + String pathTemplateName = matcher.group(1); + matcher.appendReplacement(buffer, "#{" + underscore(pathTemplateName) + "}" + "$2"); pathTemplateNames.add(pathTemplateName); } ExtendedCodegenOperation eco = new ExtendedCodegenOperation(o); @@ -177,12 +263,29 @@ public Map postProcessOperations(Map objs) { eco.setReplacedPathName(buffer.toString()); } eco.setPathTemplateNames(pathTemplateNames); + + // detect multipart form types + if (eco.hasConsumes == Boolean.TRUE) { + Map firstType = eco.consumes.get(0); + if (firstType != null) { + if ("multipart/form-data".equals(firstType.get("mediaType"))) { + eco.isMultipart = Boolean.TRUE; + } + } + } + newOs.add(eco); } operations.put("operation", newOs); return objs; } + @Override + public CodegenModel fromModel(String name, Model model, Map allDefinitions) { + CodegenModel cm = super.fromModel(name, model, allDefinitions); + return new ExtendedCodegenModel(cm); + } + // We should use String.join if we can use Java8 String join(CharSequence charSequence, Iterable iterable) { StringBuilder buf = new StringBuilder(); @@ -222,12 +325,20 @@ public String escapeReservedWord(String name) { return "_" + name; // add an underscore to the name } + private String sourceFolder() { + ArrayList underscoredWords = new ArrayList(); + for (String word : moduleName.split("\\.")) { + underscoredWords.add(underscore(word)); + } + return "lib/" + join("/", underscoredWords); + } + /** * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated */ public String modelFileFolder() { - return outputFolder + "/" + sourceFolder + "/" + underscored((String) additionalProperties.get("appName")) + "/" + "model"; + return outputFolder + "/" + sourceFolder() + "/" + "model"; } /** @@ -236,7 +347,7 @@ public String modelFileFolder() { */ @Override public String apiFileFolder() { - return outputFolder + "/" + sourceFolder + "/" + underscored((String) additionalProperties.get("appName")) + "/" + "api"; + return outputFolder + "/" + sourceFolder() + "/" + "api"; } @Override @@ -249,12 +360,22 @@ public String toApiName(String name) { @Override public String toApiFilename(String name) { - return snakeCase(name); + return underscore(name); } @Override public String toModelFilename(String name) { - return snakeCase(name); + return underscore(name); + } + + @Override + public String toOperationId(String operationId) { + // throw exception if method name is empty (should not occur as an auto-generated method name will be used) + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + + return camelize(sanitizeName(operationId)); } /** @@ -374,6 +495,188 @@ public String getReplacedPathName() { public void setReplacedPathName(String replacedPathName) { this.replacedPathName = replacedPathName; } + + public String typespec() { + StringBuilder sb = new StringBuilder("@spec "); + sb.append(underscore(operationId)); + sb.append("(Tesla.Env.client, "); + + for (CodegenParameter param : allParams) { + if (param.required) { + buildTypespec(param, sb); + sb.append(", "); + } + } + + sb.append("keyword()) :: {:ok, "); + if (returnBaseType == null) { + sb.append("nil"); + } else if (returnSimpleType) { + if (!returnTypeIsPrimitive) { + sb.append(moduleName); + sb.append(".Model."); + } + sb.append(returnBaseType); + sb.append(".t"); + } else if (returnContainer == null) { + sb.append(returnBaseType); + sb.append(".t"); + } else { + if (returnContainer.equals("array")) { + sb.append("list("); + if (!returnTypeIsPrimitive) { + sb.append(moduleName); + sb.append(".Model."); + } + sb.append(returnBaseType); + sb.append(".t)"); + } else if (returnContainer.equals("map")) { + sb.append("map()"); + } + } + sb.append("} | {:error, Tesla.Env.t}"); + return sb.toString(); + } + + private void buildTypespec(CodegenParameter param, StringBuilder sb) { + if (param.dataType == null) { + sb.append("nil"); + } else if (param.isListContainer) { + // list() + sb.append("list("); + if (param.isBodyParam) { + buildTypespec(param.items.items, sb); + } else { + buildTypespec(param.items, sb); + } + sb.append(")"); + } else if (param.isMapContainer) { + // %{optional(String.t) => } + sb.append("%{optional(String.t) => "); + buildTypespec(param.items, sb); + sb.append("}"); + } else if (param.isPrimitiveType) { + // .t + sb.append(param.dataType); + sb.append(".t"); + } else if (param.isFile) { + sb.append("String.t"); + } else { + // .Model..t + sb.append(moduleName); + sb.append(".Model."); + sb.append(param.dataType); + sb.append(".t"); + } + } + private void buildTypespec(CodegenProperty property, StringBuilder sb) { + if (property.isListContainer) { + sb.append("list("); + buildTypespec(property.items, sb); + sb.append(")"); + } else if (property.isMapContainer) { + sb.append("%{optional(String.t) => "); + buildTypespec(property.items, sb); + sb.append("}"); + } else if (property.isPrimitiveType) { + sb.append(property.baseType); + sb.append(".t"); + } else { + sb.append(moduleName); + sb.append(".Model."); + sb.append(property.baseType); + sb.append(".t"); + } + } + + public String decodedStruct() { + // Let Poison decode the entire response into a generic blob + if (isMapContainer) { + return ""; + } + // Primitive return type, don't even try to decode + if (returnBaseType == null || (returnSimpleType && returnTypeIsPrimitive)) { + return "false"; + } + StringBuilder sb = new StringBuilder(); + if (isListContainer) { + sb.append("["); + } + sb.append("%"); + sb.append(moduleName); + sb.append(".Model."); + sb.append(returnBaseType); + sb.append("{}"); + if (isListContainer) { + sb.append("]"); + } + return sb.toString(); + } + } + + class ExtendedCodegenModel extends CodegenModel { + public boolean hasImports; + public ExtendedCodegenModel(CodegenModel cm) { + super(); + + // Copy all fields of CodegenModel + this.parent = cm.parent; + this.parentSchema = cm.parentSchema; + this.parentModel = cm.parentModel; + this.interfaceModels = cm.interfaceModels; + this.children = cm.children; + this.name = cm.name; + this.classname = cm.classname; + this.title = cm.title; + this.description = cm.description; + this.classVarName = cm.classVarName; + this.modelJson = cm.modelJson; + this.dataType = cm.dataType; + this.xmlPrefix = cm.xmlPrefix; + this.xmlNamespace = cm.xmlNamespace; + this.xmlName = cm.xmlName; + this.classFilename = cm.classFilename; + this.unescapedDescription = cm.unescapedDescription; + this.discriminator = cm.discriminator; + this.defaultValue = cm.defaultValue; + this.arrayModelType = cm.arrayModelType; + this.isAlias = cm.isAlias; + this.vars = cm.vars; + this.requiredVars = cm.requiredVars; + this.optionalVars = cm.optionalVars; + this.readOnlyVars = cm.readOnlyVars; + this.readWriteVars = cm.readWriteVars; + this.allVars = cm.allVars; + this.parentVars = cm.parentVars; + this.allowableValues = cm.allowableValues; + this.mandatory = cm.mandatory; + this.allMandatory = cm.allMandatory; + this.imports = cm.imports; + this.hasVars = cm.hasVars; + this.emptyVars = cm.emptyVars; + this.hasMoreModels = cm.hasMoreModels; + this.hasEnums = cm.hasEnums; + this.isEnum = cm.isEnum; + this.hasRequired = cm.hasRequired; + this.hasOptional = cm.hasOptional; + this.isArrayModel = cm.isArrayModel; + this.hasChildren = cm.hasChildren; + this.hasOnlyReadOnly = cm.hasOnlyReadOnly; + this.externalDocs = cm.externalDocs; + this.vendorExtensions = cm.vendorExtensions; + this.additionalPropertiesType = cm.additionalPropertiesType; + + this.hasImports = !this.imports.isEmpty(); + } + + public boolean hasComplexVars() { + for (CodegenProperty p : vars) { + if (!p.isPrimitiveType) { + return true; + } + } + return false; + } } @Override @@ -386,4 +689,8 @@ public String escapeUnsafeCharacters(String input) { // no need to escape as Elixir does not support multi-line comments return input; } + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } } diff --git a/modules/swagger-codegen/src/main/resources/elixir/README.md.mustache b/modules/swagger-codegen/src/main/resources/elixir/README.md.mustache index 65c56e0ca61..fbf6231983a 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/README.md.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/README.md.mustache @@ -1,18 +1,18 @@ -# {{#modulized}}{{appName}}{{/modulized}} +# {{moduleName}} -**TODO: Add description** +{{appDescription}} ## Installation If [available in Hex](https://hex.pm/docs/publish), the package can be installed -by adding `{{#underscored}}{{appName}}{{/underscored}}` to your list of dependencies in `mix.exs`: +by adding `{{#underscored}}{{packageName}}{{/underscored}}` to your list of dependencies in `mix.exs`: ```elixir def deps do - [{:{{#underscored}}{{appName}}{{/underscored}}, "~> 0.1.0"}] + [{:{{#underscored}}{{packageName}}{{/underscored}}, "~> 0.1.0"}] end ``` Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at [https://hexdocs.pm/{{#underscored}}{{appName}}{{/underscored}}](https://hexdocs.pm/{{#underscored}}{{appName}}{{/underscored}}). +be found at [https://hexdocs.pm/{{#underscored}}{{packageName}}{{/underscored}}](https://hexdocs.pm/{{#underscored}}{{packageName}}{{/underscored}}). diff --git a/modules/swagger-codegen/src/main/resources/elixir/api.mustache b/modules/swagger-codegen/src/main/resources/elixir/api.mustache index 799a4c31c08..ece4d62da9a 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/api.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/api.mustache @@ -1,35 +1,59 @@ -defmodule {{#modulized}}{{appName}}{{/modulized}}.Api.{{classname}} do +{{>licenseInfo}} +defmodule {{moduleName}}.Api.{{classname}} do @moduledoc """ - Documentation for {{#modulized}}{{appName}}{{/modulized}}.Api.{{classname}}. + API calls for all endpoints tagged `{{baseName}}`. """ - use Tesla + alias {{moduleName}}.Connection + import {{moduleName}}.RequestBuilder - plug Tesla.Middleware.BaseUrl, "{{{basePath}}}" - plug Tesla.Middleware.JSON {{#operations}} - {{#operation}} + {{#operation}} @doc """ + {{#summary}} {{summary}} - {{^notes.isEmpty}} - + {{/summary}} + {{#notes}} {{notes}} - {{/notes.isEmpty}} - """ - def {{#underscored}}{{operationId}}{{/underscored}}({{#allParams}}{{^-first}}, {{/-first}}{{#underscored}}{{paramName}}{{/underscored}}{{/allParams}}) do - method = [method: :{{#underscored}}{{httpMethod}}{{/underscored}}] - url = [url: "{{replacedPathName}}"] - query_params = [{{^queryParams.isEmpty}}query: [{{#queryParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/queryParams}}]{{/queryParams.isEmpty}}] - header_params = [{{^headerParams.isEmpty}}header: [{{#headerParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/headerParams}}]{{/headerParams.isEmpty}}] - body_params = [{{^bodyParams.isEmpty}}body: {{#bodyParams}}{{#underscored}}{{paramName}}{{/underscored}}{{/bodyParams}}{{/bodyParams.isEmpty}}] - form_params = [{{^formParams.isEmpty}}body: Enum.map_join([{{#formParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/formParams}}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}")){{/formParams.isEmpty}}] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts + {{/notes}} + + ## Parameters - request(options) + - connection ({{moduleName}}.Connection): Connection to server +{{#allParams}}{{#required}} - {{#underscored}}{{paramName}}{{/underscored}} ({{dataType}}): {{description}} +{{/required}}{{/allParams}} - opts (KeywordList): [optional] Optional parameters +{{#allParams}}{{^required}} - {{#underscored}}:{{paramName}}{{/underscored}} ({{dataType}}): {{description}} +{{/required}}{{/allParams}} + ## Returns + + {:ok, {{#isListContainer}}[%{{returnBaseType}}{}, ...]{{/isListContainer}}{{#isMapContainer}}%{}{{/isMapContainer}}{{^returnType}}%{}{{/returnType}}{{#returnSimpleType}}%{{#returnType}}{{#isMapContainer}}{{/isMapContainer}}{{moduleName}}.Model.{{{returnType}}}{{/returnType}}{}{{/returnSimpleType}}} on success + {:error, info} on failure + """ + {{typespec}} + def {{#underscored}}{{operationId}}{{/underscored}}(connection, {{#allParams}}{{#required}}{{#underscored}}{{paramName}}{{/underscored}}, {{/required}}{{/allParams}}{{^hasOptionalParams}}_{{/hasOptionalParams}}opts \\ []) do +{{#hasOptionalParams}} + optional_params = %{ + {{#allParams}}{{^required}}{{^isPathParam}}:"{{baseName}}" => {{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}:form{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}{{/isPathParam}}{{#hasMore}}, + {{/hasMore}}{{/required}}{{/allParams}} + } +{{/hasOptionalParams}} + %{} + |> method(:{{#underscored}}{{httpMethod}}{{/underscored}}) + |> url("{{replacedPathName}}") +{{#allParams}} +{{#required}} +{{^isPathParam}} |> add_param({{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}{{#isMultipart}}{{#isFile}}:file{{/isFile}}{{^isFile}}:form{{/isFile}}{{/isMultipart}}{{^isMultipart}}:form{{/isMultipart}}{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}, :"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}) +{{/isPathParam}} +{{/required}} +{{/allParams}} +{{#hasOptionalParams}} + |> add_optional_params(optional_params, opts) +{{/hasOptionalParams}} + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode({{decodedStruct}}) end - {{/operation}} + {{/operation}} {{/operations}} end diff --git a/modules/swagger-codegen/src/main/resources/elixir/connection.ex.mustache b/modules/swagger-codegen/src/main/resources/elixir/connection.ex.mustache new file mode 100644 index 00000000000..9e10634e285 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/elixir/connection.ex.mustache @@ -0,0 +1,92 @@ +{{>licenseInfo}} +defmodule {{moduleName}}.Connection do + @moduledoc """ + Handle Tesla connections for {{moduleName}}. + """ + + use Tesla + + # Add any middleware here (authentication) + plug Tesla.Middleware.BaseUrl, "{{{basePath}}}" + plug Tesla.Middleware.Headers, %{"User-Agent" => "Elixir"} + plug Tesla.Middleware.EncodeJson + + {{#hasAuthMethods}} + {{#authMethods}} + {{#isOAuth}} + @scopes [ + {{#scopes}} + "{{scope}}"{{#hasMore}},{{/hasMore}} {{#description}}# {{description}}{{/description}} + {{/scopes}} + ] + + @doc """ + Configure a client connection using a provided OAuth2 token as a Bearer token + + ## Parameters + + - token (String): Bearer token + + ## Returns + + Tesla.Env.client + """ + @spec new(String.t) :: Tesla.Env.client + def new(token) when is_binary(token) do + Tesla.build_client([ + {Tesla.Middleware.Headers, %{"Authorization" => "Bearer #{token}"}} + ]) + end + + @doc """ + Configure a client connection using a function which yields a Bearer token. + + ## Parameters + + - token_fetcher (function arity of 1): Callback which provides an OAuth2 token + given a list of scopes + + ## Returns + + Tesla.Env.client + """ + @spec new(((list(String.t)) -> String.t)) :: Tesla.Env.client + def new(token_fetcher) when is_function(token_fetcher) do + token_fetcher.(@scopes) + |> new + end + {{/isOAuth}} + {{#isBasic}} + @doc """ + Configure an client connection using Basic authentication. + + ## Parameters + + - username (String): Username used for authentication + - password (String): Password used for authentication + + # Returns + + Tesla.Env.client + """ + @spec new(String.t, String.t) :: Tesla.Env.client + def new(username, password) do + Tesla.build_client([ + {Tesla.Middleware.BasicAuth, %{username: username, password: password}} + ]) + end + {{/isBasic}} + {{/authMethods}} + {{/hasAuthMethods}} + @doc """ + Configure an authless client connection + + # Returns + + Tesla.Env.client + """ + @spec new() :: Tesla.Env.client + def new do + Tesla.build_client([]) + end +end diff --git a/modules/swagger-codegen/src/main/resources/elixir/deserializer.ex.mustache b/modules/swagger-codegen/src/main/resources/elixir/deserializer.ex.mustache new file mode 100644 index 00000000000..931ba8f7b9c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/elixir/deserializer.ex.mustache @@ -0,0 +1,31 @@ +{{>licenseInfo}} +defmodule {{moduleName}}.Deserializer do + @moduledoc """ + Helper functions for deserializing responses into models + """ + + @doc """ + Update the provided model with a deserialization of a nested value + """ + @spec deserialize(struct(), :atom, :atom, struct(), keyword()) :: struct() + def deserialize(model, field, :list, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: [struct(mod)]])))) + end + def deserialize(model, field, :struct, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: struct(mod)])))) + end + def deserialize(model, field, :map, mod, options) do + model + |> Map.update!(field, &(Map.new(&1, fn {key, val} -> {key, Poison.Decode.decode(val, Keyword.merge(options, [as: struct(mod)]))} end))) + end + def deserialize(model, field, :date, _, _options) do + case DateTime.from_iso8601(Map.get(model, field)) do + {:ok, datetime} -> + Map.put(model, field, datetime) + _ -> + model + end + end +end diff --git a/modules/swagger-codegen/src/main/resources/elixir/gitignore.mustache b/modules/swagger-codegen/src/main/resources/elixir/gitignore.mustache new file mode 100644 index 00000000000..b6012c77a3a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/elixir/gitignore.mustache @@ -0,0 +1,20 @@ +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez diff --git a/modules/swagger-codegen/src/main/resources/elixir/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/elixir/licenseInfo.mustache new file mode 100644 index 00000000000..fea09ae1ed6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/elixir/licenseInfo.mustache @@ -0,0 +1,6 @@ +{{#licenseHeader}}{{licenseHeader}} + +{{/licenseHeader}} +# 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/modules/swagger-codegen/src/main/resources/elixir/mix.exs.mustache b/modules/swagger-codegen/src/main/resources/elixir/mix.exs.mustache index f2b467f77cc..31b458cf49f 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/mix.exs.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/mix.exs.mustache @@ -1,8 +1,8 @@ -defmodule {{#modulized}}{{appName}}{{/modulized}}.Mixfile do +defmodule {{moduleName}}.Mixfile do use Mix.Project def project do - [app: :{{#underscored}}{{appName}}{{/underscored}}, + [app: :{{#underscored}}{{packageName}}{{/underscored}}, version: "0.1.0", elixir: "~> {{supportedElixirVersion}}", build_embedded: Mix.env == :prod, diff --git a/modules/swagger-codegen/src/main/resources/elixir/model.mustache b/modules/swagger-codegen/src/main/resources/elixir/model.mustache index e69de29bb2d..36b4458399b 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/model.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/model.mustache @@ -0,0 +1,32 @@ +{{>licenseInfo}} +{{#models}}{{#model}}defmodule {{moduleName}}.Model.{{classname}} do + @moduledoc """ + {{description}} + """ + + @derive [Poison.Encoder] + defstruct [ + {{#vars}}:"{{baseName}}"{{#hasMore}}, + {{/hasMore}}{{/vars}} + ] +end + +defimpl Poison.Decoder, for: {{moduleName}}.Model.{{classname}} do +{{#hasComplexVars}} + import {{moduleName}}.Deserializer + def decode(value, options) do + value + {{#vars}} + {{^isPrimitiveType}} + {{#datatype}}|> deserialize(:"{{baseName}}", {{#isListContainer}}:list, {{moduleName}}.Model.{{items.datatype}}{{/isListContainer}}{{#isMapContainer}}:map, {{moduleName}}.Model.{{items.datatype}}{{/isMapContainer}}{{#isDate}}:date, nil{{/isDate}}{{#isDateTime}}:date, nil{{/isDateTime}}{{^isDate}}{{^isDateTime}}{{^isMapContainer}}{{^isListContainer}}:struct, {{moduleName}}.Model.{{datatype}}{{/isListContainer}}{{/isMapContainer}}{{/isDateTime}}{{/isDate}}, options) + {{/datatype}} + {{/isPrimitiveType}} + {{/vars}} +{{/hasComplexVars}} +{{^hasComplexVars}} + def decode(value, _options) do + value +{{/hasComplexVars}} + end +end +{{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/elixir/request_builder.ex.mustache b/modules/swagger-codegen/src/main/resources/elixir/request_builder.ex.mustache new file mode 100644 index 00000000000..8b0480496c8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/elixir/request_builder.ex.mustache @@ -0,0 +1,127 @@ +{{>licenseInfo}} +defmodule {{moduleName}}.RequestBuilder do + @moduledoc """ + Helper functions for building Tesla requests + """ + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - m (String) - Request method + + ## Returns + + Map + """ + @spec method(map(), String.t) :: map() + def method(request, m) do + Map.put_new(request, :method, m) + end + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - u (String) - Request URL + + ## Returns + + Map + """ + @spec url(map(), String.t) :: map() + def url(request, u) do + Map.put_new(request, :url, u) + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - definitions (Map) - Map of parameter name to parameter location. + - options (KeywordList) - The provided optional parameters + + ## Returns + + Map + """ + @spec add_optional_params(map(), %{optional(:atom) => :atom}, keyword()) :: map() + def add_optional_params(request, _, []), do: request + def add_optional_params(request, definitions, [{key, value} | tail]) do + case definitions do + %{^key => location} -> + request + |> add_param(location, key, value) + |> add_optional_params(definitions, tail) + _ -> + add_optional_params(request, definitions, tail) + end + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - location (atom) - Where to put the parameter + - key (atom) - The name of the parameter + - value (any) - The value of the parameter + + ## Returns + + Map + """ + @spec add_param(map(), :atom, :atom, any()) :: map() + def add_param(request, :body, :body, value), do: Map.put(request, :body, value) + def add_param(request, :body, key, value) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) + end + def add_param(request, :file, name, path) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_file(&1, path, name: name))) + end + def add_param(request, :form, name, value) do + request + |> Map.update(:body, %{name => value}, &(Map.put(&1, name, value))) + end + def add_param(request, location, key, value) do + Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}])) + end + + @doc """ + Handle the response for a Tesla request + + ## Parameters + + - env (Tesla.Env) - The response object + - struct - The shape of the struct to deserialize into + + ## Returns + + {:ok, struct} on success + {:error, info} on failure + """ + @spec decode(Tesla.Env.t) :: {:ok, struct()} | {:error, Tesla.Env.t} + def decode(%Tesla.Env{status: 200, body: body}), do: Poison.decode(body) + def decode(response) do + {:error, response} + end + @spec decode(Tesla.Env.t, struct()) :: {:ok, struct()} | {:error, Tesla.Env.t} + def decode(%Tesla.Env{status: 200} = env, false), do: {:ok, env} + def decode(%Tesla.Env{status: 200, body: body}, struct) do + Poison.decode(body, as: struct) + end + def decode(response, _struct) do + {:error, response} + end +end diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/elixir/ElixirClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/elixir/ElixirClientOptionsTest.java index edeab0eb284..b156404b77c 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/elixir/ElixirClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/elixir/ElixirClientOptionsTest.java @@ -4,6 +4,7 @@ import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.languages.ElixirClientCodegen; import io.swagger.codegen.options.ElixirClientOptionsProvider; +import io.swagger.codegen.options.PhpClientOptionsProvider; import mockit.Expectations; import mockit.Tested; @@ -26,6 +27,8 @@ protected CodegenConfig getCodegenConfig() { protected void setExpectations() { new Expectations(clientCodegen) {{ // TODO + clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); + times = 1; }}; } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ElixirClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ElixirClientOptionsProvider.java index 092fccc2e0a..082bbeca02e 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ElixirClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/ElixirClientOptionsProvider.java @@ -6,6 +6,7 @@ import java.util.Map; public class ElixirClientOptionsProvider implements OptionsProvider { + public static final String INVOKER_PACKAGE_VALUE = "Yay.Pets"; @Override public String getLanguage() { @@ -19,6 +20,9 @@ public Map createOptions() { .put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "false") .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, "false") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, "false") + .put(CodegenConstants.INVOKER_PACKAGE, "Yay.Pets") + .put("licenseHeader", "# Copyright 2017 Me\n#\n# Licensed under the Apache License") + .put(CodegenConstants.PACKAGE_NAME, "yay_pets") .build(); } diff --git a/samples/client/petstore/elixir/.gitignore b/samples/client/petstore/elixir/.gitignore new file mode 100644 index 00000000000..b6012c77a3a --- /dev/null +++ b/samples/client/petstore/elixir/.gitignore @@ -0,0 +1,20 @@ +# The directory Mix will write compiled artifacts to. +/_build + +# If you run "mix test --cover", coverage assets end up here. +/cover + +# The directory Mix downloads your dependencies sources to. +/deps + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Also ignore archive artifacts (built via "mix archive.build"). +*.ez diff --git a/samples/client/petstore/elixir/README.md b/samples/client/petstore/elixir/README.md index a436a5e0063..4b6aeacbff4 100644 --- a/samples/client/petstore/elixir/README.md +++ b/samples/client/petstore/elixir/README.md @@ -1,6 +1,6 @@ # SwaggerPetstore -**TODO: Add 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: \" \\ ## Installation diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/another_fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/another_fake.ex new file mode 100644 index 00000000000..43d707f09ee --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/another_fake.ex @@ -0,0 +1,39 @@ +# 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. + +defmodule SwaggerPetstore.Api.AnotherFake do + @moduledoc """ + API calls for all endpoints tagged `AnotherFake`. + """ + + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder + + + @doc """ + To test special tags + To test special tags + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (Client): client model + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec test_special_tags(Tesla.Env.client, SwaggerPetstore.Model.Client.t, keyword()) :: {:ok, SwaggerPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def test_special_tags(connection, body, _opts \\ []) do + %{} + |> method(:patch) + |> url("/another-fake/dummy") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Client{}) + end +end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index ae5e577003a..369b2091029 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -1,144 +1,278 @@ +# 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. + defmodule SwaggerPetstore.Api.Fake do @moduledoc """ - Documentation for SwaggerPetstore.Api.Fake. + API calls for all endpoints tagged `Fake`. """ - use Tesla + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON @doc """ - - Test serialization of outer boolean types - """ - def fake_outer_boolean_serialize(body) do - method = [method: :post] - url = [url: "/fake/outer/boolean"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (OuterBoolean): Input boolean as post body + + ## Returns + + {:ok, %SwaggerPetstore.Model.OuterBoolean{}} on success + {:error, info} on failure + """ + @spec fake_outer_boolean_serialize(Tesla.Env.client, keyword()) :: {:ok, SwaggerPetstore.Model.OuterBoolean.t} | {:error, Tesla.Env.t} + def fake_outer_boolean_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/boolean") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.OuterBoolean{}) end @doc """ - - Test serialization of object with outer number type - """ - def fake_outer_composite_serialize(body) do - method = [method: :post] - url = [url: "/fake/outer/composite"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (OuterComposite): Input composite as post body + + ## Returns + + {:ok, %SwaggerPetstore.Model.OuterComposite{}} on success + {:error, info} on failure + """ + @spec fake_outer_composite_serialize(Tesla.Env.client, keyword()) :: {:ok, SwaggerPetstore.Model.OuterComposite.t} | {:error, Tesla.Env.t} + def fake_outer_composite_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/composite") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.OuterComposite{}) end @doc """ - - Test serialization of outer number types - """ - def fake_outer_number_serialize(body) do - method = [method: :post] - url = [url: "/fake/outer/number"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (OuterNumber): Input number as post body + + ## Returns + + {:ok, %SwaggerPetstore.Model.OuterNumber{}} on success + {:error, info} on failure + """ + @spec fake_outer_number_serialize(Tesla.Env.client, keyword()) :: {:ok, SwaggerPetstore.Model.OuterNumber.t} | {:error, Tesla.Env.t} + def fake_outer_number_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/number") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.OuterNumber{}) end @doc """ - - Test serialization of outer string types - """ - def fake_outer_string_serialize(body) do - method = [method: :post] - url = [url: "/fake/outer/string"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :body (OuterString): Input string as post body + + ## Returns + + {:ok, %SwaggerPetstore.Model.OuterString{}} on success + {:error, info} on failure + """ + @spec fake_outer_string_serialize(Tesla.Env.client, keyword()) :: {:ok, SwaggerPetstore.Model.OuterString.t} | {:error, Tesla.Env.t} + def fake_outer_string_serialize(connection, opts \\ []) do + optional_params = %{ + :"body" => :body + } + %{} + |> method(:post) + |> url("/fake/outer/string") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.OuterString{}) end @doc """ To test \"client\" model - To test \"client\" model - """ - def test_client_model(body) do - method = [method: :patch] - url = [url: "/fake"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (Client): client model + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec test_client_model(Tesla.Env.client, SwaggerPetstore.Model.Client.t, keyword()) :: {:ok, SwaggerPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def test_client_model(connection, body, _opts \\ []) do + %{} + |> method(:patch) + |> url("/fake") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Client{}) end @doc """ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - """ - def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback) do - method = [method: :post] - url = [url: "/fake"] - query_params = [] - header_params = [] - body_params = [] - form_params = [body: Enum.map_join([{:"integer", integer}, {:"int32", int32}, {:"int64", int64}, {:"number", number}, {:"float", float}, {:"double", double}, {:"string", string}, {:"pattern_without_delimiter", pattern_without_delimiter}, {:"byte", byte}, {:"binary", binary}, {:"date", date}, {:"dateTime", date_time}, {:"password", password}, {:"callback", callback}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - request(options) + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - number (Float): None + - double (Float): None + - pattern_without_delimiter (String): None + - byte (String): None + - opts (KeywordList): [optional] Optional parameters + - :integer (Integer): None + - :int32 (Integer): None + - :int64 (Integer): None + - :float (Float): None + - :string (String): None + - :binary (String): None + - :date (DateTime): None + - :date_time (DateTime): None + - :password (String): None + - :callback (String): None + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_endpoint_parameters(Tesla.Env.client, Float.t, Float.t, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do + optional_params = %{ + :"integer" => :form, + :"int32" => :form, + :"int64" => :form, + :"float" => :form, + :"string" => :form, + :"binary" => :form, + :"date" => :form, + :"dateTime" => :form, + :"password" => :form, + :"callback" => :form + } + %{} + |> method(:post) + |> url("/fake") + |> add_param(:form, :"number", number) + |> add_param(:form, :"double", double) + |> add_param(:form, :"pattern_without_delimiter", pattern_without_delimiter) + |> add_param(:form, :"byte", byte) + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ To test enum parameters - To test enum parameters + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + - :enum_form_string_array (List[String]): Form parameter enum test (string array) + - :enum_form_string (String): Form parameter enum test (string) + - :enum_header_string_array (List[String]): Header parameter enum test (string array) + - :enum_header_string (String): Header parameter enum test (string) + - :enum_query_string_array (List[String]): Query parameter enum test (string array) + - :enum_query_string (String): Query parameter enum test (string) + - :enum_query_integer (Integer): Query parameter enum test (double) + - :enum_query_double (Float): Query parameter enum test (double) + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def test_enum_parameters(enum_form_string_array, enum_form_string, enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double) do - method = [method: :get] - url = [url: "/fake"] - query_params = [query: [{:"enum_query_string_array", enum_query_string_array}, {:"enum_query_string", enum_query_string}, {:"enum_query_integer", enum_query_integer}]] - header_params = [header: [{:"enum_header_string_array", enum_header_string_array}, {:"enum_header_string", enum_header_string}]] - body_params = [] - form_params = [body: Enum.map_join([{:"enum_form_string_array", enum_form_string_array}, {:"enum_form_string", enum_form_string}, {:"enum_query_double", enum_query_double}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts + @spec test_enum_parameters(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_enum_parameters(connection, opts \\ []) do + optional_params = %{ + :"enum_form_string_array" => :form, + :"enum_form_string" => :form, + :"enum_header_string_array" => :headers, + :"enum_header_string" => :headers, + :"enum_query_string_array" => :query, + :"enum_query_string" => :query, + :"enum_query_integer" => :query, + :"enum_query_double" => :form + } + %{} + |> method(:get) + |> url("/fake") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) + end - request(options) + @doc """ + test json serialization of form data + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - param (String): field1 + - param2 (String): field2 + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure + """ + @spec test_json_form_data(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_json_form_data(connection, param, param2, _opts \\ []) do + %{} + |> method(:get) + |> url("/fake/jsonFormData") + |> add_param(:form, :"param", param) + |> add_param(:form, :"param2", param2) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake_classname_tags123.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake_classname_tags123.ex index 2cd659d09f6..5d86755ec5d 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake_classname_tags123.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake_classname_tags123.ex @@ -1,24 +1,38 @@ -defmodule SwaggerPetstore.Api.Fake_classname_tags123 do +# 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. + +defmodule SwaggerPetstore.Api.FakeClassnameTags123 do @moduledoc """ - Documentation for SwaggerPetstore.Api.Fake_classname_tags123. + API calls for all endpoints tagged `FakeClassnameTags123`. """ - use Tesla + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder + + + @doc """ + To test class name in snake case - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io/v2" - plug Tesla.Middleware.JSON + ## Parameters - def test_classname(body) do - method = [method: :patch] - url = [url: "/fake_classname_test"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts + - connection (SwaggerPetstore.Connection): Connection to server + - body (Client): client model + - opts (KeywordList): [optional] Optional parameters - request(options) + ## Returns + + {:ok, %SwaggerPetstore.Model.Client{}} on success + {:error, info} on failure + """ + @spec test_classname(Tesla.Env.client, SwaggerPetstore.Model.Client.t, keyword()) :: {:ok, SwaggerPetstore.Model.Client.t} | {:error, Tesla.Env.t} + def test_classname(connection, body, _opts \\ []) do + %{} + |> method(:patch) + |> url("/fake_classname_test") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Client{}) end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex index e68fb0ceaed..5396ccbc1a1 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex @@ -1,152 +1,236 @@ +# 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. + defmodule SwaggerPetstore.Api.Pet do @moduledoc """ - Documentation for SwaggerPetstore.Api.Pet. + API calls for all endpoints tagged `Pet`. """ - use Tesla + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON @doc """ Add a new pet to the store + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (Pet): Pet object that needs to be added to the store + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def add_pet(body) do - method = [method: :post] - url = [url: "/pet"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec add_pet(Tesla.Env.client, SwaggerPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def add_pet(connection, body, _opts \\ []) do + %{} + |> method(:post) + |> url("/pet") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Deletes a pet + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - pet_id (Integer): Pet id to delete + - opts (KeywordList): [optional] Optional parameters + - :api_key (String): + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def delete_pet(pet_id, api_key) do - method = [method: :delete] - url = [url: "/pet/#{pet_id}"] - query_params = [] - header_params = [header: [{:"api_key", api_key}]] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec delete_pet(Tesla.Env.client, Integer.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_pet(connection, pet_id, opts \\ []) do + optional_params = %{ + :"api_key" => :headers + } + %{} + |> method(:delete) + |> url("/pet/#{pet_id}") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Finds Pets by status - Multiple status values can be provided with comma separated strings + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - status (List[String]): Status values that need to be considered for filter + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, [%Pet{}, ...]} on success + {:error, info} on failure """ - def find_pets_by_status(status) do - method = [method: :get] - url = [url: "/pet/findByStatus"] - query_params = [query: [{:"status", status}]] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(SwaggerPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + def find_pets_by_status(connection, status, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/findByStatus") + |> add_param(:query, :"status", status) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode([%SwaggerPetstore.Model.Pet{}]) end @doc """ Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - tags (List[String]): Tags to filter by + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, [%Pet{}, ...]} on success + {:error, info} on failure """ - def find_pets_by_tags(tags) do - method = [method: :get] - url = [url: "/pet/findByTags"] - query_params = [query: [{:"tags", tags}]] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(SwaggerPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} + def find_pets_by_tags(connection, tags, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/findByTags") + |> add_param(:query, :"tags", tags) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode([%SwaggerPetstore.Model.Pet{}]) end @doc """ Find pet by ID - Returns a single pet + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - pet_id (Integer): ID of pet to return + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.Pet{}} on success + {:error, info} on failure """ - def get_pet_by_id(pet_id) do - method = [method: :get] - url = [url: "/pet/#{pet_id}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec get_pet_by_id(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.Pet.t} | {:error, Tesla.Env.t} + def get_pet_by_id(connection, pet_id, _opts \\ []) do + %{} + |> method(:get) + |> url("/pet/#{pet_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Pet{}) end @doc """ Update an existing pet + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (Pet): Pet object that needs to be added to the store + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def update_pet(body) do - method = [method: :put] - url = [url: "/pet"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec update_pet(Tesla.Env.client, SwaggerPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_pet(connection, body, _opts \\ []) do + %{} + |> method(:put) + |> url("/pet") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Updates a pet in the store with form data + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - pet_id (Integer): ID of pet that needs to be updated + - opts (KeywordList): [optional] Optional parameters + - :name (String): Updated name of the pet + - :status (String): Updated status of the pet + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def update_pet_with_form(pet_id, name, status) do - method = [method: :post] - url = [url: "/pet/#{pet_id}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [body: Enum.map_join([{:"name", name}, {:"status", status}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec update_pet_with_form(Tesla.Env.client, Integer.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_pet_with_form(connection, pet_id, opts \\ []) do + optional_params = %{ + :"name" => :form, + :"status" => :form + } + %{} + |> method(:post) + |> url("/pet/#{pet_id}") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ uploads an image + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - pet_id (Integer): ID of pet to update + - opts (KeywordList): [optional] Optional parameters + - :additional_metadata (String): Additional data to pass to server + - :file (String): file to upload + + ## Returns + + {:ok, %SwaggerPetstore.Model.ApiResponse{}} on success + {:error, info} on failure """ - def upload_file(pet_id, additional_metadata, file) do - method = [method: :post] - url = [url: "/pet/#{pet_id}/uploadImage"] - query_params = [] - header_params = [] - body_params = [] - form_params = [body: Enum.map_join([{:"additionalMetadata", additional_metadata}, {:"file", file}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec upload_file(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} + def upload_file(connection, pet_id, opts \\ []) do + optional_params = %{ + :"additionalMetadata" => :form, + :"file" => :form + } + %{} + |> method(:post) + |> url("/pet/#{pet_id}/uploadImage") + |> add_optional_params(optional_params, opts) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.ApiResponse{}) end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex index a37ac36b2f7..2e5f0066e44 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex @@ -1,84 +1,113 @@ +# 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. + defmodule SwaggerPetstore.Api.Store do @moduledoc """ - Documentation for SwaggerPetstore.Api.Store. + API calls for all endpoints tagged `Store`. """ - use Tesla + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON @doc """ Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - order_id (String): ID of the order that needs to be deleted + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def delete_order(order_id) do - method = [method: :delete] - url = [url: "/store/order/#{order_id}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec delete_order(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_order(connection, order_id, _opts \\ []) do + %{} + |> method(:delete) + |> url("/store/order/#{order_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Returns pet inventories by status - Returns a map of status codes to quantities + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def get_inventory() do - method = [method: :get] - url = [url: "/store/inventory"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec get_inventory(Tesla.Env.client, keyword()) :: {:ok, map()} | {:error, Tesla.Env.t} + def get_inventory(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/store/inventory") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode() end @doc """ Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - order_id (Integer): ID of pet that needs to be fetched + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.Order{}} on success + {:error, info} on failure """ - def get_order_by_id(order_id) do - method = [method: :get] - url = [url: "/store/order/#{order_id}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec get_order_by_id(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.Order.t} | {:error, Tesla.Env.t} + def get_order_by_id(connection, order_id, _opts \\ []) do + %{} + |> method(:get) + |> url("/store/order/#{order_id}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Order{}) end @doc """ Place an order for a pet + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (Order): order placed for purchasing the pet + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.Order{}} on success + {:error, info} on failure """ - def place_order(body) do - method = [method: :post] - url = [url: "/store/order"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec place_order(Tesla.Env.client, SwaggerPetstore.Model.Order.t, keyword()) :: {:ok, SwaggerPetstore.Model.Order.t} | {:error, Tesla.Env.t} + def place_order(connection, body, _opts \\ []) do + %{} + |> method(:post) + |> url("/store/order") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.Order{}) end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex index 9ebb200f0f0..b84c5ed51c2 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex @@ -1,152 +1,220 @@ +# 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. + defmodule SwaggerPetstore.Api.User do @moduledoc """ - Documentation for SwaggerPetstore.Api.User. + API calls for all endpoints tagged `User`. """ - use Tesla + alias SwaggerPetstore.Connection + import SwaggerPetstore.RequestBuilder - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON @doc """ Create user - This can only be done by the logged in user. + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (User): Created user object + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def create_user(body) do - method = [method: :post] - url = [url: "/user"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec create_user(Tesla.Env.client, SwaggerPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_user(connection, body, _opts \\ []) do + %{} + |> method(:post) + |> url("/user") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Creates list of users with given input array + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (List[User]): List of user object + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def create_users_with_array_input(body) do - method = [method: :post] - url = [url: "/user/createWithArray"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec create_users_with_array_input(Tesla.Env.client, list(SwaggerPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_users_with_array_input(connection, body, _opts \\ []) do + %{} + |> method(:post) + |> url("/user/createWithArray") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Creates list of users with given input array + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - body (List[User]): List of user object + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def create_users_with_list_input(body) do - method = [method: :post] - url = [url: "/user/createWithList"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec create_users_with_list_input(Tesla.Env.client, list(SwaggerPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def create_users_with_list_input(connection, body, _opts \\ []) do + %{} + |> method(:post) + |> url("/user/createWithList") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Delete user - This can only be done by the logged in user. + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - username (String): The name that needs to be deleted + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def delete_user(username) do - method = [method: :delete] - url = [url: "/user/#{username}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec delete_user(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def delete_user(connection, username, _opts \\ []) do + %{} + |> method(:delete) + |> url("/user/#{username}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Get user by user name + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - username (String): The name that needs to be fetched. Use user1 for testing. + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.User{}} on success + {:error, info} on failure """ - def get_user_by_name(username) do - method = [method: :get] - url = [url: "/user/#{username}"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec get_user_by_name(Tesla.Env.client, String.t, keyword()) :: {:ok, SwaggerPetstore.Model.User.t} | {:error, Tesla.Env.t} + def get_user_by_name(connection, username, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/#{username}") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(%SwaggerPetstore.Model.User{}) end @doc """ Logs user into the system + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - username (String): The user name for login + - password (String): The password for login in clear text + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %SwaggerPetstore.Model.String{}} on success + {:error, info} on failure """ - def login_user(username, password) do - method = [method: :get] - url = [url: "/user/login"] - query_params = [query: [{:"username", username}, {:"password", password}]] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} + def login_user(connection, username, password, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/login") + |> add_param(:query, :"username", username) + |> add_param(:query, :"password", password) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Logs out current logged in user session + + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def logout_user() do - method = [method: :get] - url = [url: "/user/logout"] - query_params = [] - header_params = [] - body_params = [] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec logout_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def logout_user(connection, _opts \\ []) do + %{} + |> method(:get) + |> url("/user/logout") + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end @doc """ Updated user - This can only be done by the logged in user. + + ## Parameters + + - connection (SwaggerPetstore.Connection): Connection to server + - username (String): name that need to be deleted + - body (User): Updated user object + - opts (KeywordList): [optional] Optional parameters + + ## Returns + + {:ok, %{}} on success + {:error, info} on failure """ - def update_user(username, body) do - method = [method: :put] - url = [url: "/user/#{username}"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) + @spec update_user(Tesla.Env.client, String.t, SwaggerPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def update_user(connection, username, body, _opts \\ []) do + %{} + |> method(:put) + |> url("/user/#{username}") + |> add_param(:body, :"body", body) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> decode(false) end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/connection.ex b/samples/client/petstore/elixir/lib/swagger_petstore/connection.ex new file mode 100644 index 00000000000..067e59f02f6 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/connection.ex @@ -0,0 +1,86 @@ +# 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. + +defmodule SwaggerPetstore.Connection do + @moduledoc """ + Handle Tesla connections for SwaggerPetstore. + """ + + use Tesla + + # Add any middleware here (authentication) + plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" + plug Tesla.Middleware.Headers, %{"User-Agent" => "Elixir"} + plug Tesla.Middleware.EncodeJson + + @doc """ + Configure an client connection using Basic authentication. + + ## Parameters + + - username (String): Username used for authentication + - password (String): Password used for authentication + + # Returns + + Tesla.Env.client + """ + @spec new(String.t, String.t) :: Tesla.Env.client + def new(username, password) do + Tesla.build_client([ + {Tesla.Middleware.BasicAuth, %{username: username, password: password}} + ]) + end + @scopes [ + "write:pets", # modify pets in your account + "read:pets" # read your pets + ] + + @doc """ + Configure a client connection using a provided OAuth2 token as a Bearer token + + ## Parameters + + - token (String): Bearer token + + ## Returns + + Tesla.Env.client + """ + @spec new(String.t) :: Tesla.Env.client + def new(token) when is_binary(token) do + Tesla.build_client([ + {Tesla.Middleware.Headers, %{"Authorization" => "Bearer #{token}"}} + ]) + end + + @doc """ + Configure a client connection using a function which yields a Bearer token. + + ## Parameters + + - token_fetcher (function arity of 1): Callback which provides an OAuth2 token + given a list of scopes + + ## Returns + + Tesla.Env.client + """ + @spec new(((list(String.t)) -> String.t)) :: Tesla.Env.client + def new(token_fetcher) when is_function(token_fetcher) do + token_fetcher.(@scopes) + |> new + end + @doc """ + Configure an authless client connection + + # Returns + + Tesla.Env.client + """ + @spec new() :: Tesla.Env.client + def new do + Tesla.build_client([]) + end +end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/deserializer.ex b/samples/client/petstore/elixir/lib/swagger_petstore/deserializer.ex new file mode 100644 index 00000000000..9af85b7d9ea --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/deserializer.ex @@ -0,0 +1,34 @@ +# 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. + +defmodule SwaggerPetstore.Deserializer do + @moduledoc """ + Helper functions for deserializing responses into models + """ + + @doc """ + Update the provided model with a deserialization of a nested value + """ + @spec deserialize(struct(), :atom, :atom, struct(), keyword()) :: struct() + def deserialize(model, field, :list, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: [struct(mod)]])))) + end + def deserialize(model, field, :struct, mod, options) do + model + |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: struct(mod)])))) + end + def deserialize(model, field, :map, mod, options) do + model + |> Map.update!(field, &(Map.new(&1, fn {key, val} -> {key, Poison.Decode.decode(val, Keyword.merge(options, [as: struct(mod)]))} end))) + end + def deserialize(model, field, :date, _, _options) do + case DateTime.from_iso8601(Map.get(model, field)) do + {:ok, datetime} -> + Map.put(model, field, datetime) + _ -> + model + end + end +end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/$special[model.name].ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/$special[model.name].ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex index e69de29bb2d..a2889ebb9a4 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.200_response do + @moduledoc """ + Model for testing model name starting with number + """ + + @derive [Poison.Encoder] + defstruct [ + :"name", + :"class" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.200_response do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex new file mode 100644 index 00000000000..f11d928a90f --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.$special[model.name] do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"$special[property.name]" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.$special[model.name] do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/additionalPropertiesClass.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/additionalPropertiesClass.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex new file mode 100644 index 00000000000..cb61ee1b8b6 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.AdditionalPropertiesClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"map_property", + :"map_of_map_property" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.AdditionalPropertiesClass do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex index e69de29bb2d..a10f7e3446b 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.Animal do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Animal do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/animalFarm.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/animalFarm.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex new file mode 100644 index 00000000000..571ff494530 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.AnimalFarm do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.AnimalFarm do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/apiResponse.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/apiResponse.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex new file mode 100644 index 00000000000..70f16c4ad7a --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex @@ -0,0 +1,23 @@ +# 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. + +defmodule SwaggerPetstore.Model.ApiResponse do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"code", + :"type", + :"message" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ApiResponse do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfArrayOfNumberOnly.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfArrayOfNumberOnly.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfNumberOnly.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayOfNumberOnly.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayTest.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/arrayTest.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex new file mode 100644 index 00000000000..b5997b7f146 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.ArrayOfArrayOfNumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"ArrayArrayNumber" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayOfArrayOfNumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex new file mode 100644 index 00000000000..d33b4eb053c --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.ArrayOfNumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"ArrayNumber" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayOfNumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex new file mode 100644 index 00000000000..a04accd186a --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex @@ -0,0 +1,23 @@ +# 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. + +defmodule SwaggerPetstore.Model.ArrayTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"array_of_string", + :"array_array_of_integer", + :"array_array_of_model" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayTest do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex index e69de29bb2d..c51c313491c 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex @@ -0,0 +1,26 @@ +# 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. + +defmodule SwaggerPetstore.Model.Capitalization do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"smallCamel", + :"CapitalCamel", + :"small_Snake", + :"Capital_Snake", + :"SCA_ETH_Flow_Points", + :"ATT_NAME" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Capitalization do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex index e69de29bb2d..4e150aa8422 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex @@ -0,0 +1,23 @@ +# 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. + +defmodule SwaggerPetstore.Model.Cat do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"declawed" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Cat do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex index e69de29bb2d..80aa58551a0 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.Category do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"name" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Category do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/classModel.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/classModel.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex new file mode 100644 index 00000000000..5c3e7fb18eb --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.ClassModel do + @moduledoc """ + Model for testing model with \"_class\" property + """ + + @derive [Poison.Encoder] + defstruct [ + :"_class" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ClassModel do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex index e69de29bb2d..779bb7434b3 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.Client do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"client" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Client do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex index e69de29bb2d..6ca69ec1af3 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex @@ -0,0 +1,23 @@ +# 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. + +defmodule SwaggerPetstore.Model.Dog do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"breed" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Dog do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enumArrays.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enumArrays.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enumClass.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enumClass.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_Test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_Test.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex new file mode 100644 index 00000000000..3518b690924 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.EnumArrays do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"just_symbol", + :"array_enum" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumArrays do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex new file mode 100644 index 00000000000..cbd77d49053 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.EnumClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumClass do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex new file mode 100644 index 00000000000..d7a45b05854 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex @@ -0,0 +1,26 @@ +# 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. + +defmodule SwaggerPetstore.Model.Enum_Test do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"enum_string", + :"enum_integer", + :"enum_number", + :"outerEnum" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Enum_Test do + import SwaggerPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"outerEnum", :struct, SwaggerPetstore.Model.OuterEnum, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex index e69de29bb2d..46e871e6f42 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex @@ -0,0 +1,35 @@ +# 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. + +defmodule SwaggerPetstore.Model.Format_test do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"integer", + :"int32", + :"int64", + :"number", + :"float", + :"double", + :"string", + :"byte", + :"binary", + :"date", + :"dateTime", + :"uuid", + :"password" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Format_test do + import SwaggerPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"date", :date, nil, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/hasOnlyReadOnly.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/hasOnlyReadOnly.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex new file mode 100644 index 00000000000..f8f7a7d0b84 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.HasOnlyReadOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"bar", + :"foo" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.HasOnlyReadOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/mapTest.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/mapTest.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex new file mode 100644 index 00000000000..59f2f0abe82 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.MapTest do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"map_map_of_string", + :"map_of_enum_string" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.MapTest do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/mixedPropertiesAndAdditionalPropertiesClass.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/mixedPropertiesAndAdditionalPropertiesClass.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex new file mode 100644 index 00000000000..f7cafcbab77 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -0,0 +1,25 @@ +# 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. + +defmodule SwaggerPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"uuid", + :"dateTime", + :"map" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do + import SwaggerPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"map", :map, SwaggerPetstore.Model.Animal, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex index e69de29bb2d..240ab5d51ab 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex @@ -0,0 +1,24 @@ +# 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. + +defmodule SwaggerPetstore.Model.Name do + @moduledoc """ + Model for testing model name same as property name + """ + + @derive [Poison.Encoder] + defstruct [ + :"name", + :"snake_case", + :"property", + :"123Number" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Name do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/numberOnly.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/numberOnly.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex new file mode 100644 index 00000000000..75370482465 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.NumberOnly do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"JustNumber" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.NumberOnly do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex index e69de29bb2d..f14a628b4cc 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex @@ -0,0 +1,26 @@ +# 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. + +defmodule SwaggerPetstore.Model.Order do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"petId", + :"quantity", + :"shipDate", + :"status", + :"complete" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Order do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerBoolean.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerBoolean.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerComposite.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerComposite.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerEnum.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerEnum.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerNumber.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerNumber.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerString.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerString.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex new file mode 100644 index 00000000000..07d213b812c --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.OuterBoolean do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterBoolean do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex new file mode 100644 index 00000000000..19f1086a014 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex @@ -0,0 +1,27 @@ +# 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. + +defmodule SwaggerPetstore.Model.OuterComposite do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"my_number", + :"my_string", + :"my_boolean" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterComposite do + import SwaggerPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"my_number", :struct, SwaggerPetstore.Model.OuterNumber, options) + |> deserialize(:"my_string", :struct, SwaggerPetstore.Model.OuterString, options) + |> deserialize(:"my_boolean", :struct, SwaggerPetstore.Model.OuterBoolean, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex new file mode 100644 index 00000000000..df5c95fdcd3 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.OuterEnum do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterEnum do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex new file mode 100644 index 00000000000..67defe1580e --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.OuterNumber do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterNumber do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex new file mode 100644 index 00000000000..223c970d7bb --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.OuterString do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterString do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex index e69de29bb2d..c6a5542cbb7 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex @@ -0,0 +1,29 @@ +# 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. + +defmodule SwaggerPetstore.Model.Pet do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"category", + :"name", + :"photoUrls", + :"tags", + :"status" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Pet do + import SwaggerPetstore.Deserializer + def decode(value, options) do + value + |> deserialize(:"category", :struct, SwaggerPetstore.Model.Category, options) + |> deserialize(:"tags", :list, SwaggerPetstore.Model.Tag, options) + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/readOnlyFirst.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/readOnlyFirst.ex deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex new file mode 100644 index 00000000000..bc0be16b863 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.ReadOnlyFirst do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"bar", + :"baz" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.ReadOnlyFirst do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex index e69de29bb2d..03b1e0d15f9 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex @@ -0,0 +1,21 @@ +# 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. + +defmodule SwaggerPetstore.Model.Return do + @moduledoc """ + Model for testing reserved words + """ + + @derive [Poison.Encoder] + defstruct [ + :"return" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Return do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex index e69de29bb2d..6f323cfb601 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex @@ -0,0 +1,22 @@ +# 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. + +defmodule SwaggerPetstore.Model.Tag do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"name" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Tag do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex index e69de29bb2d..ff634f44bbb 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex @@ -0,0 +1,28 @@ +# 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. + +defmodule SwaggerPetstore.Model.User do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"id", + :"username", + :"firstName", + :"lastName", + :"email", + :"password", + :"phone", + :"userStatus" + ] +end + +defimpl Poison.Decoder, for: SwaggerPetstore.Model.User do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/request_builder.ex b/samples/client/petstore/elixir/lib/swagger_petstore/request_builder.ex new file mode 100644 index 00000000000..01512b7e278 --- /dev/null +++ b/samples/client/petstore/elixir/lib/swagger_petstore/request_builder.ex @@ -0,0 +1,130 @@ +# 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. + +defmodule SwaggerPetstore.RequestBuilder do + @moduledoc """ + Helper functions for building Tesla requests + """ + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - m (String) - Request method + + ## Returns + + Map + """ + @spec method(map(), String.t) :: map() + def method(request, m) do + Map.put_new(request, :method, m) + end + + @doc """ + Specify the request method when building a request + + ## Parameters + + - request (Map) - Collected request options + - u (String) - Request URL + + ## Returns + + Map + """ + @spec url(map(), String.t) :: map() + def url(request, u) do + Map.put_new(request, :url, u) + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - definitions (Map) - Map of parameter name to parameter location. + - options (KeywordList) - The provided optional parameters + + ## Returns + + Map + """ + @spec add_optional_params(map(), %{optional(:atom) => :atom}, keyword()) :: map() + def add_optional_params(request, _, []), do: request + def add_optional_params(request, definitions, [{key, value} | tail]) do + case definitions do + %{^key => location} -> + request + |> add_param(location, key, value) + |> add_optional_params(definitions, tail) + _ -> + add_optional_params(request, definitions, tail) + end + end + + @doc """ + Add optional parameters to the request + + ## Parameters + + - request (Map) - Collected request options + - location (atom) - Where to put the parameter + - key (atom) - The name of the parameter + - value (any) - The value of the parameter + + ## Returns + + Map + """ + @spec add_param(map(), :atom, :atom, any()) :: map() + def add_param(request, :body, :body, value), do: Map.put(request, :body, value) + def add_param(request, :body, key, value) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) + end + def add_param(request, :file, name, path) do + request + |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) + |> Map.update!(:body, &(Tesla.Multipart.add_file(&1, path, name: name))) + end + def add_param(request, :form, name, value) do + request + |> Map.update(:body, %{name => value}, &(Map.put(&1, name, value))) + end + def add_param(request, location, key, value) do + Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}])) + end + + @doc """ + Handle the response for a Tesla request + + ## Parameters + + - env (Tesla.Env) - The response object + - struct - The shape of the struct to deserialize into + + ## Returns + + {:ok, struct} on success + {:error, info} on failure + """ + @spec decode(Tesla.Env.t) :: {:ok, struct()} | {:error, Tesla.Env.t} + def decode(%Tesla.Env{status: 200, body: body}), do: Poison.decode(body) + def decode(response) do + {:error, response} + end + @spec decode(Tesla.Env.t, struct()) :: {:ok, struct()} | {:error, Tesla.Env.t} + def decode(%Tesla.Env{status: 200} = env, false), do: {:ok, env} + def decode(%Tesla.Env{status: 200, body: body}, struct) do + Poison.decode(body, as: struct) + end + def decode(response, _struct) do + {:error, response} + end +end diff --git a/samples/client/petstore/elixir/mix.exs b/samples/client/petstore/elixir/mix.exs index 82717f770be..c19f9e5a4cb 100644 --- a/samples/client/petstore/elixir/mix.exs +++ b/samples/client/petstore/elixir/mix.exs @@ -29,7 +29,7 @@ defmodule SwaggerPetstore.Mixfile do # Type "mix help deps" for more examples and options defp deps do [ - {:tesla, "~> 0.5.0"}, + {:tesla, "~> 0.8"}, {:poison, ">= 1.0.0"} ] end From bd5b5860289682d60b621c1e3a10dd081b3f7275 Mon Sep 17 00:00:00 2001 From: yissachar Date: Wed, 27 Sep 2017 21:49:05 -0400 Subject: [PATCH 077/197] Use valid JS RegEx (#6584) --- .../typescript-angular/api.service.mustache | 2 +- .../default/api/pet.service.ts | 20 ++++++------- .../default/api/store.service.ts | 12 ++++---- .../default/api/user.service.ts | 20 ++++++------- .../npm/api/pet.service.ts | 20 ++++++------- .../npm/api/store.service.ts | 12 ++++---- .../npm/api/user.service.ts | 20 ++++++------- .../with-interfaces/api/pet.service.ts | 20 ++++++------- .../with-interfaces/api/store.service.ts | 12 ++++---- .../with-interfaces/api/user.service.ts | 20 ++++++------- .../npm/api/pet.service.ts | 28 +++++++++---------- .../npm/api/store.service.ts | 16 +++++------ .../npm/api/user.service.ts | 26 ++++++++--------- .../typescript-angular-v4/npm/package.json | 2 +- 14 files changed, 115 insertions(+), 115 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 376a6d6602f..c8775b7d7dd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -79,7 +79,7 @@ export class {{classname}} { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index b1bf4505cc5..f8265399f42 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -46,7 +46,7 @@ export class PetService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -75,7 +75,7 @@ export class PetService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -248,7 +248,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -307,7 +307,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -361,7 +361,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -415,7 +415,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -462,7 +462,7 @@ export class PetService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -512,7 +512,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -582,7 +582,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (name !== undefined) { formParams.set('name', name); } @@ -658,7 +658,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 3610483fd6b..4f4189c369b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -45,7 +45,7 @@ export class StoreService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class StoreService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -169,7 +169,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -209,7 +209,7 @@ export class StoreService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -251,7 +251,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -292,7 +292,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index d608c6a4c27..f9cf1b9fb71 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -45,7 +45,7 @@ export class UserService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class UserService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -234,7 +234,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -278,7 +278,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -322,7 +322,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -367,7 +367,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -409,7 +409,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -463,7 +463,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -499,7 +499,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -546,7 +546,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index b1bf4505cc5..f8265399f42 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -46,7 +46,7 @@ export class PetService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -75,7 +75,7 @@ export class PetService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -248,7 +248,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -307,7 +307,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -361,7 +361,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -415,7 +415,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -462,7 +462,7 @@ export class PetService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -512,7 +512,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -582,7 +582,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (name !== undefined) { formParams.set('name', name); } @@ -658,7 +658,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 3610483fd6b..4f4189c369b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -45,7 +45,7 @@ export class StoreService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class StoreService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -169,7 +169,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -209,7 +209,7 @@ export class StoreService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -251,7 +251,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -292,7 +292,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index d608c6a4c27..f9cf1b9fb71 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -45,7 +45,7 @@ export class UserService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class UserService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -234,7 +234,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -278,7 +278,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -322,7 +322,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -367,7 +367,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -409,7 +409,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -463,7 +463,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -499,7 +499,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -546,7 +546,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 775efa6b32d..0ab81caabba 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -47,7 +47,7 @@ export class PetService implements PetServiceInterface { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -76,7 +76,7 @@ export class PetService implements PetServiceInterface { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -249,7 +249,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -308,7 +308,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -362,7 +362,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -416,7 +416,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -463,7 +463,7 @@ export class PetService implements PetServiceInterface { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -513,7 +513,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -583,7 +583,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (name !== undefined) { formParams.set('name', name); } @@ -659,7 +659,7 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 2c715fbab7c..bc30294b63a 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -46,7 +46,7 @@ export class StoreService implements StoreServiceInterface { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -75,7 +75,7 @@ export class StoreService implements StoreServiceInterface { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -170,7 +170,7 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -210,7 +210,7 @@ export class StoreService implements StoreServiceInterface { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -252,7 +252,7 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -293,7 +293,7 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 0448df9297c..031f886731e 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -46,7 +46,7 @@ export class UserService implements UserServiceInterface { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -75,7 +75,7 @@ export class UserService implements UserServiceInterface { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -235,7 +235,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -279,7 +279,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -323,7 +323,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -368,7 +368,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -410,7 +410,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -464,7 +464,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -500,7 +500,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -547,7 +547,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 25b50dd7546..f8265399f42 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -46,7 +46,7 @@ export class PetService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -75,7 +75,7 @@ export class PetService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -248,7 +248,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -274,7 +274,7 @@ export class PetService { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -307,7 +307,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -361,7 +361,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -415,7 +415,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -437,7 +437,7 @@ export class PetService { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -462,7 +462,7 @@ export class PetService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -512,7 +512,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -539,7 +539,7 @@ export class PetService { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -582,7 +582,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (name !== undefined) { formParams.set('name', name); } @@ -615,7 +615,7 @@ export class PetService { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -658,7 +658,7 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - + if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 1dd4980e43b..4f4189c369b 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -45,7 +45,7 @@ export class StoreService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class StoreService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -149,7 +149,7 @@ export class StoreService { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -169,7 +169,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -209,7 +209,7 @@ export class StoreService { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -231,7 +231,7 @@ export class StoreService { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -251,7 +251,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -292,7 +292,7 @@ export class StoreService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 4f24303f502..f9cf1b9fb71 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -45,7 +45,7 @@ export class UserService { } /** - * + * * Extends object by coping non-existing properties. * @param objA object to be extended * @param objB source object @@ -74,7 +74,7 @@ export class UserService { } public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$'); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } @@ -234,7 +234,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -278,7 +278,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -322,7 +322,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ @@ -347,7 +347,7 @@ export class UserService { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -367,7 +367,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -389,7 +389,7 @@ export class UserService { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -409,7 +409,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -463,7 +463,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -499,7 +499,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -522,7 +522,7 @@ export class UserService { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -546,7 +546,7 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - + headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ diff --git a/samples/client/petstore/typescript-angular-v4/npm/package.json b/samples/client/petstore/typescript-angular-v4/npm/package.json index 2b62278a434..a15c011fe29 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/package.json +++ b/samples/client/petstore/typescript-angular-v4/npm/package.json @@ -35,6 +35,6 @@ "typescript": "^2.1.5" }, "publishConfig": { - "registry": "https://skimdb.npmjs.com/registry" + "registry":"https://skimdb.npmjs.com/registry" } } From 2c7dcbe3e5a99101f184670ef34a8893884d2c5e Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 27 Sep 2017 22:37:42 +0800 Subject: [PATCH 078/197] fix elixir model naming --- bin/elixir-petstore.sh | 5 +++ .../languages/ElixirClientCodegen.java | 36 ++++++++++++++++++- .../lib/swagger_petstore/api/anotherFake.ex | 29 --------------- .../elixir/lib/swagger_petstore/api/fake.ex | 17 --------- .../api/fakeClassnameTags123.ex | 29 --------------- .../lib/swagger_petstore/model/enum_test.ex | 4 +-- .../lib/swagger_petstore/model/format_test.ex | 4 +-- ...{200_response.ex => model_200_response.ex} | 4 +-- .../name].ex => special_model_name.ex} | 4 +-- 9 files changed, 48 insertions(+), 84 deletions(-) delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex delete mode 100644 samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex rename samples/client/petstore/elixir/lib/swagger_petstore/model/{200_response.ex => model_200_response.ex} (75%) rename samples/client/petstore/elixir/lib/swagger_petstore/model/{__special[model/name].ex => special_model_name.ex} (71%) diff --git a/bin/elixir-petstore.sh b/bin/elixir-petstore.sh index 915a02cfc05..5145f5b4dae 100755 --- a/bin/elixir-petstore.sh +++ b/bin/elixir-petstore.sh @@ -24,6 +24,11 @@ then mvn clean package fi +# remove existing lib and model file +echo "removing existing lib, model files" +rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/model/" +rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/lib/" + # 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" args="$@ generate -t modules/swagger-codegen/src/main/resources/elixir -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l elixir -o samples/client/petstore/elixir" diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java index c62cf74cd04..0df169706b7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java @@ -66,6 +66,7 @@ public ElixirClientCodegen() { /** * Reserved words. Override this with reserved words specific to your language + * Ref: https://github.com/itsgreggreg/elixir_quick_reference#reserved-words */ reservedWords = new HashSet( Arrays.asList( @@ -355,16 +356,49 @@ public String toApiName(String name) { if (name.length() == 0) { return "Default"; } - return initialCaps(name); + return camelize(name); } @Override public String toApiFilename(String name) { + // replace - with _ e.g. created-at => created_at + name = name.replaceAll("-", "_"); + + // e.g. PetApi.go => pet_api.go return underscore(name); } + @Override + public String toModelName(String name) { + // camelize the model name + // phone_number => PhoneNumber + return camelize(toModelFilename(name)); + } + @Override public String toModelFilename(String name) { + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } + + name = sanitizeName(name); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + // model name starts with number + if (name.matches("^\\d.*")) { + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + } + return underscore(name); } diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex deleted file mode 100644 index 2a16a710eac..00000000000 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/anotherFake.ex +++ /dev/null @@ -1,29 +0,0 @@ -defmodule SwaggerPetstore.Api.AnotherFake do - @moduledoc """ - Documentation for SwaggerPetstore.Api.AnotherFake. - """ - - use Tesla - - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON - - @doc """ - To test special tags - - To test special tags - """ - def test_special_tags(body) do - method = [method: :patch] - url = [url: "/another-fake/dummy"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) - end -end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index 369b2091029..0f9468166dc 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -274,21 +274,4 @@ defmodule SwaggerPetstore.Api.Fake do |> (&Connection.request(connection, &1)).() |> decode(false) end - - @doc """ - test json serialization of form data - """ - def test_json_form_data(param, param2) do - method = [method: :get] - url = [url: "/fake/jsonFormData"] - query_params = [] - header_params = [] - body_params = [] - form_params = [body: Enum.map_join([{:"param", param}, {:"param2", param2}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) - end end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex deleted file mode 100644 index cc0c2be0835..00000000000 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fakeClassnameTags123.ex +++ /dev/null @@ -1,29 +0,0 @@ -defmodule SwaggerPetstore.Api.FakeClassnameTags123 do - @moduledoc """ - Documentation for SwaggerPetstore.Api.FakeClassnameTags123. - """ - - use Tesla - - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.JSON - - @doc """ - To test class name in snake case - - - """ - def test_classname(body) do - method = [method: :patch] - url = [url: "/fake_classname_test"] - query_params = [] - header_params = [] - body_params = [body: body] - form_params = [] - params = query_params ++ header_params ++ body_params ++ form_params - opts = [] - options = method ++ url ++ params ++ opts - - request(options) - end -end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex index d7a45b05854..efbc5dc8a12 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex @@ -2,7 +2,7 @@ # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. -defmodule SwaggerPetstore.Model.Enum_Test do +defmodule SwaggerPetstore.Model.EnumTest do @moduledoc """ """ @@ -16,7 +16,7 @@ defmodule SwaggerPetstore.Model.Enum_Test do ] end -defimpl Poison.Decoder, for: SwaggerPetstore.Model.Enum_Test do +defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumTest do import SwaggerPetstore.Deserializer def decode(value, options) do value diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex index 46e871e6f42..b612b5074c1 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex @@ -2,7 +2,7 @@ # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. -defmodule SwaggerPetstore.Model.Format_test do +defmodule SwaggerPetstore.Model.FormatTest do @moduledoc """ """ @@ -25,7 +25,7 @@ defmodule SwaggerPetstore.Model.Format_test do ] end -defimpl Poison.Decoder, for: SwaggerPetstore.Model.Format_test do +defimpl Poison.Decoder, for: SwaggerPetstore.Model.FormatTest do import SwaggerPetstore.Deserializer def decode(value, options) do value diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex similarity index 75% rename from samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex rename to samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex index a2889ebb9a4..0da12bc564e 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/200_response.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex @@ -2,7 +2,7 @@ # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. -defmodule SwaggerPetstore.Model.200_response do +defmodule SwaggerPetstore.Model.Model200Response do @moduledoc """ Model for testing model name starting with number """ @@ -14,7 +14,7 @@ defmodule SwaggerPetstore.Model.200_response do ] end -defimpl Poison.Decoder, for: SwaggerPetstore.Model.200_response do +defimpl Poison.Decoder, for: SwaggerPetstore.Model.Model200Response do def decode(value, _options) do value end diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex similarity index 71% rename from samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex rename to samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex index f11d928a90f..0179846711e 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/__special[model/name].ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex @@ -2,7 +2,7 @@ # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. -defmodule SwaggerPetstore.Model.$special[model.name] do +defmodule SwaggerPetstore.Model.SpecialModelName do @moduledoc """ """ @@ -13,7 +13,7 @@ defmodule SwaggerPetstore.Model.$special[model.name] do ] end -defimpl Poison.Decoder, for: SwaggerPetstore.Model.$special[model.name] do +defimpl Poison.Decoder, for: SwaggerPetstore.Model.SpecialModelName do def decode(value, _options) do value end From d04b7642f6b9311b827ff1bd52a217accca877f6 Mon Sep 17 00:00:00 2001 From: Kenny Jones Date: Thu, 28 Sep 2017 01:17:48 -0400 Subject: [PATCH 079/197] Feature: Adds doc generation (#6570) Reference #2359 --- .../codegen/languages/BashClientCodegen.java | 120 ++++++- .../src/main/resources/bash/README.mustache | 40 ++- .../src/main/resources/bash/api_doc.mustache | 47 +++ .../src/main/resources/bash/client.mustache | 6 +- .../main/resources/bash/model_doc.mustache | 11 + samples/client/petstore/bash/README.md | 112 ++++++- .../bash/docs/$special[model.name].md | 10 + .../client/petstore/bash/docs/200_response.md | 11 + .../bash/docs/AdditionalPropertiesClass.md | 11 + samples/client/petstore/bash/docs/Animal.md | 11 + .../client/petstore/bash/docs/AnimalFarm.md | 9 + .../petstore/bash/docs/AnotherFakeApi.md | 41 +++ .../client/petstore/bash/docs/ApiResponse.md | 12 + .../bash/docs/ArrayOfArrayOfNumberOnly.md | 10 + .../petstore/bash/docs/ArrayOfNumberOnly.md | 10 + .../client/petstore/bash/docs/ArrayTest.md | 12 + .../petstore/bash/docs/Capitalization.md | 15 + samples/client/petstore/bash/docs/Cat.md | 12 + samples/client/petstore/bash/docs/Category.md | 11 + .../client/petstore/bash/docs/ClassModel.md | 10 + samples/client/petstore/bash/docs/Client.md | 10 + samples/client/petstore/bash/docs/Dog.md | 12 + .../client/petstore/bash/docs/EnumArrays.md | 11 + .../client/petstore/bash/docs/EnumClass.md | 9 + .../client/petstore/bash/docs/Enum_Test.md | 13 + samples/client/petstore/bash/docs/FakeApi.md | 302 ++++++++++++++++++ .../bash/docs/FakeClassnameTags123Api.md | 39 +++ .../client/petstore/bash/docs/Format_test.md | 22 ++ .../petstore/bash/docs/HasOnlyReadOnly.md | 11 + samples/client/petstore/bash/docs/MapTest.md | 11 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + samples/client/petstore/bash/docs/Name.md | 13 + .../client/petstore/bash/docs/NumberOnly.md | 10 + samples/client/petstore/bash/docs/Order.md | 15 + .../client/petstore/bash/docs/OuterBoolean.md | 9 + .../petstore/bash/docs/OuterComposite.md | 12 + .../client/petstore/bash/docs/OuterEnum.md | 9 + .../client/petstore/bash/docs/OuterNumber.md | 9 + .../client/petstore/bash/docs/OuterString.md | 9 + samples/client/petstore/bash/docs/Pet.md | 15 + samples/client/petstore/bash/docs/PetApi.md | 277 ++++++++++++++++ .../petstore/bash/docs/ReadOnlyFirst.md | 11 + samples/client/petstore/bash/docs/Return.md | 10 + samples/client/petstore/bash/docs/StoreApi.md | 137 ++++++++ samples/client/petstore/bash/docs/Tag.md | 11 + samples/client/petstore/bash/docs/User.md | 17 + samples/client/petstore/bash/docs/UserApi.md | 271 ++++++++++++++++ samples/client/petstore/bash/petstore-cli | 38 +-- 48 files changed, 1815 insertions(+), 31 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/bash/api_doc.mustache create mode 100644 modules/swagger-codegen/src/main/resources/bash/model_doc.mustache create mode 100644 samples/client/petstore/bash/docs/$special[model.name].md create mode 100644 samples/client/petstore/bash/docs/200_response.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/bash/docs/Animal.md create mode 100644 samples/client/petstore/bash/docs/AnimalFarm.md create mode 100644 samples/client/petstore/bash/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/bash/docs/ApiResponse.md create mode 100644 samples/client/petstore/bash/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/bash/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/bash/docs/ArrayTest.md create mode 100644 samples/client/petstore/bash/docs/Capitalization.md create mode 100644 samples/client/petstore/bash/docs/Cat.md create mode 100644 samples/client/petstore/bash/docs/Category.md create mode 100644 samples/client/petstore/bash/docs/ClassModel.md create mode 100644 samples/client/petstore/bash/docs/Client.md create mode 100644 samples/client/petstore/bash/docs/Dog.md create mode 100644 samples/client/petstore/bash/docs/EnumArrays.md create mode 100644 samples/client/petstore/bash/docs/EnumClass.md create mode 100644 samples/client/petstore/bash/docs/Enum_Test.md create mode 100644 samples/client/petstore/bash/docs/FakeApi.md create mode 100644 samples/client/petstore/bash/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/bash/docs/Format_test.md create mode 100644 samples/client/petstore/bash/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/bash/docs/MapTest.md create mode 100644 samples/client/petstore/bash/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/bash/docs/Name.md create mode 100644 samples/client/petstore/bash/docs/NumberOnly.md create mode 100644 samples/client/petstore/bash/docs/Order.md create mode 100644 samples/client/petstore/bash/docs/OuterBoolean.md create mode 100644 samples/client/petstore/bash/docs/OuterComposite.md create mode 100644 samples/client/petstore/bash/docs/OuterEnum.md create mode 100644 samples/client/petstore/bash/docs/OuterNumber.md create mode 100644 samples/client/petstore/bash/docs/OuterString.md create mode 100644 samples/client/petstore/bash/docs/Pet.md create mode 100644 samples/client/petstore/bash/docs/PetApi.md create mode 100644 samples/client/petstore/bash/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/bash/docs/Return.md create mode 100644 samples/client/petstore/bash/docs/StoreApi.md create mode 100644 samples/client/petstore/bash/docs/Tag.md create mode 100644 samples/client/petstore/bash/docs/User.md create mode 100644 samples/client/petstore/bash/docs/UserApi.md diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java index de7ae732d8b..e80fd0961d0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/BashClientCodegen.java @@ -39,7 +39,8 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { protected String hostEnvironmentVariable; protected String basicAuthEnvironmentVariable; protected String apiKeyAuthEnvironmentVariable; - + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; public static final String CURL_OPTIONS = "curlOptions"; public static final String PROCESS_MARKDOWN = "processMarkdown"; @@ -105,6 +106,13 @@ public BashClientCodegen() { apiTemplateFiles.clear(); + /** + * docs files. + */ + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + + /** * Templates location for client script and bash completion template. */ @@ -169,6 +177,7 @@ public BashClientCodegen() { typeMapping.put("int", "integer"); typeMapping.put("float", "float"); typeMapping.put("number", "integer"); + typeMapping.put("date", "string"); typeMapping.put("DateTime", "string"); typeMapping.put("long", "integer"); typeMapping.put("short", "integer"); @@ -185,12 +194,22 @@ public BashClientCodegen() { * are available in models, apis, and supporting files. */ additionalProperties.put("apiVersion", apiVersion); + // make api and model doc path available in mustache template + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); /** * Language Specific Primitives. These types will not trigger imports by * the client generator */ - languageSpecificPrimitives = new HashSet(); + languageSpecificPrimitives.clear(); + languageSpecificPrimitives.add("array"); + languageSpecificPrimitives.add("map"); + languageSpecificPrimitives.add("boolean"); + languageSpecificPrimitives.add("integer"); + languageSpecificPrimitives.add("float"); + languageSpecificPrimitives.add("string"); + languageSpecificPrimitives.add("binary"); } @@ -239,15 +258,15 @@ public void processOpts() { } supportingFiles.add(new SupportingFile( - "client.mustache", "", scriptName)); + "client.mustache", "", scriptName)); supportingFiles.add(new SupportingFile( - "bash-completion.mustache", "", scriptName+".bash-completion")); + "bash-completion.mustache", "", scriptName+".bash-completion")); supportingFiles.add(new SupportingFile( - "zsh-completion.mustache", "", "_"+scriptName)); + "zsh-completion.mustache", "", "_"+scriptName)); supportingFiles.add(new SupportingFile( - "README.mustache", "", "README.md")); + "README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile( - "Dockerfile.mustache", "", "Dockerfile")); + "Dockerfile.mustache", "", "Dockerfile")); } public void setCurlOptions(String curlOptions) { @@ -314,6 +333,25 @@ public String apiFileFolder() { return outputFolder; } + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } /** * Optional - type declaration. This is a String which is used by the @@ -355,8 +393,9 @@ public String getSwaggerType(Property p) { if(languageSpecificPrimitives.contains(type)) return type; } - else + else { type = swaggerType; + } return toModelName(type); } @@ -656,4 +695,69 @@ public void preprocessSwagger(Swagger swagger) { } + @Override + public void setParameterExampleValue(CodegenParameter p) { + String example; + + if (p.defaultValue == null) { + example = p.example; + } else { + example = p.defaultValue; + } + + String type = p.baseType; + if (type == null) { + type = p.dataType; + } + + if ("string".equalsIgnoreCase(type)) { + if (example == null) { + example = p.paramName + "_example"; + } + example = "'" + escapeText(example) + "'"; + } else if ("integer".equals(type)) { + if (example == null) { + example = "56"; + } + } else if ("float".equalsIgnoreCase(type)) { + if (example == null) { + example = "3.4"; + } + } else if ("boolean".equalsIgnoreCase(type)) { + if (example == null) { + example = "True"; + } + } else if ("file".equalsIgnoreCase(type)) { + if (example == null) { + example = "/path/to/file"; + } + example = "'" + escapeText(example) + "'"; + } else if ("date".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20"; + } + example = "'" + escapeText(example) + "'"; + } else if ("datetime".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20T19:20:30+01:00"; + } + example = "'" + escapeText(example) + "'"; + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = type; + } else { + LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); + } + + if (example == null) { + example = "NULL"; + } else if (Boolean.TRUE.equals(p.isListContainer)) { + example = "[" + example + "]"; + } else if (Boolean.TRUE.equals(p.isMapContainer)) { + example = "{'key': " + example + "}"; + } + + p.example = example; + } + } diff --git a/modules/swagger-codegen/src/main/resources/bash/README.mustache b/modules/swagger-codegen/src/main/resources/bash/README.mustache index bbb85fb225b..db1abc26ffd 100644 --- a/modules/swagger-codegen/src/main/resources/bash/README.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/README.mustache @@ -3,7 +3,7 @@ ## Overview This is a Bash client script for accessing {{appName}} service. -The script uses cURL underneath for making all REST calls. +The script uses cURL underneath for making all REST calls. ## Usage @@ -86,3 +86,41 @@ fi ### Zsh In Zsh, the generated `_{{scriptName}}` Zsh completion file must be copied to one of the folders under `$FPATH` variable. + + +## Documentation for API Endpoints + +All URIs are relative to *{{basePathWithoutHost}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}} All endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}}## {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}}{{#authorizationUrl}} +- **Authorization URL**: {{{authorizationUrl}}}{{/authorizationUrl}}{{#tokenUrl}} +- **Token URL**: {{{tokenUrl}}}{{/tokenUrl}} +- **Scopes**:{{^scopes}} N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/modules/swagger-codegen/src/main/resources/bash/api_doc.mustache b/modules/swagger-codegen/src/main/resources/bash/api_doc.mustache new file mode 100644 index 00000000000..8b663e4772f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/bash/api_doc.mustache @@ -0,0 +1,47 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePathWithoutHost}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +## **{{{operationId}}}** + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example +```bash +{{scriptName}} {{operationId}}{{#allParams}}{{#isPathParam}} {{baseName}}=value{{/isPathParam}}{{#isQueryParam}} {{#isContainer}} Specify as: {{#vendorExtensions}}{{#x-codegen-collection-multi}} {{baseName}}=value1 {{baseName}}=value2 {{baseName}}=...{{/x-codegen-collection-multi}}{{#x-codegen-collection-csv}} {{baseName}}="value1,value2,..."{{/x-codegen-collection-csv}}{{#x-codegen-collection-pipes}} {{baseName}}="value1|value2|..."{{/x-codegen-collection-pipes}}{{#x-codegen-collection-ssv}} {{baseName}}="value1 value2 ..."{{/x-codegen-collection-ssv}}{{#x-codegen-collection-tsv}} {{baseName}}="value1\\tvalue2\\t..."{{/x-codegen-collection-tsv}}{{/vendorExtensions}}{{/isContainer}}{{^isContainer}} {{baseName}}=value{{/isContainer}}{{/isQueryParam}}{{#isHeaderParam}} {{baseName}}:value{{/isHeaderParam}}{{#isBodyParam}}{{#vendorExtensions}}{{#x-codegen-body-example}} '{{{x-codegen-body-example}}}'{{/x-codegen-body-example}}{{/vendorExtensions}}{{/isBodyParam}}{{/allParams}} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}} | {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}(empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not Applicable{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not Applicable{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index 0922d286b83..d97b85bafb2 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -577,9 +577,11 @@ EOF {{#x-codegen-apikey-env}}echo -e " or export ${RED}{{x-codegen-apikey-env}}=''${OFF}"{{/x-codegen-apikey-env}} {{/isApiKey}} {{#isOAuth}} - echo -e " - ${MAGENTA}OAuth2 (flow: {{flow}})${OFF}" + echo -e " - ${MAGENTA}OAuth2 (flow: {{flow}})${OFF}"{{#authorizationUrl}} echo -e " Authorization URL: " - echo -e " * {{authorizationUrl}}" + echo -e " * {{authorizationUrl}}"{{/authorizationUrl}}{{#tokenUrl}} + echo -e " Token URL: " + echo -e " * {{tokenUrl}}"{{/tokenUrl}} echo -e " Scopes:" {{#scopes}} echo -e " * {{scope}} - {{description}}" diff --git a/modules/swagger-codegen/src/main/resources/bash/model_doc.mustache b/modules/swagger-codegen/src/main/resources/bash/model_doc.mustache new file mode 100644 index 00000000000..ad08afe6397 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/bash/model_doc.mustache @@ -0,0 +1,11 @@ +{{#models}}{{#model}}# {{name}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{title}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 619928a4026..534b292a6a7 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -3,7 +3,7 @@ ## Overview This is a Bash client script for accessing Swagger Petstore service. -The script uses cURL underneath for making all REST calls. +The script uses cURL underneath for making all REST calls. ## Usage @@ -86,3 +86,113 @@ fi ### Zsh In Zsh, the generated `_petstore-cli` Zsh completion file must be copied to one of the folders under `$FPATH` variable. + + +## Documentation for API Endpoints + +All URIs are relative to */v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [$special[model.name]](docs/$special[model.name].md) + - [200_response](docs/200_response.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [Enum_Test](docs/Enum_Test.md) + - [Format_test](docs/Format_test.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Return](docs/Return.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + - [Cat](docs/Cat.md) + - [Dog](docs/Dog.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + diff --git a/samples/client/petstore/bash/docs/$special[model.name].md b/samples/client/petstore/bash/docs/$special[model.name].md new file mode 100644 index 00000000000..2b02e4cece0 --- /dev/null +++ b/samples/client/petstore/bash/docs/$special[model.name].md @@ -0,0 +1,10 @@ +# $special[model.name] + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$special[property.name]** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/200_response.md b/samples/client/petstore/bash/docs/200_response.md new file mode 100644 index 00000000000..b575df6f2eb --- /dev/null +++ b/samples/client/petstore/bash/docs/200_response.md @@ -0,0 +1,11 @@ +# 200_response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **integer** | | [optional] [default to null] +**class** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..70fe49c1edf --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **map[String, string]** | | [optional] [default to null] +**map_of_map_property** | **map[String, map[String, string]]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Animal.md b/samples/client/petstore/bash/docs/Animal.md new file mode 100644 index 00000000000..ea3395629b8 --- /dev/null +++ b/samples/client/petstore/bash/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **string** | | [default to null] +**color** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AnimalFarm.md b/samples/client/petstore/bash/docs/AnimalFarm.md new file mode 100644 index 00000000000..df6bab21dae --- /dev/null +++ b/samples/client/petstore/bash/docs/AnimalFarm.md @@ -0,0 +1,9 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..039b7f381c6 --- /dev/null +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -0,0 +1,41 @@ +# AnotherFakeApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + +## **testSpecialTags** + +To test special tags + +To test special tags + +### Example +```bash +petstore-cli testSpecialTags +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/ApiResponse.md b/samples/client/petstore/bash/docs/ApiResponse.md new file mode 100644 index 00000000000..9ca9e51945f --- /dev/null +++ b/samples/client/petstore/bash/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **integer** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**message** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/bash/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..76d03f4d1ba --- /dev/null +++ b/samples/client/petstore/bash/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **array[array[integer]]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/ArrayOfNumberOnly.md b/samples/client/petstore/bash/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..c299fcd3c4b --- /dev/null +++ b/samples/client/petstore/bash/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **array[integer]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/ArrayTest.md b/samples/client/petstore/bash/docs/ArrayTest.md new file mode 100644 index 00000000000..6c86d88f309 --- /dev/null +++ b/samples/client/petstore/bash/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **array[string]** | | [optional] [default to null] +**array_array_of_integer** | **array[array[integer]]** | | [optional] [default to null] +**array_array_of_model** | **array[array[ReadOnlyFirst]]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Capitalization.md b/samples/client/petstore/bash/docs/Capitalization.md new file mode 100644 index 00000000000..362258aa0d4 --- /dev/null +++ b/samples/client/petstore/bash/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **string** | | [optional] [default to null] +**CapitalCamel** | **string** | | [optional] [default to null] +**small_Snake** | **string** | | [optional] [default to null] +**Capital_Snake** | **string** | | [optional] [default to null] +**SCA_ETH_Flow_Points** | **string** | | [optional] [default to null] +**ATT_NAME** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Cat.md b/samples/client/petstore/bash/docs/Cat.md new file mode 100644 index 00000000000..6b75b077f21 --- /dev/null +++ b/samples/client/petstore/bash/docs/Cat.md @@ -0,0 +1,12 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **string** | | [default to null] +**color** | **string** | | [optional] [default to null] +**declawed** | **boolean** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Category.md b/samples/client/petstore/bash/docs/Category.md new file mode 100644 index 00000000000..5af29e81851 --- /dev/null +++ b/samples/client/petstore/bash/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **integer** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/ClassModel.md b/samples/client/petstore/bash/docs/ClassModel.md new file mode 100644 index 00000000000..7979502a642 --- /dev/null +++ b/samples/client/petstore/bash/docs/ClassModel.md @@ -0,0 +1,10 @@ +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Client.md b/samples/client/petstore/bash/docs/Client.md new file mode 100644 index 00000000000..cbe0f4e3c20 --- /dev/null +++ b/samples/client/petstore/bash/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Dog.md b/samples/client/petstore/bash/docs/Dog.md new file mode 100644 index 00000000000..9947ad0b79b --- /dev/null +++ b/samples/client/petstore/bash/docs/Dog.md @@ -0,0 +1,12 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **string** | | [default to null] +**color** | **string** | | [optional] [default to null] +**breed** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/EnumArrays.md b/samples/client/petstore/bash/docs/EnumArrays.md new file mode 100644 index 00000000000..70798f4be67 --- /dev/null +++ b/samples/client/petstore/bash/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **string** | | [optional] [default to null] +**array_enum** | **array[string]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/EnumClass.md b/samples/client/petstore/bash/docs/EnumClass.md new file mode 100644 index 00000000000..67f017becd0 --- /dev/null +++ b/samples/client/petstore/bash/docs/EnumClass.md @@ -0,0 +1,9 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Enum_Test.md b/samples/client/petstore/bash/docs/Enum_Test.md new file mode 100644 index 00000000000..b9de3aae862 --- /dev/null +++ b/samples/client/petstore/bash/docs/Enum_Test.md @@ -0,0 +1,13 @@ +# Enum_Test + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **string** | | [optional] [default to null] +**enum_integer** | **integer** | | [optional] [default to null] +**enum_number** | **float** | | [optional] [default to null] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md new file mode 100644 index 00000000000..a79c43542a3 --- /dev/null +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -0,0 +1,302 @@ +# FakeApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**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 +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + +## **fakeOuterBooleanSerialize** + + + +Test serialization of outer boolean types + +### Example +```bash +petstore-cli fakeOuterBooleanSerialize +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md) | Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **fakeOuterCompositeSerialize** + + + +Test serialization of object with outer number type + +### Example +```bash +petstore-cli fakeOuterCompositeSerialize +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **fakeOuterNumberSerialize** + + + +Test serialization of outer number types + +### Example +```bash +petstore-cli fakeOuterNumberSerialize +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md) | Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **fakeOuterStringSerialize** + + + +Test serialization of outer string types + +### Example +```bash +petstore-cli fakeOuterStringSerialize +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md) | Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **testClientModel** + +To test \"client\" model + +To test \"client\" model + +### Example +```bash +petstore-cli testClientModel +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **testEndpointParameters** + +Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 + +Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 + +### Example +```bash +petstore-cli testEndpointParameters +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **integer** | None | + **double** | **float** | None | + **patternWithoutDelimiter** | **string** | None | + **byte** | **string** | None | + **integer** | **integer** | None | [optional] + **int32** | **integer** | None | [optional] + **int64** | **integer** | None | [optional] + **float** | **float** | None | [optional] + **string** | **string** | None | [optional] + **binary** | **binary** | None | [optional] + **date** | **string** | None | [optional] + **dateTime** | **string** | None | [optional] + **password** | **string** | None | [optional] + **callback** | **string** | None | [optional] + +### Return type + +(empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **testEnumParameters** + +To test enum parameters + +To test enum parameters + +### Example +```bash +petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string=value enum_query_integer=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumFormStringArray** | [**array[string]**](string.md) | Form parameter enum test (string array) | [optional] + **enumFormString** | **string** | Form parameter enum test (string) | [optional] [default to -efg] + **enumHeaderStringArray** | [**array[string]**](string.md) | Header parameter enum test (string array) | [optional] + **enumHeaderString** | **string** | Header parameter enum test (string) | [optional] [default to -efg] + **enumQueryStringArray** | [**array[string]**](string.md) | Query parameter enum test (string array) | [optional] + **enumQueryString** | **string** | Query parameter enum test (string) | [optional] [default to -efg] + **enumQueryInteger** | **integer** | Query parameter enum test (double) | [optional] + **enumQueryDouble** | **float** | Query parameter enum test (double) | [optional] + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **testJsonFormData** + +test json serialization of form data + + + +### Example +```bash +petstore-cli testJsonFormData +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **string** | field1 | + **param2** | **string** | field2 | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..00a1f8b36be --- /dev/null +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -0,0 +1,39 @@ +# FakeClassnameTags123Api + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +## **testClassname** + +To test class name in snake case + +### Example +```bash +petstore-cli testClassname +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/Format_test.md b/samples/client/petstore/bash/docs/Format_test.md new file mode 100644 index 00000000000..8f73bb59bbc --- /dev/null +++ b/samples/client/petstore/bash/docs/Format_test.md @@ -0,0 +1,22 @@ +# format_test + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [default to null] +**int32** | **integer** | | [optional] [default to null] +**int64** | **integer** | | [optional] [default to null] +**number** | **integer** | | [default to null] +**float** | **float** | | [optional] [default to null] +**double** | **float** | | [optional] [default to null] +**string** | **string** | | [optional] [default to null] +**byte** | **string** | | [default to null] +**binary** | **binary** | | [optional] [default to null] +**date** | **string** | | [default to null] +**dateTime** | **string** | | [optional] [default to null] +**uuid** | **string** | | [optional] [default to null] +**password** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/HasOnlyReadOnly.md b/samples/client/petstore/bash/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..136c1624714 --- /dev/null +++ b/samples/client/petstore/bash/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# hasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **string** | | [optional] [default to null] +**foo** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/MapTest.md b/samples/client/petstore/bash/docs/MapTest.md new file mode 100644 index 00000000000..31ca86b91c1 --- /dev/null +++ b/samples/client/petstore/bash/docs/MapTest.md @@ -0,0 +1,11 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **map[String, map[String, string]]** | | [optional] [default to null] +**map_of_enum_string** | **map[String, string]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..ce8cc62c694 --- /dev/null +++ b/samples/client/petstore/bash/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **string** | | [optional] [default to null] +**dateTime** | **string** | | [optional] [default to null] +**map** | [**map[String, Animal]**](Animal.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Name.md b/samples/client/petstore/bash/docs/Name.md new file mode 100644 index 00000000000..8f59de26d01 --- /dev/null +++ b/samples/client/petstore/bash/docs/Name.md @@ -0,0 +1,13 @@ +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **integer** | | [default to null] +**snake_case** | **integer** | | [optional] [default to null] +**property** | **string** | | [optional] [default to null] +**123Number** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/NumberOnly.md b/samples/client/petstore/bash/docs/NumberOnly.md new file mode 100644 index 00000000000..5e0f270ec27 --- /dev/null +++ b/samples/client/petstore/bash/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Order.md b/samples/client/petstore/bash/docs/Order.md new file mode 100644 index 00000000000..d8b67f7f972 --- /dev/null +++ b/samples/client/petstore/bash/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **integer** | | [optional] [default to null] +**petId** | **integer** | | [optional] [default to null] +**quantity** | **integer** | | [optional] [default to null] +**shipDate** | **string** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] +**complete** | **boolean** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterBoolean.md b/samples/client/petstore/bash/docs/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterComposite.md b/samples/client/petstore/bash/docs/OuterComposite.md new file mode 100644 index 00000000000..78c79032912 --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] [default to null] +**my_string** | [**OuterString**](OuterString.md) | | [optional] [default to null] +**my_boolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterEnum.md b/samples/client/petstore/bash/docs/OuterEnum.md new file mode 100644 index 00000000000..06d413b0168 --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterEnum.md @@ -0,0 +1,9 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterNumber.md b/samples/client/petstore/bash/docs/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterString.md b/samples/client/petstore/bash/docs/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Pet.md b/samples/client/petstore/bash/docs/Pet.md new file mode 100644 index 00000000000..b86df96bb59 --- /dev/null +++ b/samples/client/petstore/bash/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **integer** | | [optional] [default to null] +**category** | [**Category**](Category.md) | | [optional] [default to null] +**name** | **string** | | [default to null] +**photoUrls** | **array[string]** | | [default to null] +**tags** | [**array[Tag]**](Tag.md) | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md new file mode 100644 index 00000000000..661ee03cbbf --- /dev/null +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -0,0 +1,277 @@ +# PetApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +## **addPet** + +Add a new pet to the store + + + +### Example +```bash +petstore-cli addPet +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +(empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **deletePet** + +Deletes a pet + + + +### Example +```bash +petstore-cli deletePet petId=value api_key:value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **integer** | Pet id to delete | + **apiKey** | **string** | | [optional] + +### Return type + +(empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **findPetsByStatus** + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```bash +petstore-cli findPetsByStatus Specify as: status="value1,value2,..." +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**array[string]**](string.md) | Status values that need to be considered for filter | + +### Return type + +[**array[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **findPetsByTags** + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```bash +petstore-cli findPetsByTags Specify as: tags="value1,value2,..." +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**array[string]**](string.md) | Tags to filter by | + +### Return type + +[**array[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **getPetById** + +Find pet by ID + +Returns a single pet + +### Example +```bash +petstore-cli getPetById petId=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **integer** | ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **updatePet** + +Update an existing pet + + + +### Example +```bash +petstore-cli updatePet +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +(empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **updatePetWithForm** + +Updates a pet in the store with form data + + + +### Example +```bash +petstore-cli updatePetWithForm petId=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **integer** | ID of pet that needs to be updated | + **name** | **string** | Updated name of the pet | [optional] + **status** | **string** | Updated status of the pet | [optional] + +### Return type + +(empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **uploadFile** + +uploads an image + + + +### Example +```bash +petstore-cli uploadFile petId=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **integer** | ID of pet to update | + **additionalMetadata** | **string** | Additional data to pass to server | [optional] + **file** | **File** | file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/ReadOnlyFirst.md b/samples/client/petstore/bash/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..de713c7197b --- /dev/null +++ b/samples/client/petstore/bash/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **string** | | [optional] [default to null] +**baz** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Return.md b/samples/client/petstore/bash/docs/Return.md new file mode 100644 index 00000000000..dfe5ec9bb45 --- /dev/null +++ b/samples/client/petstore/bash/docs/Return.md @@ -0,0 +1,10 @@ +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md new file mode 100644 index 00000000000..8e4bd83d3c4 --- /dev/null +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -0,0 +1,137 @@ +# StoreApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +## **deleteOrder** + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```bash +petstore-cli deleteOrder order_id=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string** | ID of the order that needs to be deleted | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **getInventory** + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```bash +petstore-cli getInventory +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**map[String, integer]** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **getOrderById** + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```bash +petstore-cli getOrderById order_id=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **integer** | ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **placeOrder** + +Place an order for a pet + + + +### Example +```bash +petstore-cli placeOrder +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md) | order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/Tag.md b/samples/client/petstore/bash/docs/Tag.md new file mode 100644 index 00000000000..ce2d01c66e4 --- /dev/null +++ b/samples/client/petstore/bash/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **integer** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/User.md b/samples/client/petstore/bash/docs/User.md new file mode 100644 index 00000000000..1323b94963b --- /dev/null +++ b/samples/client/petstore/bash/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **integer** | | [optional] [default to null] +**username** | **string** | | [optional] [default to null] +**firstName** | **string** | | [optional] [default to null] +**lastName** | **string** | | [optional] [default to null] +**email** | **string** | | [optional] [default to null] +**password** | **string** | | [optional] [default to null] +**phone** | **string** | | [optional] [default to null] +**userStatus** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md new file mode 100644 index 00000000000..e2d48888ed6 --- /dev/null +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -0,0 +1,271 @@ +# UserApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## **createUser** + +Create user + +This can only be done by the logged in user. + +### Example +```bash +petstore-cli createUser +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md) | Created user object | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **createUsersWithArrayInput** + +Creates list of users with given input array + + + +### Example +```bash +petstore-cli createUsersWithArrayInput +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**array[User]**](User.md) | List of user object | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **createUsersWithListInput** + +Creates list of users with given input array + + + +### Example +```bash +petstore-cli createUsersWithListInput +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**array[User]**](User.md) | List of user object | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **deleteUser** + +Delete user + +This can only be done by the logged in user. + +### Example +```bash +petstore-cli deleteUser username=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string** | The name that needs to be deleted | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **getUserByName** + +Get user by user name + + + +### Example +```bash +petstore-cli getUserByName username=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string** | The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **loginUser** + +Logs user into the system + + + +### Example +```bash +petstore-cli loginUser username=value password=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string** | The user name for login | + **password** | **string** | The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **logoutUser** + +Logs out current logged in user session + + + +### Example +```bash +petstore-cli logoutUser +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## **updateUser** + +Updated user + +This can only be done by the logged in user. + +### Example +```bash +petstore-cli updateUser username=value +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string** | name that need to be deleted | + **body** | [**User**](User.md) | Updated user object | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not Applicable + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 04b0fd2f634..ea797959531 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -940,13 +940,13 @@ print_testEnumParameters_help() { echo -e "To test enum parameters" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}enum_header_string_array${OFF} ${BLUE}[Array[String]]${OFF}${OFF} - Header parameter enum test (string array) ${YELLOW}Specify as: enum_header_string_array:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}enum_header_string${OFF} ${BLUE}[String]${OFF} ${CYAN}(default: -efg)${OFF} - Header parameter enum test (string) ${YELLOW}Specify as: enum_header_string:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}enum_query_string_array${OFF} ${BLUE}[Array[String]]${OFF}${OFF} - Query parameter enum test (string array)${YELLOW} Specify as: ${OFF}" \ + echo -e " * ${GREEN}enum_header_string_array${OFF} ${BLUE}[array[string]]${OFF}${OFF} - Header parameter enum test (string array) ${YELLOW}Specify as: enum_header_string_array:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}enum_header_string${OFF} ${BLUE}[string]${OFF} ${CYAN}(default: -efg)${OFF} - Header parameter enum test (string) ${YELLOW}Specify as: enum_header_string:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}enum_query_string_array${OFF} ${BLUE}[array[string]]${OFF}${OFF} - Query parameter enum test (string array)${YELLOW} Specify as: ${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}enum_query_string${OFF} ${BLUE}[String]${OFF} ${CYAN}(default: -efg)${OFF} - Query parameter enum test (string)${YELLOW} Specify as: enum_query_string=value${OFF}" \ + echo -e " * ${GREEN}enum_query_string${OFF} ${BLUE}[string]${OFF} ${CYAN}(default: -efg)${OFF} - Query parameter enum test (string)${YELLOW} Specify as: enum_query_string=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}enum_query_integer${OFF} ${BLUE}[Integer]${OFF}${OFF} - Query parameter enum test (double)${YELLOW} Specify as: enum_query_integer=value${OFF}" \ + echo -e " * ${GREEN}enum_query_integer${OFF} ${BLUE}[integer]${OFF}${OFF} - Query parameter enum test (double)${YELLOW} Specify as: enum_query_integer=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" @@ -1020,8 +1020,8 @@ print_deletePet_help() { echo -e "" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}petId${OFF} ${BLUE}[Integer]${OFF} ${RED}(required)${OFF}${OFF} - Pet id to delete ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}api_key${OFF} ${BLUE}[String]${OFF}${OFF} - ${YELLOW}Specify as: api_key:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}petId${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - Pet id to delete ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}api_key${OFF} ${BLUE}[string]${OFF}${OFF} - ${YELLOW}Specify as: api_key:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=400 @@ -1039,7 +1039,7 @@ print_findPetsByStatus_help() { echo -e "Multiple status values can be provided with comma separated strings" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}status${OFF} ${BLUE}[Array[String]]${OFF} ${RED}(required)${OFF}${OFF} - Status values that need to be considered for filter${YELLOW} Specify as: status="value1,value2,..."${OFF}" \ + echo -e " * ${GREEN}status${OFF} ${BLUE}[array[string]]${OFF} ${RED}(required)${OFF}${OFF} - Status values that need to be considered for filter${YELLOW} Specify as: status="value1,value2,..."${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" @@ -1060,7 +1060,7 @@ print_findPetsByTags_help() { echo -e "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}tags${OFF} ${BLUE}[Array[String]]${OFF} ${RED}(required)${OFF}${OFF} - Tags to filter by${YELLOW} Specify as: tags="value1,value2,..."${OFF}" \ + echo -e " * ${GREEN}tags${OFF} ${BLUE}[array[string]]${OFF} ${RED}(required)${OFF}${OFF} - Tags to filter by${YELLOW} Specify as: tags="value1,value2,..."${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" @@ -1081,7 +1081,7 @@ print_getPetById_help() { echo -e "Returns a single pet" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}petId${OFF} ${BLUE}[Integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet to return ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}petId${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet to return ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1126,7 +1126,7 @@ print_updatePetWithForm_help() { echo -e "" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}petId${OFF} ${BLUE}[Integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet that needs to be updated ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}petId${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet that needs to be updated ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=405 @@ -1144,7 +1144,7 @@ print_uploadFile_help() { echo -e "" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}petId${OFF} ${BLUE}[Integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet to update ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}petId${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet to update ${YELLOW}Specify as: petId=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1162,7 +1162,7 @@ print_deleteOrder_help() { echo -e "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}order_id${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - ID of the order that needs to be deleted ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}order_id${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - ID of the order that needs to be deleted ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=400 @@ -1198,7 +1198,7 @@ print_getOrderById_help() { echo -e "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}order_id${OFF} ${BLUE}[Integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}order_id${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1298,7 +1298,7 @@ print_deleteUser_help() { echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=400 @@ -1318,7 +1318,7 @@ print_getUserByName_help() { echo -e "" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1340,9 +1340,9 @@ print_loginUser_help() { echo -e "" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}password${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ + echo -e " * ${GREEN}password${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" @@ -1382,7 +1382,7 @@ print_updateUser_help() { echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[String]${OFF} ${RED}(required)${OFF}${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e "" echo "" From 4c31983bd3c82823db02ec20620fff434b73b1dc Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 28 Sep 2017 14:01:37 +0800 Subject: [PATCH 080/197] fix JS help text --- .../io/swagger/codegen/languages/JavascriptClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 729f78e3017..78807fbd576 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -197,7 +197,7 @@ public JavascriptClientCodegen() { .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(USE_ES6, "use JavaScript ES6 (ECMAScript 6)") - .defaultValue(Boolean.FALSE.toString())); + .defaultValue(Boolean.TRUE.toString())); } @Override From 87a9caa33f51be0fb214e0a0999c6b574468af0b Mon Sep 17 00:00:00 2001 From: Kenny Jones Date: Thu, 28 Sep 2017 02:14:47 -0400 Subject: [PATCH 081/197] Bugfix: Path replacement regex not working (#6580) A previous change to make the regex a variable to allow proper linting resulted in the regexp not having access to the value associated with the variable and the path variable not being replaced. Moves the regexp variable inside the for loop to allow the value to be used and the path variable to be replaced with the provided value. --- modules/swagger-codegen/src/main/resources/bash/client.mustache | 2 +- samples/client/petstore/bash/petstore-cli | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/bash/client.mustache b/modules/swagger-codegen/src/main/resources/bash/client.mustache index d97b85bafb2..92e62eaa55d 100644 --- a/modules/swagger-codegen/src/main/resources/bash/client.mustache +++ b/modules/swagger-codegen/src/main/resources/bash/client.mustache @@ -407,8 +407,8 @@ build_request_path() { fi # First replace all path parameters in the path - local path_regex="(.*)(\\{$pparam\\})(.*)" for pparam in "${path_params[@]}"; do + local path_regex="(.*)(\\{$pparam\\})(.*)" if [[ $path_template =~ $path_regex ]]; then path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} fi diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index ea797959531..f47056aa43d 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -509,8 +509,8 @@ build_request_path() { fi # First replace all path parameters in the path - local path_regex="(.*)(\\{$pparam\\})(.*)" for pparam in "${path_params[@]}"; do + local path_regex="(.*)(\\{$pparam\\})(.*)" if [[ $path_template =~ $path_regex ]]; then path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} fi From 25812fc526a296dc9cf0df17b86439a445800daa Mon Sep 17 00:00:00 2001 From: Akito Nozaki Date: Thu, 28 Sep 2017 09:16:32 -0700 Subject: [PATCH 082/197] Swift3: non dictionary body type (#6531) * Adding support for non dictionary body types. * Adding test for rest of the swift3 types * Cleaning up implementation of makeRequest and adding better error handling. * Adding ClientError for error produced before request is sent. * Changing how encoding of body data is handled. * Cleaning up code that was modified. --- .../src/main/resources/swift3/APIs.mustache | 4 +- .../swift3/AlamofireImplementations.mustache | 25 +++++-- .../src/main/resources/swift3/api.mustache | 2 +- .../Classes/Swaggers/APIs.swift | 4 +- .../Swaggers/APIs/AnotherFakeAPI.swift | 48 +++++++++++++ .../Classes/Swaggers/APIs/FakeAPI.swift | 14 ++-- .../APIs/FakeClassnameTags123API.swift | 49 +++++++++++++ .../Classes/Swaggers/APIs/PetAPI.swift | 4 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 2 +- .../Classes/Swaggers/APIs/UserAPI.swift | 8 +-- .../Swaggers/AlamofireImplementations.swift | 25 +++++-- .../Classes/Swaggers/Models/EnumTest.swift | 4 +- .../SwaggerClientTests/UserAPITests.swift | 33 +++++++++ .../Classes/Swaggers/APIs.swift | 4 +- .../Swaggers/APIs/AnotherFakeAPI.swift | 65 ++++++++++++++++++ .../Classes/Swaggers/APIs/FakeAPI.swift | 14 ++-- .../APIs/FakeClassnameTags123API.swift | 66 ++++++++++++++++++ .../Classes/Swaggers/APIs/PetAPI.swift | 4 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 2 +- .../Classes/Swaggers/APIs/UserAPI.swift | 8 +-- .../Swaggers/AlamofireImplementations.swift | 25 +++++-- .../Classes/Swaggers/Models/EnumTest.swift | 4 +- .../SwaggerClientTests/UserAPITests.swift | 28 ++++++++ .../Classes/Swaggers/APIs.swift | 4 +- .../Swaggers/APIs/AnotherFakeAPI.swift | 67 ++++++++++++++++++ .../Classes/Swaggers/APIs/FakeAPI.swift | 14 ++-- .../APIs/FakeClassnameTags123API.swift | 68 +++++++++++++++++++ .../Classes/Swaggers/APIs/PetAPI.swift | 4 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 2 +- .../Classes/Swaggers/APIs/UserAPI.swift | 8 +-- .../Swaggers/AlamofireImplementations.swift | 25 +++++-- .../Classes/Swaggers/Models/EnumTest.swift | 4 +- .../SwaggerClientTests/UserAPITests.swift | 30 ++++++++ .../Classes/Swaggers/APIs.swift | 4 +- .../Swaggers/APIs/AnotherFakeAPI.swift | 48 +++++++++++++ .../Classes/Swaggers/APIs/FakeAPI.swift | 14 ++-- .../APIs/FakeClassnameTags123API.swift | 49 +++++++++++++ .../Classes/Swaggers/APIs/PetAPI.swift | 4 +- .../Classes/Swaggers/APIs/StoreAPI.swift | 2 +- .../Classes/Swaggers/APIs/UserAPI.swift | 8 +-- .../Swaggers/AlamofireImplementations.swift | 25 +++++-- .../Classes/Swaggers/Models/EnumTest.swift | 4 +- 42 files changed, 726 insertions(+), 100 deletions(-) create mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift diff --git a/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache b/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache index 476924eb171..9db9ba6de80 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/APIs.mustache @@ -32,7 +32,7 @@ open class APIBase { open class RequestBuilder { var credential: URLCredential? var headers: [String:String] - let parameters: [String:Any]? + let parameters: Any? let isBody: Bool let method: String let URLString: String @@ -40,7 +40,7 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters diff --git a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache index 53b1302cd44..9e84f215801 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/AlamofireImplementations.mustache @@ -43,11 +43,24 @@ private struct SynchronizedDictionary { } +class JSONEncodingWrapper: ParameterEncoding { + var bodyParameters: Any? + var encoding: JSONEncoding = JSONEncoding() + + public init(parameters: Any?) { + self.bodyParameters = parameters + } + + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + return try encoding.encode(urlRequest, withJSONObject: bodyParameters) + } +} + // Store manager to retain its reference private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -77,7 +90,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { @@ -86,15 +99,17 @@ open class AlamofireRequestBuilder: RequestBuilder { let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + + let param = parameters as? Parameters + let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } .map { $0.0 } if fileKeys.count > 0 { manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { + for (k, v) in param! { switch v { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { diff --git a/modules/swagger-codegen/src/main/resources/swift3/api.mustache b/modules/swagger-codegen/src/main/resources/swift3/api.mustache index fda7fadb373..d60ef7566c7 100644 --- a/modules/swagger-codegen/src/main/resources/swift3/api.mustache +++ b/modules/swagger-codegen/src/main/resources/swift3/api.mustache @@ -123,7 +123,7 @@ open class {{classname}}: APIBase { path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .literal, range: nil){{/pathParams}} let URLString = {{projectName}}API.basePath + path {{#bodyParam}} - let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() as? [String:AnyObject] + let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() {{/bodyParam}} {{^bodyParam}} {{#hasFormParams}} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift index 903593769e4..be616c7b71d 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs.swift @@ -32,7 +32,7 @@ open class APIBase { open class RequestBuilder { var credential: URLCredential? var headers: [String:String] - let parameters: [String:Any]? + let parameters: Any? let isBody: Bool let method: String let URLString: String @@ -40,7 +40,7 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..2e100b1fdcd --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift @@ -0,0 +1,48 @@ +// +// AnotherFakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + +open class AnotherFakeAPI: APIBase { + /** + To test special tags + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 1f5991b2537..dbe5c7ceb6e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -32,7 +32,7 @@ open class FakeAPI: APIBase { open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -67,7 +67,7 @@ open class FakeAPI: APIBase { open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -98,7 +98,7 @@ open class FakeAPI: APIBase { open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -129,7 +129,7 @@ open class FakeAPI: APIBase { open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -164,7 +164,7 @@ open class FakeAPI: APIBase { open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -307,7 +307,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryInteger_testEnumParameters: Int32 { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -315,7 +315,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..e0313d4b2a2 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,49 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + +open class FakeClassnameTags123API: APIBase { + /** + To test class name in snake case + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test class name in snake case + - PATCH /fake_classname_test + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 502ed84ec4a..7eaa9ab093f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -35,7 +35,7 @@ open class PetAPI: APIBase { open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -448,7 +448,7 @@ open class PetAPI: APIBase { open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 024c99c7453..006be5ab186 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -194,7 +194,7 @@ open class StoreAPI: APIBase { open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index adbd7e690c4..d4020a0a9c8 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -33,7 +33,7 @@ open class UserAPI: APIBase { open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -65,7 +65,7 @@ open class UserAPI: APIBase { open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -97,7 +97,7 @@ open class UserAPI: APIBase { open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -308,7 +308,7 @@ open class UserAPI: APIBase { var path = "/user/{username}" path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 53b1302cd44..9e84f215801 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -43,11 +43,24 @@ private struct SynchronizedDictionary { } +class JSONEncodingWrapper: ParameterEncoding { + var bodyParameters: Any? + var encoding: JSONEncoding = JSONEncoding() + + public init(parameters: Any?) { + self.bodyParameters = parameters + } + + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + return try encoding.encode(urlRequest, withJSONObject: bodyParameters) + } +} + // Store manager to retain its reference private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -77,7 +90,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { @@ -86,15 +99,17 @@ open class AlamofireRequestBuilder: RequestBuilder { let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + + let param = parameters as? Parameters + let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } .map { $0.0 } if fileKeys.count > 0 { manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { + for (k, v) in param! { switch v { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index ac5a3307532..2607822cb94 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -17,11 +17,11 @@ open class EnumTest: JSONEncodable { } public enum EnumInteger: Int32 { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift index 103ee1b90d1..87d10dd12e0 100644 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -79,6 +79,39 @@ class UserAPITests: XCTestCase { self.waitForExpectations(timeout: testTimeout, handler: nil) } + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]) { (error) in + guard error == nil else { + XCTFail("error creating users") + return + } + + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + func test2GetUser() { let expectation = self.expectation(description: "testGetUser") diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift index 903593769e4..be616c7b71d 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs.swift @@ -32,7 +32,7 @@ open class APIBase { open class RequestBuilder { var credential: URLCredential? var headers: [String:String] - let parameters: [String:Any]? + let parameters: Any? let isBody: Bool let method: String let URLString: String @@ -40,7 +40,7 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..82e9b8fac64 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift @@ -0,0 +1,65 @@ +// +// AnotherFakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import PromiseKit + + +open class AnotherFakeAPI: APIBase { + /** + To test special tags + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test special tags + - parameter body: (body) client model + - returns: Promise + */ + open class func testSpecialTags( body: Client) -> Promise { + let deferred = Promise.pending() + testSpecialTags(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 53fa0b3866b..1e328450eb7 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -48,7 +48,7 @@ open class FakeAPI: APIBase { open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -98,7 +98,7 @@ open class FakeAPI: APIBase { open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -144,7 +144,7 @@ open class FakeAPI: APIBase { open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -190,7 +190,7 @@ open class FakeAPI: APIBase { open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -241,7 +241,7 @@ open class FakeAPI: APIBase { open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -413,7 +413,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryInteger_testEnumParameters: Int32 { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -421,7 +421,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..37f48c0e719 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,66 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import PromiseKit + + +open class FakeClassnameTags123API: APIBase { + /** + To test class name in snake case + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test class name in snake case + - parameter body: (body) client model + - returns: Promise + */ + open class func testClassname( body: Client) -> Promise { + let deferred = Promise.pending() + testClassname(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index a632b3bfc22..09da8f6f1fe 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -52,7 +52,7 @@ open class PetAPI: APIBase { open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -546,7 +546,7 @@ open class PetAPI: APIBase { open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index b76092dda11..599711ea67d 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -258,7 +258,7 @@ open class StoreAPI: APIBase { open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 2c848d22f40..6ec966a9567 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -50,7 +50,7 @@ open class UserAPI: APIBase { open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -98,7 +98,7 @@ open class UserAPI: APIBase { open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -146,7 +146,7 @@ open class UserAPI: APIBase { open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -438,7 +438,7 @@ open class UserAPI: APIBase { var path = "/user/{username}" path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 53b1302cd44..9e84f215801 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -43,11 +43,24 @@ private struct SynchronizedDictionary { } +class JSONEncodingWrapper: ParameterEncoding { + var bodyParameters: Any? + var encoding: JSONEncoding = JSONEncoding() + + public init(parameters: Any?) { + self.bodyParameters = parameters + } + + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + return try encoding.encode(urlRequest, withJSONObject: bodyParameters) + } +} + // Store manager to retain its reference private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -77,7 +90,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { @@ -86,15 +99,17 @@ open class AlamofireRequestBuilder: RequestBuilder { let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + + let param = parameters as? Parameters + let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } .map { $0.0 } if fileKeys.count > 0 { manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { + for (k, v) in param! { switch v { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index ac5a3307532..2607822cb94 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -17,11 +17,11 @@ open class EnumTest: JSONEncodable { } public enum EnumInteger: Int32 { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift index 3042129608c..f172e732513 100644 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -48,6 +48,34 @@ class UserAPITests: XCTestCase { self.waitForExpectations(timeout: testTimeout, handler: nil) } + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + _ = UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]).then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + func test2GetUser() { let expectation = self.expectation(description: "testGetUser") UserAPI.getUserByName(username: "test@test.com").then {user -> Void in diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift index 903593769e4..be616c7b71d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs.swift @@ -32,7 +32,7 @@ open class APIBase { open class RequestBuilder { var credential: URLCredential? var headers: [String:String] - let parameters: [String:Any]? + let parameters: Any? let isBody: Bool let method: String let URLString: String @@ -40,7 +40,7 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..b37257eb955 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift @@ -0,0 +1,67 @@ +// +// AnotherFakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import RxSwift + + +open class AnotherFakeAPI: APIBase { + /** + To test special tags + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test special tags + - parameter body: (body) client model + - returns: Observable + */ + open class func testSpecialTags(body: Client) -> Observable { + return Observable.create { observer -> Disposable in + testSpecialTags(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 3309c9b98b0..a372f52b955 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -50,7 +50,7 @@ open class FakeAPI: APIBase { open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -102,7 +102,7 @@ open class FakeAPI: APIBase { open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -150,7 +150,7 @@ open class FakeAPI: APIBase { open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -198,7 +198,7 @@ open class FakeAPI: APIBase { open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -251,7 +251,7 @@ open class FakeAPI: APIBase { open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -425,7 +425,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryInteger_testEnumParameters: Int32 { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -433,7 +433,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..bbad2e38b9f --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,68 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import RxSwift + + +open class FakeClassnameTags123API: APIBase { + /** + To test class name in snake case + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test class name in snake case + - parameter body: (body) client model + - returns: Observable + */ + open class func testClassname(body: Client) -> Observable { + return Observable.create { observer -> Disposable in + testClassname(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index ae0bf564d4b..ecd41c83355 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -54,7 +54,7 @@ open class PetAPI: APIBase { open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -558,7 +558,7 @@ open class PetAPI: APIBase { open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index f78b6766486..3a6112402d8 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -266,7 +266,7 @@ open class StoreAPI: APIBase { open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index 8456a04a5a9..99a91b910f4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -52,7 +52,7 @@ open class UserAPI: APIBase { open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -102,7 +102,7 @@ open class UserAPI: APIBase { open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -152,7 +152,7 @@ open class UserAPI: APIBase { open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -454,7 +454,7 @@ open class UserAPI: APIBase { var path = "/user/{username}" path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 53b1302cd44..9e84f215801 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -43,11 +43,24 @@ private struct SynchronizedDictionary { } +class JSONEncodingWrapper: ParameterEncoding { + var bodyParameters: Any? + var encoding: JSONEncoding = JSONEncoding() + + public init(parameters: Any?) { + self.bodyParameters = parameters + } + + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + return try encoding.encode(urlRequest, withJSONObject: bodyParameters) + } +} + // Store manager to retain its reference private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -77,7 +90,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { @@ -86,15 +99,17 @@ open class AlamofireRequestBuilder: RequestBuilder { let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + + let param = parameters as? Parameters + let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } .map { $0.0 } if fileKeys.count > 0 { manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { + for (k, v) in param! { switch v { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index ac5a3307532..2607822cb94 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -17,11 +17,11 @@ open class EnumTest: JSONEncodable { } public enum EnumInteger: Int32 { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift index c806c6a799a..4159baa1754 100644 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -93,6 +93,36 @@ class UserAPITests: XCTestCase { }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) self.waitForExpectations(timeout: testTimeout, handler: nil) } + + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + _ = UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]).subscribe(onNext: { + expectation.fulfill() + }, onError: { _ in + XCTFail("error creating users") + }) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } func test2GetUser() { let expectation = self.expectation(description: "testGetUser") diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift index 903593769e4..be616c7b71d 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs.swift @@ -32,7 +32,7 @@ open class APIBase { open class RequestBuilder { var credential: URLCredential? var headers: [String:String] - let parameters: [String:Any]? + let parameters: Any? let isBody: Bool let method: String let URLString: String @@ -40,7 +40,7 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..2e100b1fdcd --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/AnotherFakeAPI.swift @@ -0,0 +1,48 @@ +// +// AnotherFakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + +open class AnotherFakeAPI: APIBase { + /** + To test special tags + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 1f5991b2537..dbe5c7ceb6e 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -32,7 +32,7 @@ open class FakeAPI: APIBase { open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { let path = "/fake/outer/boolean" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -67,7 +67,7 @@ open class FakeAPI: APIBase { open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -98,7 +98,7 @@ open class FakeAPI: APIBase { open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { let path = "/fake/outer/number" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -129,7 +129,7 @@ open class FakeAPI: APIBase { open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { let path = "/fake/outer/string" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] + let parameters = body?.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -164,7 +164,7 @@ open class FakeAPI: APIBase { open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -307,7 +307,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryInteger_testEnumParameters: Int32 { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -315,7 +315,7 @@ open class FakeAPI: APIBase { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..e0313d4b2a2 --- /dev/null +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,49 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + +open class FakeClassnameTags123API: APIBase { + /** + To test class name in snake case + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test class name in snake case + - PATCH /fake_classname_test + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = NSURLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 502ed84ec4a..7eaa9ab093f 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -35,7 +35,7 @@ open class PetAPI: APIBase { open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -448,7 +448,7 @@ open class PetAPI: APIBase { open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 024c99c7453..006be5ab186 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -194,7 +194,7 @@ open class StoreAPI: APIBase { open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift index adbd7e690c4..d4020a0a9c8 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -33,7 +33,7 @@ open class UserAPI: APIBase { open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -65,7 +65,7 @@ open class UserAPI: APIBase { open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -97,7 +97,7 @@ open class UserAPI: APIBase { open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) @@ -308,7 +308,7 @@ open class UserAPI: APIBase { var path = "/user/{username}" path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() as? [String:AnyObject] + let parameters = body.encodeToJSON() let url = NSURLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift index 53b1302cd44..9e84f215801 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -43,11 +43,24 @@ private struct SynchronizedDictionary { } +class JSONEncodingWrapper: ParameterEncoding { + var bodyParameters: Any? + var encoding: JSONEncoding = JSONEncoding() + + public init(parameters: Any?) { + self.bodyParameters = parameters + } + + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + return try encoding.encode(urlRequest, withJSONObject: bodyParameters) + } +} + // Store manager to retain its reference private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -77,7 +90,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { @@ -86,15 +99,17 @@ open class AlamofireRequestBuilder: RequestBuilder { let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + + let param = parameters as? Parameters + let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } .map { $0.0 } if fileKeys.count > 0 { manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { + for (k, v) in param! { switch v { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index ffcc81417d0..840c0e768d1 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -17,11 +17,11 @@ open class EnumTest: JSONEncodable { } public enum EnumInteger: Int32 { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? From 39908ebb832d3f18e5b0d2b6e24bcc80c3f6dc27 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 29 Sep 2017 09:47:03 +0800 Subject: [PATCH 083/197] add jvelilla to eiffel tech committee --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1700ecd9b2..e874df4e76f 100644 --- a/README.md +++ b/README.md @@ -1052,7 +1052,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | C# | @mandrean (2017/08) | | Clojure | | | Dart | @ircecho (2017/07) | -| Eiffel | | +| Eiffel | @jvelilla (2017/09) | | Elixir | | | Erlang | | | Groovy | | From 8e854dc7441bce5ac8171684d0763729b07a832f Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 29 Sep 2017 11:39:15 +0800 Subject: [PATCH 084/197] add kenjones-cisco to bash tech comm --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e874df4e76f..8692603a099 100644 --- a/README.md +++ b/README.md @@ -1047,7 +1047,7 @@ If you want to join the committee, please kindly apply by sending an email to wi |:-------------|:-------------| | ActionScript | | | Apex | | -| Bash | @frol (2017/07) @bkryza (2017/08) | +| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | | C# | @mandrean (2017/08) | | Clojure | | From 924a8e5efeb5d48acd389f144ce294a7f6469f74 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Fri, 29 Sep 2017 10:46:16 +0300 Subject: [PATCH 085/197] [CPPREST] Fixed multipart files upload implementation (#6518) --- .../resources/cpprest/api-source.mustache | 3 --- .../cpprest/apiclient-source.mustache | 4 ++-- samples/client/petstore/cpprest/ApiClient.cpp | 4 ++-- .../client/petstore/cpprest/api/PetApi.cpp | 24 ------------------- .../client/petstore/cpprest/api/StoreApi.cpp | 12 ---------- .../client/petstore/cpprest/api/UserApi.cpp | 24 ------------------- samples/client/petstore/cpprest/model/Pet.h | 4 ++-- 7 files changed, 6 insertions(+), 69 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache index 343a2697817..dfadeb0d7b5 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/api-source.mustache @@ -221,9 +221,6 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r throw ApiException(415, U("{{classname}}->{{operationId}} does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - {{#authMethods}} // authentication ({{name}}) required {{#isApiKey}} diff --git a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache index b3a3e075a7d..9f7c1e4fb1d 100644 --- a/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache +++ b/modules/swagger-codegen/src/main/resources/cpprest/apiclient-source.mustache @@ -100,10 +100,10 @@ pplx::task ApiClient::callApi( uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); } std::stringstream data; - postBody->writeTo(data); + uploadData.writeTo(data); auto bodyString = data.str(); auto length = bodyString.size(); - request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType); + request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, U("multipart/form-data; boundary=") + uploadData.getBoundary()); } else { diff --git a/samples/client/petstore/cpprest/ApiClient.cpp b/samples/client/petstore/cpprest/ApiClient.cpp index f6e5f11af55..92a09ed7fa5 100644 --- a/samples/client/petstore/cpprest/ApiClient.cpp +++ b/samples/client/petstore/cpprest/ApiClient.cpp @@ -112,10 +112,10 @@ pplx::task ApiClient::callApi( uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); } std::stringstream data; - postBody->writeTo(data); + uploadData.writeTo(data); auto bodyString = data.str(); auto length = bodyString.size(); - request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType); + request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, U("multipart/form-data; boundary=") + uploadData.getBoundary()); } else { diff --git a/samples/client/petstore/cpprest/api/PetApi.cpp b/samples/client/petstore/cpprest/api/PetApi.cpp index 4cb45a80111..96fd6d669f3 100644 --- a/samples/client/petstore/cpprest/api/PetApi.cpp +++ b/samples/client/petstore/cpprest/api/PetApi.cpp @@ -118,9 +118,6 @@ pplx::task PetApi::addPet(std::shared_ptr body) throw ApiException(415, U("PetApi->addPet does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -224,9 +221,6 @@ pplx::task PetApi::deletePet(int64_t petId, utility::string_t apiKey) throw ApiException(415, U("PetApi->deletePet does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -329,9 +323,6 @@ pplx::task>> PetApi::findPetsByStatus(std::vect throw ApiException(415, U("PetApi->findPetsByStatus does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -459,9 +450,6 @@ pplx::task>> PetApi::findPetsByTags(std::vector throw ApiException(415, U("PetApi->findPetsByTags does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -586,9 +574,6 @@ pplx::task> PetApi::getPetById(int64_t petId) throw ApiException(415, U("PetApi->getPetById does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (api_key) required { utility::string_t apiKey = apiConfiguration->getApiKey(U("api_key")); @@ -732,9 +717,6 @@ pplx::task PetApi::updatePet(std::shared_ptr body) throw ApiException(415, U("PetApi->updatePet does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -843,9 +825,6 @@ pplx::task PetApi::updatePetWithForm(int64_t petId, utility::string_t name throw ApiException(415, U("PetApi->updatePetWithForm does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config @@ -953,9 +932,6 @@ pplx::task> PetApi::uploadFile(int64_t petId, utili throw ApiException(415, U("PetApi->uploadFile does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (petstore_auth) required // oauth2 authentication is added automatically as part of the http_client_config diff --git a/samples/client/petstore/cpprest/api/StoreApi.cpp b/samples/client/petstore/cpprest/api/StoreApi.cpp index 0000bd34920..4f897327d6e 100644 --- a/samples/client/petstore/cpprest/api/StoreApi.cpp +++ b/samples/client/petstore/cpprest/api/StoreApi.cpp @@ -98,9 +98,6 @@ pplx::task StoreApi::deleteOrder(utility::string_t orderId) throw ApiException(415, U("StoreApi->deleteOrder does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("DELETE"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -196,9 +193,6 @@ pplx::task> StoreApi::getInventory() throw ApiException(415, U("StoreApi->getInventory does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - // authentication (api_key) required { utility::string_t apiKey = apiConfiguration->getApiKey(U("api_key")); @@ -327,9 +321,6 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) throw ApiException(415, U("StoreApi->getOrderById does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -463,9 +454,6 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b throw ApiException(415, U("StoreApi->placeOrder does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) diff --git a/samples/client/petstore/cpprest/api/UserApi.cpp b/samples/client/petstore/cpprest/api/UserApi.cpp index f3ff28cb2ff..50badbae649 100644 --- a/samples/client/petstore/cpprest/api/UserApi.cpp +++ b/samples/client/petstore/cpprest/api/UserApi.cpp @@ -116,9 +116,6 @@ pplx::task UserApi::createUser(std::shared_ptr body) throw ApiException(415, U("UserApi->createUser does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -241,9 +238,6 @@ pplx::task UserApi::createUsersWithArrayInput(std::vectorcreateUsersWithArrayInput does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -366,9 +360,6 @@ pplx::task UserApi::createUsersWithListInput(std::vectorcreateUsersWithListInput does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("POST"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -466,9 +457,6 @@ pplx::task UserApi::deleteUser(utility::string_t username) throw ApiException(415, U("UserApi->deleteUser does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("DELETE"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -566,9 +554,6 @@ pplx::task> UserApi::getUserByName(utility::string_t usern throw ApiException(415, U("UserApi->getUserByName does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -696,9 +681,6 @@ pplx::task UserApi::loginUser(utility::string_t username, uti throw ApiException(415, U("UserApi->loginUser does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -818,9 +800,6 @@ pplx::task UserApi::logoutUser() throw ApiException(415, U("UserApi->logoutUser does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("GET"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) @@ -937,9 +916,6 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr throw ApiException(415, U("UserApi->updateUser does not consume any supported media type")); } - //Set the request content type in the header. - headerParams[U("Content-Type")] = requestHttpContentType; - return m_ApiClient->callApi(path, U("PUT"), queryParams, httpBody, headerParams, formParams, fileParams, requestHttpContentType) .then([=](web::http::http_response response) diff --git a/samples/client/petstore/cpprest/model/Pet.h b/samples/client/petstore/cpprest/model/Pet.h index df26cd36d1c..42e534ae4e1 100644 --- a/samples/client/petstore/cpprest/model/Pet.h +++ b/samples/client/petstore/cpprest/model/Pet.h @@ -22,10 +22,10 @@ #include "ModelBase.h" -#include "Tag.h" -#include #include "Category.h" +#include #include +#include "Tag.h" namespace io { namespace swagger { From 063e885c2fd4c9c76bbc3f9014901d273a132fb8 Mon Sep 17 00:00:00 2001 From: Jinkui Shi Date: Fri, 29 Sep 2017 17:24:34 +0800 Subject: [PATCH 086/197] [Scala] format the Scala code style templete (#6532) * The templete of scala code style refactor * more reformat * more reformat * generate petstore client --- .../src/main/resources/scala/api.mustache | 15 +- .../main/resources/scala/apiInvoker.mustache | 154 ++++++++++-------- .../src/main/resources/scala/pom.mustache | 10 +- .../scala/io/swagger/client/ApiInvoker.scala | 97 +++++------ samples/client/petstore/scala/pom.xml | 10 +- .../scala/io/swagger/client/ApiInvoker.scala | 154 ++++++++++-------- .../scala/io/swagger/client/api/PetApi.scala | 22 +-- .../io/swagger/client/api/StoreApi.scala | 18 +- .../scala/io/swagger/client/api/UserApi.scala | 22 +-- 9 files changed, 261 insertions(+), 241 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index 5c8c5ec07b4..2a2f0c4c13b 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -32,8 +32,10 @@ import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} {{#operations}} -class {{classname}}(val defBasePath: String = "{{{basePath}}}", - defApiInvoker: ApiInvoker = ApiInvoker) { +class {{classname}}( + val defBasePath: String = "{{{basePath}}}", + defApiInvoker: ApiInvoker = ApiInvoker +) { implicit val formats = new org.json4s.DefaultFormats { override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") @@ -45,10 +47,12 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}", implicit val stringWriter = RequestWriters.StringWriter implicit val jsonWriter = JsonFormatsWriter - var basePath = defBasePath - var apiInvoker = defApiInvoker + var basePath: String = defBasePath + var apiInvoker: ApiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String): mutable.HashMap[String, String] = { + apiInvoker.defaultHeaders += key -> value + } val config = SwaggerConfig.forUrl(new URI(defBasePath)) val client = new RestClient(config) @@ -79,7 +83,6 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}", helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) } - {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index f5f3bbce3f3..5c009e7e706 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -17,7 +17,7 @@ import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ -import scala.collection.mutable.HashMap +import scala.collection.mutable import com.fasterxml.jackson.module.scala.DefaultScalaModule import com.fasterxml.jackson.datatype.joda.JodaModule @@ -30,8 +30,8 @@ object ScalaJsonUtil { def getJsonMapper = { val mapper = new ObjectMapper() mapper.registerModule(new DefaultScalaModule()) - mapper.registerModule(new JodaModule()); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.registerModule(new JodaModule()) + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -41,13 +41,14 @@ object ScalaJsonUtil { } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, - httpHeaders: HashMap[String, String] = HashMap(), - hostMap: HashMap[String, Client] = HashMap(), - asyncHttpClient: Boolean = false, - authScheme: String = "", - authPreemptive: Boolean = false) { + httpHeaders: mutable.HashMap[String, String] = mutable.HashMap(), + hostMap: mutable.HashMap[String, Client] = mutable.HashMap(), + asyncHttpClient: Boolean = false, + authScheme: String = "", + authPreemptive: Boolean = false +) { - var defaultHeaders: HashMap[String, String] = httpHeaders + var defaultHeaders: mutable.HashMap[String, String] = httpHeaders def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") @@ -61,30 +62,29 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { json match { - case s: String => { - if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 1) - else s - } + case s: String => + if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) { + s.substring(1, s.length - 1) + } else { + s + } case _ => null } } else { containerType.toLowerCase match { - case "array" => { - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + case "array" => + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case "list" => { - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + case "list" => + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case _ => { + case _ => json match { - case e: String if ("\"\"" == e) => null + case e: String if "\"\"" == e => null case _ => mapper.readValue(json, cls) } - } } } } @@ -95,94 +95,104 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) case _ => mapper.writeValueAsString(obj) } - } else null + } else { + null + } } - def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { + def invokeApi( + host: String, + path: String, + method: String, + queryParams: Map[String, String], + formParams: Map[String, String], + body: AnyRef, + headerParams: Map[String, String], + contentType: String +): String = { val client = getClient(host) - val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") + val querystring = queryParams.filter(k => k._2 != null).map(k => escape(k._1) + "=" + escape(k._2)).mkString("?", "&", "") val builder = client.resource(host + path + querystring).accept(contentType) headerParams.map(p => builder.header(p._1, p._2)) - defaultHeaders.map(p => { + defaultHeaders.foreach(p => { headerParams.contains(p._1) match { case true => // override default with supplied header case false => if (p._2 != null) builder.header(p._1, p._2) } }) var formData: MultivaluedMapImpl = null - if(contentType == "application/x-www-form-urlencoded") { + if (contentType == "application/x-www-form-urlencoded") { formData = new MultivaluedMapImpl() - formParams.map(p => formData.add(p._1, p._2)) + formParams.foreach(p => formData.add(p._1, p._2)) } val response: ClientResponse = method match { - case "GET" => { - builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] - } - case "POST" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body != null && body.isInstanceOf[File]) { + case "GET" => builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] + case "POST" => + if (formData != null && formData.size() > 0) { + builder.post(classOf[ClientResponse], formData) + } else if (body != null && body.isInstanceOf[File]) { val file = body.asInstanceOf[File] val form = new FormDataMultiPart() - form.field("filename", file.getName()) + form.field("filename", file.getName) form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) builder.post(classOf[ClientResponse], form) + } else { + if (body == null) { + builder.post(classOf[ClientResponse], serialize(body)) + } else { + builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } } - else { - if(body == null) builder.post(classOf[ClientResponse], serialize(body)) - else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + case "PUT" => + if (formData != null) { + builder.post(classOf[ClientResponse], formData) + } else if (body == null) { + builder.put(classOf[ClientResponse], null) + } else { + builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) + } + case "DELETE" => builder.delete(classOf[ClientResponse]) + case "PATCH" => + if(formData != null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + } else if(body == null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + } else { + builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) } - } - case "PUT" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body == null) builder.put(classOf[ClientResponse], null) - else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) - } - case "DELETE" => { - builder.delete(classOf[ClientResponse]) - } - case "PATCH" => { - if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) - else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) - else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) - } case _ => null } - response.getStatusInfo().getStatusCode() match { + response.getStatusInfo.getStatusCode match { case 204 => "" - case code: Int if (Range(200, 299).contains(code)) => { - response.hasEntity() match { + case code: Int if Range(200, 299).contains(code) => + response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "" } - } - case _ => { - val entity = response.hasEntity() match { + case _ => + val entity = response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "no data" } - throw new ApiException( - response.getStatusInfo().getStatusCode(), - entity) - } + throw new ApiException(response.getStatusInfo.getStatusCode, entity) } } def getClient(host: String): Client = { hostMap.contains(host) match { case true => hostMap(host) - case false => { + case false => val client = newClient(host) // client.addFilter(new LoggingFilter()) hostMap += host -> client client } - } } def newClient(host: String): Client = asyncHttpClient match { - case true => { + case true => import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig import org.sonatype.spice.jersey.client.ahc.AhcHttpClient import com.ning.http.client.Realm @@ -190,21 +200,23 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, val config: DefaultAhcConfig = new DefaultAhcConfig() if (!authScheme.isEmpty) { val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) - config.getAsyncHttpClientConfigBuilder + config + .getAsyncHttpClientConfigBuilder .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) .setUsePreemptiveAuth(authPreemptive).build) } AhcHttpClient.create(config) - } case _ => Client.create() } } -object ApiInvoker extends ApiInvoker(mapper = ScalaJsonUtil.getJsonMapper, - httpHeaders = HashMap(), - hostMap = HashMap(), +object ApiInvoker extends ApiInvoker( + mapper = ScalaJsonUtil.getJsonMapper, + httpHeaders = mutable.HashMap(), + hostMap = mutable.HashMap(), asyncHttpClient = {{asyncHttpClient}}, authScheme = "{{authScheme}}", - authPreemptive = {{authPreemptive}}) + authPreemptive = {{authPreemptive}} +) class ApiException(val code: Int, msg: String) extends RuntimeException(msg) diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index 05ab94c16b8..8202358aadf 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -153,7 +153,7 @@ com.fasterxml.jackson.module - jackson-module-scala_2.10 + jackson-module-scala_2.11 ${jackson-version} @@ -189,7 +189,7 @@ org.scalatest - scalatest_2.10 + scalatest_2.11 ${scala-test-version} test @@ -211,16 +211,16 @@ com.wordnik.swagger - swagger-async-httpclient_2.10 + swagger-async-httpclient_2.11 ${swagger-async-httpclient-version} - 2.10.4 + 2.11.11 1.2 2.2 1.19 - 1.5.15 + 1.5.16 1.0.5 1.0.0 2.8.9 diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 9ea846dbab6..65cccaea4b2 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -52,11 +52,11 @@ object ScalaJsonUtil { } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, - httpHeaders: HashMap[String, String] = HashMap(), - hostMap: HashMap[String, Client] = HashMap(), - asyncHttpClient: Boolean = false, - authScheme: String = "", - authPreemptive: Boolean = false) { + httpHeaders: HashMap[String, String] = HashMap(), + hostMap: HashMap[String, Client] = HashMap(), + asyncHttpClient: Boolean = false, + authScheme: String = "", + authPreemptive: Boolean = false) { var defaultHeaders: HashMap[String, String] = httpHeaders @@ -65,37 +65,39 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, } def escape(value: Long): String = value.toString + def escape(value: Double): String = value.toString + def escape(value: Float): String = value.toString + def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { json match { - case s: String => { - if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 1) - else s - } + case s: String => + if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) { + s.substring(1, s.length - 1) + } else { + s + } case _ => null } } else { containerType.toLowerCase match { - case "array" => { + case "array" => val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case "list" => { + case "list" => val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case _ => { + case _ => json match { case e: String if ("\"\"" == e) => null case _ => mapper.readValue(json, cls) } - } } } } @@ -122,53 +124,53 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, } }) var formData: MultivaluedMapImpl = null - if(contentType == "application/x-www-form-urlencoded") { + if (contentType == "application/x-www-form-urlencoded") { formData = new MultivaluedMapImpl() formParams.map(p => formData.add(p._1, p._2)) } val response: ClientResponse = method match { - case "GET" => { - builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] - } - case "POST" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body != null && body.isInstanceOf[File]) { + case "GET" => builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] + case "POST" => + if (formData != null) { + builder.post(classOf[ClientResponse], formData) + } else if (body != null && body.isInstanceOf[File]) { val file = body.asInstanceOf[File] val form = new FormDataMultiPart() form.field("filename", file.getName()) form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) builder.post(classOf[ClientResponse], form) + } else { + if (body == null) { + builder.post(classOf[ClientResponse], serialize(body)) + } else { + builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } } - else { - if(body == null) builder.post(classOf[ClientResponse], serialize(body)) - else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) - } - } - case "PUT" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body == null) builder.put(classOf[ClientResponse], null) + case "PUT" => + if (formData != null) builder.post(classOf[ClientResponse], formData) + else if (body == null) builder.put(classOf[ClientResponse], null) else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) - } - case "DELETE" => { - builder.delete(classOf[ClientResponse]) - } + case "DELETE" => builder.delete(classOf[ClientResponse]) case "PATCH" => { - if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) - else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) - else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) + if (formData != null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + } else if (body == null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + } else { + builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } } case _ => null } response.getStatusInfo().getStatusCode() match { case 204 => "" - case code: Int if (Range(200, 299).contains(code)) => { + case code: Int if (Range(200, 299).contains(code)) => response.hasEntity() match { case true => response.getEntity(classOf[String]) case false => "" } - } - case _ => { + case _ => val entity = response.hasEntity() match { case true => response.getEntity(classOf[String]) case false => "no data" @@ -176,24 +178,22 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, throw new ApiException( response.getStatusInfo().getStatusCode(), entity) - } } } def getClient(host: String): Client = { hostMap.contains(host) match { case true => hostMap(host) - case false => { + case false => val client = newClient(host) // client.addFilter(new LoggingFilter()) hostMap += host -> client client - } } } def newClient(host: String): Client = asyncHttpClient match { - case true => { + case true => import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig import org.sonatype.spice.jersey.client.ahc.AhcHttpClient import com.ning.http.client.Realm @@ -203,19 +203,20 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) config.getAsyncHttpClientConfigBuilder .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) - .setUsePreemptiveAuth(authPreemptive).build) + .setUsePreemptiveAuth(authPreemptive).build) } AhcHttpClient.create(config) - } case _ => Client.create() } } -object ApiInvoker extends ApiInvoker(mapper = ScalaJsonUtil.getJsonMapper, +object ApiInvoker extends ApiInvoker( + mapper = ScalaJsonUtil.getJsonMapper, httpHeaders = HashMap(), hostMap = HashMap(), asyncHttpClient = false, authScheme = "", - authPreemptive = false) + authPreemptive = false +) class ApiException(val code: Int, msg: String) extends RuntimeException(msg) diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index 81bcd8887f4..eceb1e6fdc4 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -153,7 +153,7 @@ com.fasterxml.jackson.module - jackson-module-scala_2.10 + jackson-module-scala_2.11 ${jackson-version} @@ -189,7 +189,7 @@ org.scalatest - scalatest_2.10 + scalatest_2.11 ${scala-test-version} test @@ -211,16 +211,16 @@ com.wordnik.swagger - swagger-async-httpclient_2.10 + swagger-async-httpclient_2.11 ${swagger-async-httpclient-version} - 2.10.4 + 2.11.11 1.2 2.2 1.19 - 1.5.15 + 1.5.16 1.0.5 1.0.0 2.8.9 diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index c39ac6d52fb..25ca1fc85cc 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -28,7 +28,7 @@ import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ -import scala.collection.mutable.HashMap +import scala.collection.mutable import com.fasterxml.jackson.module.scala.DefaultScalaModule import com.fasterxml.jackson.datatype.joda.JodaModule @@ -41,8 +41,8 @@ object ScalaJsonUtil { def getJsonMapper = { val mapper = new ObjectMapper() mapper.registerModule(new DefaultScalaModule()) - mapper.registerModule(new JodaModule()); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.registerModule(new JodaModule()) + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -52,13 +52,14 @@ object ScalaJsonUtil { } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, - httpHeaders: HashMap[String, String] = HashMap(), - hostMap: HashMap[String, Client] = HashMap(), - asyncHttpClient: Boolean = false, - authScheme: String = "", - authPreemptive: Boolean = false) { + httpHeaders: mutable.HashMap[String, String] = mutable.HashMap(), + hostMap: mutable.HashMap[String, Client] = mutable.HashMap(), + asyncHttpClient: Boolean = false, + authScheme: String = "", + authPreemptive: Boolean = false +) { - var defaultHeaders: HashMap[String, String] = httpHeaders + var defaultHeaders: mutable.HashMap[String, String] = httpHeaders def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") @@ -72,30 +73,29 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def deserialize(json: String, containerType: String, cls: Class[_]) = { if (cls == classOf[String]) { json match { - case s: String => { - if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) s.substring(1, s.length - 1) - else s - } + case s: String => + if (s.startsWith("\"") && s.endsWith("\"") && s.length > 1) { + s.substring(1, s.length - 1) + } else { + s + } case _ => null } } else { containerType.toLowerCase match { - case "array" => { - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + case "array" => + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case "list" => { - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + case "list" => + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList - } - case _ => { + case _ => json match { - case e: String if ("\"\"" == e) => null + case e: String if "\"\"" == e => null case _ => mapper.readValue(json, cls) } - } } } } @@ -106,94 +106,104 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) case _ => mapper.writeValueAsString(obj) } - } else null + } else { + null + } } - def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { + def invokeApi( + host: String, + path: String, + method: String, + queryParams: Map[String, String], + formParams: Map[String, String], + body: AnyRef, + headerParams: Map[String, String], + contentType: String +): String = { val client = getClient(host) - val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") + val querystring = queryParams.filter(k => k._2 != null).map(k => escape(k._1) + "=" + escape(k._2)).mkString("?", "&", "") val builder = client.resource(host + path + querystring).accept(contentType) headerParams.map(p => builder.header(p._1, p._2)) - defaultHeaders.map(p => { + defaultHeaders.foreach(p => { headerParams.contains(p._1) match { case true => // override default with supplied header case false => if (p._2 != null) builder.header(p._1, p._2) } }) var formData: MultivaluedMapImpl = null - if(contentType == "application/x-www-form-urlencoded") { + if (contentType == "application/x-www-form-urlencoded") { formData = new MultivaluedMapImpl() - formParams.map(p => formData.add(p._1, p._2)) + formParams.foreach(p => formData.add(p._1, p._2)) } val response: ClientResponse = method match { - case "GET" => { - builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] - } - case "POST" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body != null && body.isInstanceOf[File]) { + case "GET" => builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] + case "POST" => + if (formData != null && formData.size() > 0) { + builder.post(classOf[ClientResponse], formData) + } else if (body != null && body.isInstanceOf[File]) { val file = body.asInstanceOf[File] val form = new FormDataMultiPart() - form.field("filename", file.getName()) + form.field("filename", file.getName) form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) builder.post(classOf[ClientResponse], form) + } else { + if (body == null) { + builder.post(classOf[ClientResponse], serialize(body)) + } else { + builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + } } - else { - if(body == null) builder.post(classOf[ClientResponse], serialize(body)) - else builder.`type`(contentType).post(classOf[ClientResponse], serialize(body)) + case "PUT" => + if (formData != null) { + builder.post(classOf[ClientResponse], formData) + } else if (body == null) { + builder.put(classOf[ClientResponse], null) + } else { + builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) + } + case "DELETE" => builder.delete(classOf[ClientResponse]) + case "PATCH" => + if(formData != null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + } else if(body == null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) + } else { + builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) } - } - case "PUT" => { - if(formData != null) builder.post(classOf[ClientResponse], formData) - else if(body == null) builder.put(classOf[ClientResponse], null) - else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) - } - case "DELETE" => { - builder.delete(classOf[ClientResponse]) - } - case "PATCH" => { - if(formData != null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) - else if(body == null) builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) - else builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) - } case _ => null } - response.getStatusInfo().getStatusCode() match { + response.getStatusInfo.getStatusCode match { case 204 => "" - case code: Int if (Range(200, 299).contains(code)) => { - response.hasEntity() match { + case code: Int if Range(200, 299).contains(code) => + response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "" } - } - case _ => { - val entity = response.hasEntity() match { + case _ => + val entity = response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "no data" } - throw new ApiException( - response.getStatusInfo().getStatusCode(), - entity) - } + throw new ApiException(response.getStatusInfo.getStatusCode, entity) } } def getClient(host: String): Client = { hostMap.contains(host) match { case true => hostMap(host) - case false => { + case false => val client = newClient(host) // client.addFilter(new LoggingFilter()) hostMap += host -> client client } - } } def newClient(host: String): Client = asyncHttpClient match { - case true => { + case true => import org.sonatype.spice.jersey.client.ahc.config.DefaultAhcConfig import org.sonatype.spice.jersey.client.ahc.AhcHttpClient import com.ning.http.client.Realm @@ -201,21 +211,23 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, val config: DefaultAhcConfig = new DefaultAhcConfig() if (!authScheme.isEmpty) { val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) - config.getAsyncHttpClientConfigBuilder + config + .getAsyncHttpClientConfigBuilder .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) .setUsePreemptiveAuth(authPreemptive).build) } AhcHttpClient.create(config) - } case _ => Client.create() } } -object ApiInvoker extends ApiInvoker(mapper = ScalaJsonUtil.getJsonMapper, - httpHeaders = HashMap(), - hostMap = HashMap(), +object ApiInvoker extends ApiInvoker( + mapper = ScalaJsonUtil.getJsonMapper, + httpHeaders = mutable.HashMap(), + hostMap = mutable.HashMap(), asyncHttpClient = false, authScheme = "", - authPreemptive = false) + authPreemptive = false +) class ApiException(val code: Int, msg: String) extends RuntimeException(msg) 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 278704243ac..bdada6d0e63 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 @@ -43,8 +43,10 @@ import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} -class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { +class PetApi( + val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker +) { implicit val formats = new org.json4s.DefaultFormats { override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") @@ -56,10 +58,12 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", implicit val stringWriter = RequestWriters.StringWriter implicit val jsonWriter = JsonFormatsWriter - var basePath = defBasePath - var apiInvoker = defApiInvoker + var basePath: String = defBasePath + var apiInvoker: ApiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String): mutable.HashMap[String, String] = { + apiInvoker.defaultHeaders += key -> value + } val config = SwaggerConfig.forUrl(new URI(defBasePath)) val client = new RestClient(config) @@ -89,7 +93,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.addPet(body) } - /** * Deletes a pet * @@ -116,7 +119,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.deletePet(petId, apiKey) } - /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -141,7 +143,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.findPetsByStatus(status) } - /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -166,7 +167,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.findPetsByTags(tags) } - /** * Find pet by ID * Returns a single pet @@ -191,7 +191,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.getPetById(petId) } - /** * Update an existing pet * @@ -216,7 +215,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.updatePet(body) } - /** * Updates a pet in the store with form data * @@ -245,7 +243,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.updatePetWithForm(petId, name, status) } - /** * uploads an image * @@ -274,7 +271,6 @@ class PetApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.uploadFile(petId, additionalMetadata, file) } - } class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala index cd09c136746..87a3364ceb5 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -41,8 +41,10 @@ import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} -class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { +class StoreApi( + val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker +) { implicit val formats = new org.json4s.DefaultFormats { override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") @@ -54,10 +56,12 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", implicit val stringWriter = RequestWriters.StringWriter implicit val jsonWriter = JsonFormatsWriter - var basePath = defBasePath - var apiInvoker = defApiInvoker + var basePath: String = defBasePath + var apiInvoker: ApiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String): mutable.HashMap[String, String] = { + apiInvoker.defaultHeaders += key -> value + } val config = SwaggerConfig.forUrl(new URI(defBasePath)) val client = new RestClient(config) @@ -87,7 +91,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.deleteOrder(orderId) } - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -110,7 +113,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.getInventory() } - /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -135,7 +137,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.getOrderById(orderId) } - /** * Place an order for a pet * @@ -160,7 +161,6 @@ class StoreApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.placeOrder(body) } - } class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala index cd3004f1988..21a510f9a4f 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala @@ -41,8 +41,10 @@ import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} -class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", - defApiInvoker: ApiInvoker = ApiInvoker) { +class UserApi( + val defBasePath: String = "http://petstore.swagger.io/v2", + defApiInvoker: ApiInvoker = ApiInvoker +) { implicit val formats = new org.json4s.DefaultFormats { override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") @@ -54,10 +56,12 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", implicit val stringWriter = RequestWriters.StringWriter implicit val jsonWriter = JsonFormatsWriter - var basePath = defBasePath - var apiInvoker = defApiInvoker + var basePath: String = defBasePath + var apiInvoker: ApiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String): mutable.HashMap[String, String] = { + apiInvoker.defaultHeaders += key -> value + } val config = SwaggerConfig.forUrl(new URI(defBasePath)) val client = new RestClient(config) @@ -87,7 +91,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.createUser(body) } - /** * Creates list of users with given input array * @@ -112,7 +115,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.createUsersWithArrayInput(body) } - /** * Creates list of users with given input array * @@ -137,7 +139,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.createUsersWithListInput(body) } - /** * Delete user * This can only be done by the logged in user. @@ -162,7 +163,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.deleteUser(username) } - /** * Get user by user name * @@ -187,7 +187,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.getUserByName(username) } - /** * Logs user into the system * @@ -214,7 +213,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.loginUser(username, password) } - /** * Logs out current logged in user session * @@ -237,7 +235,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.logoutUser() } - /** * Updated user * This can only be done by the logged in user. @@ -264,7 +261,6 @@ class UserApi(val defBasePath: String = "http://petstore.swagger.io/v2", helper.updateUser(username, body) } - } class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { From 634dc07719aab76e916108b7d83a0b070101d848 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 29 Sep 2017 22:02:41 +0800 Subject: [PATCH 087/197] update tech comm, fix broken link to 2.0.17 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8692603a099..7f215964226 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes [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) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) -2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) +2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) @@ -1049,7 +1049,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | -| C# | @mandrean (2017/08) | +| C# | @mandrean (2017/08) @jimschubert (2017/09) | | Clojure | | | Dart | @ircecho (2017/07) | | Eiffel | @jvelilla (2017/09) | @@ -1058,8 +1058,8 @@ If you want to join the committee, please kindly apply by sending an email to wi | Groovy | | | Go | | | Haskell | | -| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) | -| Kotlin | | +| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) | +| Kotlin | @jimschubert (2017/09) | | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | @@ -1069,7 +1069,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) | -| Scala | @clasnake (2017/07) | +| Scala | @clasnake (2017/07) @jimschubert (2017/09) | | Swift | @jgavris (2017/07) @ehyche (2017/08) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | From e3c61cd1e42c17e8b90b209296a72b1f51f1847c Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 30 Sep 2017 14:24:38 +0800 Subject: [PATCH 088/197] add cbornet to python tech committee --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f215964226..96af0c1ddc7 100644 --- a/README.md +++ b/README.md @@ -1065,7 +1065,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | ObjC | | | Perl | @wing328 (2017/07) | | PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) | -| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) | +| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) | | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | From da37f40202ac964d8ab4a4f70343da90694ff4ed Mon Sep 17 00:00:00 2001 From: Adrian Moos Date: Sat, 30 Sep 2017 11:19:39 +0200 Subject: [PATCH 089/197] Add optional support for HttpClient (#6295) * fix compilation error in eclipse by updating package declarations in moved files (eclipse validates that package and folder names match) * permit specifying the full angular version simplifying the templates by moving trivial case splits to the model * remove dead code this method is never called ... * support HttpClient in addition to Http, clean up generated code Fixes #6080 * added new sample, and regenerated existing samples * updated samples this time with the freshly build generator ... * improve formatting * updated samples * fix compilation error in generated code the overload for blobs does not have a type parameter * added the first test for the utils package * fix extra trainling commas in function argument lists * regenerated samples --- ...pescript-angular-v4.3-petstore-with-npm.sh | 31 ++ .../TypeScriptAngularClientCodegen.java | 94 +++--- .../java/io/swagger/codegen/utils/SemVer.java | 33 ++ .../typescript-angular/api.service.mustache | 158 ++++----- .../typescript-angular/package.mustache | 18 +- .../typescript-angular/variables.mustache | 4 +- .../TypeScriptAngularClientOptionsTest.java | 2 - .../TypeScriptAngularJsClientOptionsTest.java | 2 +- .../TypeScriptAngularJsModelTest.java | 2 +- .../io/swagger/codegen/utils/SemVerTest.java | 21 ++ .../default/api/pet.service.ts | 277 ++++----------- .../default/api/store.service.ts | 115 +------ .../default/api/user.service.ts | 219 ++---------- .../npm/api/pet.service.ts | 276 ++++----------- .../npm/api/store.service.ts | 115 +------ .../npm/api/user.service.ts | 198 ++--------- .../typescript-angular-v2/npm/package.json | 18 +- .../with-interfaces/api/pet.service.ts | 276 ++++----------- .../with-interfaces/api/store.service.ts | 115 +------ .../with-interfaces/api/user.service.ts | 218 ++---------- .../typescript-angular-v4.3/npm/.gitignore | 4 + .../npm/.swagger-codegen-ignore | 23 ++ .../npm/.swagger-codegen/VERSION | 1 + .../typescript-angular-v4.3/npm/README.md | 98 ++++++ .../typescript-angular-v4.3/npm/api.module.ts | 23 ++ .../typescript-angular-v4.3/npm/api/api.ts | 7 + .../npm/api/pet.service.ts | 319 ++++++++++++++++++ .../npm/api/store.service.ts | 133 ++++++++ .../npm/api/user.service.ts | 217 ++++++++++++ .../npm/configuration.ts | 26 ++ .../typescript-angular-v4.3/npm/encoder.ts | 17 + .../typescript-angular-v4.3/npm/git_push.sh | 52 +++ .../typescript-angular-v4.3/npm/index.ts | 5 + .../npm/model/apiResponse.ts | 25 ++ .../npm/model/category.ts | 23 ++ .../npm/model/models.ts | 6 + .../npm/model/order.ts | 41 +++ .../typescript-angular-v4.3/npm/model/pet.ts | 43 +++ .../typescript-angular-v4.3/npm/model/tag.ts | 23 ++ .../typescript-angular-v4.3/npm/model/user.ts | 38 +++ .../typescript-angular-v4.3/npm/package.json | 40 +++ .../npm/rxjs-operators.ts | 11 + .../typescript-angular-v4.3/npm/tsconfig.json | 25 ++ .../typescript-angular-v4.3/npm/typings.json | 5 + .../typescript-angular-v4.3/npm/variables.ts | 9 + .../npm/api/pet.service.ts | 275 ++++----------- .../npm/api/store.service.ts | 115 +------ .../npm/api/user.service.ts | 218 ++---------- .../typescript-angular-v4/npm/package.json | 18 +- 49 files changed, 1896 insertions(+), 2136 deletions(-) create mode 100644 bin/typescript-angular-v4.3-petstore-with-npm.sh create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/SemVer.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/utils/SemVerTest.java create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen-ignore create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/README.md create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/index.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/package.json create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/typings.json create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/variables.ts diff --git a/bin/typescript-angular-v4.3-petstore-with-npm.sh b/bin/typescript-angular-v4.3-petstore-with-npm.sh new file mode 100644 index 00000000000..35f8447c5de --- /dev/null +++ b/bin/typescript-angular-v4.3-petstore-with-npm.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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular-v4.3/npm --additional-properties ngVersion=4.3" + +java $JAVA_OPTS -jar $executable $ags 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 bd29088651f..b2d4d5f316a 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 @@ -6,6 +6,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -14,6 +15,7 @@ import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.SupportingFile; +import io.swagger.codegen.utils.SemVer; import io.swagger.models.ModelImpl; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.BooleanProperty; @@ -35,7 +37,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode protected String npmName = null; protected String npmVersion = "1.0.0"; protected String npmRepository = null; - protected String ngVersion = "4"; public TypeScriptAngularClientCodegen() { super(); @@ -55,7 +56,7 @@ public TypeScriptAngularClientCodegen() { this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); - this.cliOptions.add(new CliOption(NG_VERSION, "The version of Angular (2 or 4). Default is '4'")); + this.cliOptions.add(new CliOption(NG_VERSION, "The version of Angular. Default is '4.3'")); } @Override @@ -100,21 +101,18 @@ public void processOpts() { } // determine NG version + SemVer ngVersion; if (additionalProperties.containsKey(NG_VERSION)) { - if ("2".equals(additionalProperties.get(NG_VERSION).toString())) { - additionalProperties.put("isNg2x", true); - setNgVersion("2"); - } else if ("4".equals(additionalProperties.get(NG_VERSION).toString())) { - additionalProperties.put("isNg4x", true); - setNgVersion("4"); - } else { - throw new IllegalArgumentException("Invalid ngVersion, which must be either '2' or '4'"); - } + ngVersion = new SemVer(additionalProperties.get(NG_VERSION).toString()); } else { - // default to 4 - additionalProperties.put("isNg4x", true); - setNgVersion("4"); + ngVersion = new SemVer("4.3.0"); + LOGGER.info("generating code for Angular {} ...", ngVersion); + LOGGER.info(" (you can select the angular version by setting the additionalProperty ngVersion)"); } + additionalProperties.put(NG_VERSION, ngVersion); + additionalProperties.put("injectionToken", ngVersion.atLeast("4.0.0") ? "InjectionToken" : "OpaqueToken"); + additionalProperties.put("injectionTokenTyped", ngVersion.atLeast("4.0.0")); + additionalProperties.put("useHttpClient", ngVersion.atLeast("4.3.0")); } private void addNpmPackageGeneration() { @@ -217,36 +215,40 @@ public Map postProcessOperations(Map operations) List ops = (List) objs.get("operation"); for (CodegenOperation op : ops) { - // Convert httpMethod to Angular's RequestMethod enum - // https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html - switch (op.httpMethod) { - case "GET": - op.httpMethod = "RequestMethod.Get"; - break; - case "POST": - op.httpMethod = "RequestMethod.Post"; - break; - case "PUT": - op.httpMethod = "RequestMethod.Put"; - break; - case "DELETE": - op.httpMethod = "RequestMethod.Delete"; - break; - case "OPTIONS": - op.httpMethod = "RequestMethod.Options"; - break; - case "HEAD": - op.httpMethod = "RequestMethod.Head"; - break; - case "PATCH": - op.httpMethod = "RequestMethod.Patch"; - break; - default: - throw new RuntimeException("Unknown HTTP Method " + op.httpMethod + " not allowed"); + if ((boolean) additionalProperties.get("useHttpClient")) { + op.httpMethod = op.httpMethod.toLowerCase(Locale.ENGLISH); + } else { + // Convert httpMethod to Angular's RequestMethod enum + // https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html + switch (op.httpMethod) { + case "GET": + op.httpMethod = "RequestMethod.Get"; + break; + case "POST": + op.httpMethod = "RequestMethod.Post"; + break; + case "PUT": + op.httpMethod = "RequestMethod.Put"; + break; + case "DELETE": + op.httpMethod = "RequestMethod.Delete"; + break; + case "OPTIONS": + op.httpMethod = "RequestMethod.Options"; + break; + case "HEAD": + op.httpMethod = "RequestMethod.Head"; + break; + case "PATCH": + op.httpMethod = "RequestMethod.Patch"; + break; + default: + throw new RuntimeException("Unknown HTTP Method " + op.httpMethod + " not allowed"); + } } - // Convert path to TypeScript template string - op.path = op.path.replaceAll("\\{(.*?)\\}", "\\$\\{$1\\}"); + // Convert path to TypeScript template string, applying URI encoding + op.path = op.path.replaceAll("\\{(.*?)\\}", "\\$\\{encodeURIComponent($1)\\}"); } // Add additional filename information for model imports in the services @@ -316,14 +318,6 @@ public String toModelImport(String name) { return modelPackage() + "/" + toModelFilename(name); } - public String getNgVersion() { - return ngVersion; - } - - public void setNgVersion(String ngVersion) { - this.ngVersion = ngVersion; - } - public String getNpmName() { return npmName; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/SemVer.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/SemVer.java new file mode 100644 index 00000000000..ec8b17f31bb --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/utils/SemVer.java @@ -0,0 +1,33 @@ +package io.swagger.codegen.utils; + +public class SemVer implements Comparable { + + public final int major; + public final int minor; + public final int revision; + + public SemVer(String versionString) { + String[] tokens = versionString.split("\\."); + major = Integer.parseInt(tokens[0]); + minor = tokens.length < 2 ? 0 : Integer.parseInt(tokens[1]); + revision = tokens.length < 3 ? 0 : Integer.parseInt(tokens[2]); + } + + @Override + public int compareTo(SemVer o) { + int cmp = major - o.major; + if (cmp != 0) return cmp; + cmp = minor - o.minor; + if (cmp != 0) return cmp; + return revision - o.revision; + } + + public boolean atLeast(String other) { + return compareTo(new SemVer(other)) >= 0; + } + + @Override + public String toString() { + return major + "." + minor + "." + revision; + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index c8775b7d7dd..5426add37bd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -2,9 +2,14 @@ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; +{{#useHttpClient}} +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; +{{/useHttpClient}} +{{^useHttpClient}} import { Http, Headers, URLSearchParams } from '@angular/http'; import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; import { Response, ResponseContentType } from '@angular/http'; +{{/useHttpClient}} import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; @@ -36,34 +41,19 @@ export class {{classname}} { {{/withInterfaces}} protected basePath = '{{{basePath}}}'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new {{#useHttpClient}}Http{{/useHttpClient}}Headers(); + public configuration = new Configuration(); - constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor(protected {{#useHttpClient}}httpClient: HttpClient{{/useHttpClient}}{{^useHttpClient}}http: Http{{/useHttpClient}}, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -78,11 +68,15 @@ export class {{classname}} { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } +{{^useHttpClient}} +{{! not sure why we used to generate a second method here rather than inlining those few lines of code, + but let's keep it for now for the sake of backwards compatiblity. }} {{#operation}} /** * {{¬es}} @@ -91,12 +85,8 @@ export class {{classname}} { {{/summary}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ -{{^isResponseFile}} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { -{{/isResponseFile}} -{{#isResponseFile}} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}|undefined{{/returnType}}{{^returnType}}{}{{/returnType}}> { -{{/isResponseFile}} + {{! if you change this method signature, also change the version below }} + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}, extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -113,6 +103,7 @@ export class {{classname}} { } {{/operation}} +{{/useHttpClient}} {{#operation}} /** @@ -120,133 +111,112 @@ export class {{classname}} { * {{notes}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { - const path = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('${' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - + public {{nickname}}{{^useHttpClient}}WithHttpInfo{{/useHttpClient}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}, extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#useHttpClient}}{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}{{/useHttpClient}}{{^useHttpClient}}Response{{/useHttpClient}}> { {{#allParams}} {{#required}} - // verify required parameter '{{paramName}}' is not null or undefined if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } {{/required}} {{/allParams}} + +{{#hasQueryParams}} + let queryParameters = new {{#useHttpClient}}HttpParams{{/useHttpClient}}{{^useHttpClient}}URLSearchParams{{/useHttpClient}}(); {{#queryParams}} {{#isListContainer}} if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - queryParameters.append('{{baseName}}', element); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.append('{{baseName}}', element); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - queryParameters.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', {{paramName}}.toISOString()); {{/isDateTime}} {{^isDateTime}} - queryParameters.set('{{baseName}}', {{paramName}}); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', {{paramName}}); {{/isDateTime}} } {{/isListContainer}} - {{/queryParams}} + +{{/hasQueryParams}} + let headers = {{#useHttpClient}}this.defaultHeaders;{{/useHttpClient}}{{^useHttpClient}}new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845{{/useHttpClient}} {{#headerParams}} {{#isListContainer}} if ({{paramName}}) { - headers.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined && {{paramName}} !== null) { - headers.set('{{baseName}}', String({{paramName}})); + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{baseName}}', String({{paramName}})); } {{/isListContainer}} - {{/headerParams}} -{{#hasFormParams}} - // to determine the Content-Type header - let consumes: string[] = [ - {{#consumes}} - '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} - {{/consumes}} - ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - - let canConsumeForm = this.canConsumeForm(consumes); - let useForm = false; -{{#formParams}} -{{#isFile}} - useForm = canConsumeForm; -{{/isFile}} -{{/formParams}} - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; -{{/hasFormParams}} - - // to determine the Accept header - let produces: string[] = [ - {{#produces}} - '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} - {{/produces}} - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } {{#authMethods}} // authentication ({{name}}) required {{#isApiKey}} {{#isKeyInHeader}} if (this.configuration.apiKeys["{{keyParamName}}"]) { - headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); } {{/isKeyInHeader}} {{#isKeyInQuery}} if (this.configuration.apiKeys["{{keyParamName}}"]) { - queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); } {{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} - // http basic authentication required if (this.configuration.username || this.configuration.password) { - headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); } {{/isBasic}} {{#isOAuth}} - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); + {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('Authorization', 'Bearer ' + accessToken); } {{/isOAuth}} {{/authMethods}} - {{#bodyParam}} +{{^useHttpClient}} headers.set('Content-Type', 'application/json'); +{{/useHttpClient}} {{/bodyParam}} +{{#hasFormParams}} + // to determine the Content-Type header + let consumes: string[] = [ + {{#consumes}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} + {{/consumes}} + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; +{{#formParams}} +{{#isFile}} + useForm = canConsumeForm; +{{/isFile}} +{{/formParams}} + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; {{#formParams}} {{#isListContainer}} if ({{paramName}}) { @@ -265,8 +235,22 @@ export class {{classname}} { formParams.set('{{baseName}}', {{paramName}}); } {{/isListContainer}} - {{/formParams}} + +{{/hasFormParams}} +{{#useHttpClient}} + return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#bodyParam}}{{paramName}}, {{/bodyParam}}{{#hasFormParams}}formParams, {{/hasFormParams}}{ +{{#hasQueryParams}} + params: queryParameters, +{{/hasQueryParams}} + headers: headers, +{{#isResponseFile}} + responseType: "blob", +{{/isResponseFile}} + withCredentials: this.configuration.withCredentials, + }); +{{/useHttpClient}} +{{^useHttpClient}} let requestOptions: RequestOptionsArgs = new RequestOptions({ method: {{httpMethod}}, headers: headers, @@ -279,7 +263,9 @@ export class {{classname}} { {{#isResponseFile}} responseType: ResponseContentType.Blob, {{/isResponseFile}} +{{#hasQueryParams}} search: queryParameters, +{{/hasQueryParams}} withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -287,9 +273,9 @@ export class {{classname}} { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}{{{path}}}`, requestOptions); +{{/useHttpClient}} } -{{/operation}} -} +{{/operation}}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache index 8c4dd1749b5..9123cb8eb66 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache @@ -14,21 +14,21 @@ "postinstall": "npm run build" }, "peerDependencies": { - "@angular/core": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/http": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/common": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/compiler": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", + "@angular/core": "^{{ngVersion}}", + "@angular/http": "^{{ngVersion}}", + "@angular/common": "^{{ngVersion}}", + "@angular/compiler": "^{{ngVersion}}", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6" }, "devDependencies": { - "@angular/core": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/http": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/common": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/compiler": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", - "@angular/platform-browser": "{{#isNg2x}}^2.2.2{{/isNg2x}}{{#isNg4x}}^4.2.5{{/isNg4x}}", + "@angular/core": "^{{ngVersion}}", + "@angular/http": "^{{ngVersion}}", + "@angular/common": "^{{ngVersion}}", + "@angular/compiler": "^{{ngVersion}}", + "@angular/platform-browser": "^{{ngVersion}}", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6", diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/variables.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/variables.mustache index 59e72e28ca9..b3241fcebcd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/variables.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/variables.mustache @@ -1,6 +1,6 @@ -import { {{#isNg2x}}OpaqueToken{{/isNg2x}}{{#isNg4x}}InjectionToken{{/isNg4x}} } from '@angular/core'; +import { {{injectionToken}} } from '@angular/core'; -export const BASE_PATH = new {{#isNg2x}}OpaqueToken{{/isNg2x}}{{#isNg4x}}InjectionToken{{/isNg4x}}('basePath'); +export const BASE_PATH = new {{injectionToken}}{{#injectionTokenTyped}}{{/injectionTokenTyped}}('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java index f7b8f994231..6dd88157eb1 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java @@ -30,8 +30,6 @@ protected void setExpectations() { times = 1; clientCodegen.setModelPropertyNaming(TypeScriptAngularClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); times = 1; - clientCodegen.setNgVersion(TypeScriptAngularClientOptionsProvider.NG_VERSION); - times = 1; clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE)); times = 1; }}; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java index 21ec78e7552..49bad5d9335 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java @@ -1,4 +1,4 @@ -package io.swagger.codegen.typescript.typescriptangular; +package io.swagger.codegen.typescript.typescriptangularjs; import io.swagger.codegen.AbstractOptionsTest; import io.swagger.codegen.CodegenConfig; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java index 7f3fd744a20..cb0e7bec7f3 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java @@ -1,4 +1,4 @@ -package io.swagger.codegen.typescript.typescriptangular; +package io.swagger.codegen.typescript.typescriptangularjs; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenProperty; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/utils/SemVerTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/utils/SemVerTest.java new file mode 100644 index 00000000000..ed7c38b1130 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/utils/SemVerTest.java @@ -0,0 +1,21 @@ +package io.swagger.codegen.utils; + +import org.testng.annotations.Test; + +import static org.testng.Assert.*; + +public class SemVerTest { + + @Test + public void parsingAndPrinting() { + assertEquals("4.3.0", new SemVer("4.3").toString()); + } + + @Test + public void atLeast() { + assertTrue(new SemVer("3.2.1").atLeast("3.2.1")); + assertTrue(new SemVer("3.2.1").atLeast("2.3.4")); + assertFalse(new SemVer("3.2.1").atLeast("3.3.0")); + } + +} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index f8265399f42..810cc78fea1 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -32,8 +32,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class PetService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -41,25 +41,10 @@ export class PetService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -74,6 +59,7 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -84,7 +70,7 @@ export class PetService { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.addPetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -101,7 +87,7 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}> { + public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deletePetWithHttpInfo(petId, apiKey, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -117,7 +103,7 @@ export class PetService { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByStatus(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -133,7 +119,7 @@ export class PetService { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -149,7 +135,7 @@ export class PetService { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, extraHttpRequestParams?: any): Observable { + public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -165,7 +151,7 @@ export class PetService { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -183,7 +169,7 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -201,7 +187,7 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -218,29 +204,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -248,14 +219,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +232,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -272,34 +241,17 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (apiKey !== undefined && apiKey !== null) { headers.set('api_key', String(apiKey)); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -307,11 +259,9 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -319,7 +269,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -327,33 +277,19 @@ export class PetService { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByStatus'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'status' is not null or undefined + public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } + + let queryParameters = new URLSearchParams(); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -361,7 +297,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -373,7 +308,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions); } /** @@ -381,33 +316,19 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByTags'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'tags' is not null or undefined + public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } + + let queryParameters = new URLSearchParams(); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -415,7 +336,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -427,7 +347,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions); } /** @@ -435,38 +355,21 @@ export class PetService { * Returns a single pet * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -474,7 +377,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -482,29 +385,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -512,14 +400,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -527,7 +413,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -537,44 +423,14 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - // to determine the Content-Type header - let consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - - let canConsumeForm = this.canConsumeForm(consumes); - let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -582,11 +438,19 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header + let consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; if (name !== undefined) { formParams.set('name', name); } - if (status !== undefined) { formParams.set('status', status); } @@ -595,7 +459,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -603,7 +466,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -613,26 +476,25 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -640,29 +502,9 @@ export class PetService { set(param: string, value: any): void; }; - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - // authentication (petstore_auth) required - // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); - } - - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } - if (file !== undefined) { formParams.set('file', file); } @@ -671,7 +513,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -679,7 +520,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 4f4189c369b..ece39b793e5 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class StoreService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class StoreService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -83,7 +68,7 @@ export class StoreService { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteOrderWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -98,7 +83,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }> { + public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -114,7 +99,7 @@ export class StoreService { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, extraHttpRequestParams?: any): Observable { + public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getOrderByIdWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -130,7 +115,7 @@ export class StoreService { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: any): Observable { + public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,33 +132,16 @@ export class StoreService { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -181,39 +149,25 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/inventory'; + public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -221,7 +175,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/inventory`, requestOptions); } /** @@ -229,33 +183,16 @@ export class StoreService { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +200,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** @@ -271,27 +208,12 @@ export class StoreService { * * @param body order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -299,7 +221,6 @@ export class StoreService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -307,7 +228,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index f9cf1b9fb71..dd5cfdb4a63 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class UserService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class UserService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -73,6 +58,7 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -83,7 +69,7 @@ export class UserService { * @summary Create user * @param body Created user object */ - public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> { + public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUserWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -99,7 +85,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -115,7 +101,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -131,7 +117,7 @@ export class UserService { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteUserWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,7 +133,7 @@ export class UserService { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, extraHttpRequestParams?: any): Observable { + public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getUserByNameWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -164,7 +150,7 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable { + public loginUser(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.loginUserWithHttpInfo(username, password, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -179,7 +165,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(extraHttpRequestParams?: any): Observable<{}> { + public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -196,7 +182,7 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> { + public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -213,27 +199,12 @@ export class UserService { * This can only be done by the logged in user. * @param body Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -241,7 +212,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -249,7 +219,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user`, requestOptions); } /** @@ -257,27 +227,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithArray'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -285,7 +240,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -293,7 +247,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithArray`, requestOptions); } /** @@ -301,27 +255,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithList'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -329,7 +268,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -337,7 +275,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithList`, requestOptions); } /** @@ -345,33 +283,16 @@ export class UserService { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -379,7 +300,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -387,33 +308,16 @@ export class UserService { * * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -421,7 +325,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -430,39 +334,23 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/login'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } - // verify required parameter 'password' is not null or undefined if (password === null || password === undefined) { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } + + let queryParameters = new URLSearchParams(); if (username !== undefined) { queryParameters.set('username', username); } - if (password !== undefined) { queryParameters.set('password', password); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -475,35 +363,20 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/login`, requestOptions); } /** * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/logout'; + public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -511,7 +384,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/logout`, requestOptions); } /** @@ -520,32 +393,15 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -553,7 +409,6 @@ export class UserService { method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -561,7 +416,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index f8265399f42..6be4b769281 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -32,8 +32,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class PetService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -41,25 +41,10 @@ export class PetService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -84,7 +69,7 @@ export class PetService { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.addPetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -101,7 +86,7 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}> { + public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deletePetWithHttpInfo(petId, apiKey, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -117,7 +102,7 @@ export class PetService { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByStatus(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -133,7 +118,7 @@ export class PetService { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -149,7 +134,7 @@ export class PetService { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, extraHttpRequestParams?: any): Observable { + public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -165,7 +150,7 @@ export class PetService { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -183,7 +168,7 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -201,7 +186,7 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -218,29 +203,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -248,14 +218,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +231,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -272,34 +240,17 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (apiKey !== undefined && apiKey !== null) { headers.set('api_key', String(apiKey)); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -307,11 +258,9 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -319,7 +268,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -327,33 +276,19 @@ export class PetService { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByStatus'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'status' is not null or undefined + public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } + + let queryParameters = new URLSearchParams(); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -361,7 +296,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -373,7 +307,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions); } /** @@ -381,33 +315,19 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByTags'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'tags' is not null or undefined + public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } + + let queryParameters = new URLSearchParams(); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -415,7 +335,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -427,7 +346,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions); } /** @@ -435,38 +354,21 @@ export class PetService { * Returns a single pet * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -474,7 +376,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -482,29 +384,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -512,14 +399,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -527,7 +412,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -537,44 +422,14 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - // to determine the Content-Type header - let consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); - let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -582,11 +437,19 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header + let consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; if (name !== undefined) { formParams.set('name', name); } - if (status !== undefined) { formParams.set('status', status); } @@ -595,7 +458,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -603,7 +465,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -613,26 +475,25 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -640,29 +501,9 @@ export class PetService { set(param: string, value: any): void; }; - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - // authentication (petstore_auth) required - // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); - } - - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } - if (file !== undefined) { formParams.set('file', file); } @@ -671,7 +512,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -679,7 +519,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 4f4189c369b..ece39b793e5 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class StoreService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class StoreService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -83,7 +68,7 @@ export class StoreService { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteOrderWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -98,7 +83,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }> { + public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -114,7 +99,7 @@ export class StoreService { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, extraHttpRequestParams?: any): Observable { + public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getOrderByIdWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -130,7 +115,7 @@ export class StoreService { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: any): Observable { + public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,33 +132,16 @@ export class StoreService { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -181,39 +149,25 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/inventory'; + public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -221,7 +175,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/inventory`, requestOptions); } /** @@ -229,33 +183,16 @@ export class StoreService { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +200,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** @@ -271,27 +208,12 @@ export class StoreService { * * @param body order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -299,7 +221,6 @@ export class StoreService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -307,7 +228,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index f9cf1b9fb71..df87073fcae 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class UserService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class UserService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -83,7 +68,7 @@ export class UserService { * @summary Create user * @param body Created user object */ - public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> { + public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUserWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -99,7 +84,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -115,7 +100,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -131,7 +116,7 @@ export class UserService { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteUserWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,7 +132,7 @@ export class UserService { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, extraHttpRequestParams?: any): Observable { + public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getUserByNameWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -164,7 +149,7 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable { + public loginUser(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.loginUserWithHttpInfo(username, password, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -179,7 +164,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(extraHttpRequestParams?: any): Observable<{}> { + public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -196,7 +181,7 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> { + public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -213,27 +198,12 @@ export class UserService { * This can only be done by the logged in user. * @param body Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -241,7 +211,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -249,7 +218,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user`, requestOptions); } /** @@ -257,27 +226,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithArray'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -285,7 +239,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -293,7 +246,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithArray`, requestOptions); } /** @@ -301,27 +254,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithList'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -329,7 +267,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -337,7 +274,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithList`, requestOptions); } /** @@ -345,33 +282,16 @@ export class UserService { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -379,7 +299,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -387,33 +307,16 @@ export class UserService { * * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -421,7 +324,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -430,28 +333,23 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/login'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } - // verify required parameter 'password' is not null or undefined if (password === null || password === undefined) { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } + + let queryParameters = new URLSearchParams(); if (username !== undefined) { queryParameters.set('username', username); } - if (password !== undefined) { queryParameters.set('password', password); } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // to determine the Accept header let produces: string[] = [ @@ -463,7 +361,6 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -475,20 +372,17 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/login`, requestOptions); } /** * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/logout'; + public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // to determine the Accept header let produces: string[] = [ 'application/xml', @@ -499,11 +393,9 @@ export class UserService { headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -511,7 +403,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/logout`, requestOptions); } /** @@ -520,32 +412,15 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -553,7 +428,6 @@ export class UserService { method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -561,7 +435,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/package.json b/samples/client/petstore/typescript-angular-v2/npm/package.json index d2e8c69bf95..d6aee04c589 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/package.json +++ b/samples/client/petstore/typescript-angular-v2/npm/package.json @@ -14,21 +14,21 @@ "postinstall": "npm run build" }, "peerDependencies": { - "@angular/core": "^2.2.2", - "@angular/http": "^2.2.2", - "@angular/common": "^2.2.2", - "@angular/compiler": "^2.2.2", + "@angular/core": "^2.0.0", + "@angular/http": "^2.0.0", + "@angular/common": "^2.0.0", + "@angular/compiler": "^2.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6" }, "devDependencies": { - "@angular/core": "^2.2.2", - "@angular/http": "^2.2.2", - "@angular/common": "^2.2.2", - "@angular/compiler": "^2.2.2", - "@angular/platform-browser": "^2.2.2", + "@angular/core": "^2.0.0", + "@angular/http": "^2.0.0", + "@angular/common": "^2.0.0", + "@angular/compiler": "^2.0.0", + "@angular/platform-browser": "^2.0.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6", diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 0ab81caabba..7ac0f042a05 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -33,8 +33,8 @@ import { PetServiceInterface } from './PetServiceInte export class PetService implements PetServiceInterface { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -42,25 +42,10 @@ export class PetService implements PetServiceInterface { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -85,7 +70,7 @@ export class PetService implements PetServiceInterface { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.addPetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -102,7 +87,7 @@ export class PetService implements PetServiceInterface { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}> { + public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deletePetWithHttpInfo(petId, apiKey, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -118,7 +103,7 @@ export class PetService implements PetServiceInterface { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByStatus(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -134,7 +119,7 @@ export class PetService implements PetServiceInterface { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -150,7 +135,7 @@ export class PetService implements PetServiceInterface { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, extraHttpRequestParams?: any): Observable { + public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -166,7 +151,7 @@ export class PetService implements PetServiceInterface { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -184,7 +169,7 @@ export class PetService implements PetServiceInterface { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -202,7 +187,7 @@ export class PetService implements PetServiceInterface { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -219,29 +204,14 @@ export class PetService implements PetServiceInterface { * * @param body Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -249,14 +219,12 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -264,7 +232,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -273,34 +241,17 @@ export class PetService implements PetServiceInterface { * @param petId Pet id to delete * @param apiKey */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (apiKey !== undefined && apiKey !== null) { headers.set('api_key', String(apiKey)); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -308,11 +259,9 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -320,7 +269,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -328,33 +277,19 @@ export class PetService implements PetServiceInterface { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByStatus'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'status' is not null or undefined + public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } + + let queryParameters = new URLSearchParams(); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -362,7 +297,6 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -374,7 +308,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions); } /** @@ -382,33 +316,19 @@ export class PetService implements PetServiceInterface { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByTags'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'tags' is not null or undefined + public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } + + let queryParameters = new URLSearchParams(); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -416,7 +336,6 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -428,7 +347,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions); } /** @@ -436,38 +355,21 @@ export class PetService implements PetServiceInterface { * Returns a single pet * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -475,7 +377,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -483,29 +385,14 @@ export class PetService implements PetServiceInterface { * * @param body Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -513,14 +400,12 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -528,7 +413,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -538,44 +423,14 @@ export class PetService implements PetServiceInterface { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - // to determine the Content-Type header - let consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); - let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -583,11 +438,19 @@ export class PetService implements PetServiceInterface { headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header + let consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; if (name !== undefined) { formParams.set('name', name); } - if (status !== undefined) { formParams.set('status', status); } @@ -596,7 +459,6 @@ export class PetService implements PetServiceInterface { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -604,7 +466,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -614,26 +476,25 @@ export class PetService implements PetServiceInterface { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -641,29 +502,9 @@ export class PetService implements PetServiceInterface { set(param: string, value: any): void; }; - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - // authentication (petstore_auth) required - // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); - } - - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } - if (file !== undefined) { formParams.set('file', file); } @@ -672,7 +513,6 @@ export class PetService implements PetServiceInterface { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -680,7 +520,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index bc30294b63a..7979fcedac2 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -32,8 +32,8 @@ import { StoreServiceInterface } from './StoreService export class StoreService implements StoreServiceInterface { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -41,25 +41,10 @@ export class StoreService implements StoreServiceInterface { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -84,7 +69,7 @@ export class StoreService implements StoreServiceInterface { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteOrderWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -99,7 +84,7 @@ export class StoreService implements StoreServiceInterface { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }> { + public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -115,7 +100,7 @@ export class StoreService implements StoreServiceInterface { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, extraHttpRequestParams?: any): Observable { + public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getOrderByIdWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -131,7 +116,7 @@ export class StoreService implements StoreServiceInterface { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: any): Observable { + public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -148,33 +133,16 @@ export class StoreService implements StoreServiceInterface { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -182,39 +150,25 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/inventory'; + public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -222,7 +176,7 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/inventory`, requestOptions); } /** @@ -230,33 +184,16 @@ export class StoreService implements StoreServiceInterface { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -264,7 +201,7 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** @@ -272,27 +209,12 @@ export class StoreService implements StoreServiceInterface { * * @param body order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -300,7 +222,6 @@ export class StoreService implements StoreServiceInterface { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -308,7 +229,7 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 031f886731e..956a6cb3eb1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -32,8 +32,8 @@ import { UserServiceInterface } from './UserServiceIn export class UserService implements UserServiceInterface { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -41,25 +41,10 @@ export class UserService implements UserServiceInterface { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -84,7 +69,7 @@ export class UserService implements UserServiceInterface { * @summary Create user * @param body Created user object */ - public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> { + public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUserWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -100,7 +85,7 @@ export class UserService implements UserServiceInterface { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -116,7 +101,7 @@ export class UserService implements UserServiceInterface { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -132,7 +117,7 @@ export class UserService implements UserServiceInterface { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteUserWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -148,7 +133,7 @@ export class UserService implements UserServiceInterface { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, extraHttpRequestParams?: any): Observable { + public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getUserByNameWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -165,7 +150,7 @@ export class UserService implements UserServiceInterface { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable { + public loginUser(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.loginUserWithHttpInfo(username, password, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -180,7 +165,7 @@ export class UserService implements UserServiceInterface { * * @summary Logs out current logged in user session */ - public logoutUser(extraHttpRequestParams?: any): Observable<{}> { + public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -197,7 +182,7 @@ export class UserService implements UserServiceInterface { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> { + public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -214,27 +199,12 @@ export class UserService implements UserServiceInterface { * This can only be done by the logged in user. * @param body Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -242,7 +212,6 @@ export class UserService implements UserServiceInterface { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -250,7 +219,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user`, requestOptions); } /** @@ -258,27 +227,12 @@ export class UserService implements UserServiceInterface { * * @param body List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithArray'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -286,7 +240,6 @@ export class UserService implements UserServiceInterface { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -294,7 +247,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithArray`, requestOptions); } /** @@ -302,27 +255,12 @@ export class UserService implements UserServiceInterface { * * @param body List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithList'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -330,7 +268,6 @@ export class UserService implements UserServiceInterface { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -338,7 +275,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithList`, requestOptions); } /** @@ -346,33 +283,16 @@ export class UserService implements UserServiceInterface { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -380,7 +300,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -388,33 +308,16 @@ export class UserService implements UserServiceInterface { * * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -422,7 +325,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -431,39 +334,23 @@ export class UserService implements UserServiceInterface { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/login'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } - // verify required parameter 'password' is not null or undefined if (password === null || password === undefined) { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } + + let queryParameters = new URLSearchParams(); if (username !== undefined) { queryParameters.set('username', username); } - if (password !== undefined) { queryParameters.set('password', password); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -476,35 +363,20 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/login`, requestOptions); } /** * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/logout'; + public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -512,7 +384,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/logout`, requestOptions); } /** @@ -521,32 +393,15 @@ export class UserService implements UserServiceInterface { * @param username name that need to be deleted * @param body Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -554,7 +409,6 @@ export class UserService implements UserServiceInterface { method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -562,7 +416,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.gitignore b/samples/client/petstore/typescript-angular-v4.3/npm/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen-ignore b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.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/typescript-angular-v4.3/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-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 new file mode 100644 index 00000000000..038fd51491c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/README.md @@ -0,0 +1,98 @@ +## @swagger/angular2-typescript-petstore@0.0.1 + +### 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 @swagger/angular2-typescript-petstore@0.0.1 --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 @swagger/angular2-typescript-petstore@0.0.1 +``` + +In your angular2 project: + +``` +import { DefaultApi } from '@swagger/angular2-typescript-petstore/api/api'; +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [AppModule] +}) +export class CoreModule {} +``` +``` +import { DefaultApi } from '@swagger/angular2-typescript-petstore/api/api'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +### 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 './path-to-swagger-gen-service/index'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` + +#### 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 '@swagger/angular2-typescript-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent, + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: useValue: environment.API_BASE_PATH }], + bootstrap: [AppComponent] +}) +export class AppModule { } +``` \ No newline at end of file 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 new file mode 100644 index 00000000000..dcce0dbd628 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts @@ -0,0 +1,23 @@ +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HttpModule } from '@angular/http'; +import { Configuration } from './configuration'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [ CommonModule, HttpModule ], + declarations: [], + exports: [], + providers: [ PetService, StoreService, UserService ] +}) +export class ApiModule { + public static forConfig(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ {provide: Configuration, useFactory: configurationFactory}] + } + } +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/api.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts new file mode 100644 index 00000000000..9e7e00d1e48 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -0,0 +1,319 @@ +/** + * 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. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +import { Observable } from 'rxjs/Observable'; +import '../rxjs-operators'; + +import { ApiResponse } from '../model/apiResponse'; +import { Pet } from '../model/pet'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { CustomQueryEncoderHelper } from '../encoder'; + + +@Injectable() +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (basePath) { + this.basePath = basePath; + } + if (configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (let consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + */ + public addPet(body: Pet): Observable<{}> { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + return this.httpClient.post(`${this.basePath}/pet`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + */ + public deletePet(petId: number, apiKey?: string): Observable<{}> { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(petId)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + */ + public findPetsByStatus(status: Array): Observable> { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams(); + if (status) { + queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + return this.httpClient.get(`${this.basePath}/pet/findByStatus`, { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + */ + public findPetsByTags(tags: Array): Observable> { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams(); + if (tags) { + queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + return this.httpClient.get(`${this.basePath}/pet/findByTags`, { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + */ + public getPetById(petId: number): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(petId)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + */ + public updatePet(body: Pet): Observable<{}> { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + return this.httpClient.put(`${this.basePath}/pet`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + public updatePetWithForm(petId: number, name?: string, status?: string): Observable<{}> { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Content-Type header + let consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; + if (name !== undefined) { + formParams.set('name', name); + } + if (status !== undefined) { + formParams.set('status', status); + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(petId)}`, formParams, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Content-Type header + let consumes: string[] = [ + 'multipart/form-data' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + useForm = canConsumeForm; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; + if (additionalMetadata !== undefined) { + formParams.set('additionalMetadata', additionalMetadata); + } + if (file !== undefined) { + formParams.set('file', file); + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, formParams, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts new file mode 100644 index 00000000000..e52b46095ce --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -0,0 +1,133 @@ +/** + * 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. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +import { Observable } from 'rxjs/Observable'; +import '../rxjs-operators'; + +import { Order } from '../model/order'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { CustomQueryEncoderHelper } from '../encoder'; + + +@Injectable() +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (basePath) { + this.basePath = basePath; + } + if (configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (let consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + */ + public deleteOrder(orderId: string): Observable<{}> { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ + public getInventory(): Observable<{ [key: string]: number; }> { + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); + } + + return this.httpClient.get(`${this.basePath}/store/inventory`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + */ + public getOrderById(orderId: number): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + */ + public placeOrder(body: Order): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.post(`${this.basePath}/store/order`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts new file mode 100644 index 00000000000..cc53d7367bc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -0,0 +1,217 @@ +/** + * 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. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +import { Observable } from 'rxjs/Observable'; +import '../rxjs-operators'; + +import { User } from '../model/user'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { CustomQueryEncoderHelper } from '../encoder'; + + +@Injectable() +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (basePath) { + this.basePath = basePath; + } + if (configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (let consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + */ + public createUser(body: User): Observable<{}> { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.post(`${this.basePath}/user`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + */ + public createUsersWithArrayInput(body: Array): Observable<{}> { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.post(`${this.basePath}/user/createWithArray`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object + */ + public createUsersWithListInput(body: Array): Observable<{}> { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.post(`${this.basePath}/user/createWithList`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + */ + public deleteUser(username: string): Observable<{}> { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(username)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + */ + public getUserByName(username: string): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(username)}`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + */ + public loginUser(username: string, password: string): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams(); + if (username !== undefined) { + queryParameters = queryParameters.set('username', username); + } + if (password !== undefined) { + queryParameters = queryParameters.set('password', password); + } + + let headers = this.defaultHeaders; + + return this.httpClient.get(`${this.basePath}/user/login`, { + params: queryParameters, + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Logs out current logged in user session + * + */ + public logoutUser(): Observable<{}> { + + let headers = this.defaultHeaders; + + return this.httpClient.get(`${this.basePath}/user/logout`, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + */ + public updateUser(username: string, body: User): Observable<{}> { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(username)}`, body, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/configuration.ts b/samples/client/petstore/typescript-angular-v4.3/npm/configuration.ts new file mode 100644 index 00000000000..005c3a26df3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/configuration.ts @@ -0,0 +1,26 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts new file mode 100644 index 00000000000..319f79da15a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts @@ -0,0 +1,17 @@ +import { QueryEncoder } from "@angular/http"; + +/** +* CustomQueryEncoderHelper +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomQueryEncoderHelper extends QueryEncoder { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh new file mode 100644 index 00000000000..ed374619b13 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/index.ts b/samples/client/petstore/typescript-angular-v4.3/npm/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts new file mode 100644 index 00000000000..3af781cf580 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + + type?: string; + + message?: string; + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts new file mode 100644 index 00000000000..d09f8d7b265 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + + name?: string; + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts new file mode 100644 index 00000000000..402a86689c8 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts @@ -0,0 +1,41 @@ +/** + * 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. + */ + + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + + petId?: number; + + quantity?: number; + + shipDate?: Date; + + /** + * Order Status + */ + status?: Order.StatusEnum; + + complete?: boolean; + +} +export namespace Order { + export enum StatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' + } +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts new file mode 100644 index 00000000000..0d6137d02cf --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ + +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + + category?: Category; + + name: string; + + photoUrls: Array; + + tags?: Array; + + /** + * pet status in the store + */ + status?: Pet.StatusEnum; + +} +export namespace Pet { + export enum StatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' + } +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts new file mode 100644 index 00000000000..3ed1eeff8f3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + + name?: string; + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts new file mode 100644 index 00000000000..f4914ae2608 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts @@ -0,0 +1,38 @@ +/** + * 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. + */ + + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + + username?: string; + + firstName?: string; + + lastName?: string; + + email?: string; + + password?: string; + + phone?: string; + + /** + * User Status + */ + userStatus?: number; + +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/package.json b/samples/client/petstore/typescript-angular-v4.3/npm/package.json new file mode 100644 index 00000000000..40157c62927 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/package.json @@ -0,0 +1,40 @@ +{ + "name": "@swagger/angular2-typescript-petstore", + "version": "0.0.1", + "description": "swagger client for @swagger/angular2-typescript-petstore", + "author": "Swagger Codegen Contributors", + "keywords": [ + "swagger-client" + ], + "license": "Unlicense", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "scripts": { + "build": "tsc --outDir dist/", + "postinstall": "npm run build" + }, + "peerDependencies": { + "@angular/core": "^4.3.0", + "@angular/http": "^4.3.0", + "@angular/common": "^4.3.0", + "@angular/compiler": "^4.3.0", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^5.4.0", + "zone.js": "^0.7.6" + }, + "devDependencies": { + "@angular/core": "^4.3.0", + "@angular/http": "^4.3.0", + "@angular/common": "^4.3.0", + "@angular/compiler": "^4.3.0", + "@angular/platform-browser": "^4.3.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^5.4.0", + "zone.js": "^0.7.6", + "typescript": "^2.1.5" + }, + "publishConfig": { + "registry":"https://skimdb.npmjs.com/registry" + } +} 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.3/npm/tsconfig.json b/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json new file mode 100644 index 00000000000..a6e9096bbf7 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "es6", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/typings.json b/samples/client/petstore/typescript-angular-v4.3/npm/typings.json new file mode 100644 index 00000000000..507c40e5cbe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/typings.json @@ -0,0 +1,5 @@ +{ + "globalDependencies": { + "core-js": "registry:dt/core-js#0.0.0+20160725163759" + } +} diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/variables.ts b/samples/client/petstore/typescript-angular-v4.3/npm/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index f8265399f42..14993bde3d5 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -32,8 +32,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class PetService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -41,25 +41,10 @@ export class PetService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -84,7 +69,7 @@ export class PetService { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.addPetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -101,7 +86,7 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable<{}> { + public deletePet(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deletePetWithHttpInfo(petId, apiKey, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -117,7 +102,7 @@ export class PetService { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByStatus(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByStatusWithHttpInfo(status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -133,7 +118,7 @@ export class PetService { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, extraHttpRequestParams?: any): Observable> { + public findPetsByTags(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable> { return this.findPetsByTagsWithHttpInfo(tags, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -149,7 +134,7 @@ export class PetService { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, extraHttpRequestParams?: any): Observable { + public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getPetByIdWithHttpInfo(petId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -165,7 +150,7 @@ export class PetService { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: Pet, extraHttpRequestParams?: any): Observable<{}> { + public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -183,7 +168,7 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable<{}> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updatePetWithFormWithHttpInfo(petId, name, status, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -201,7 +186,7 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -218,29 +203,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -248,14 +218,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +231,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -272,34 +240,17 @@ export class PetService { * @param petId Pet id to delete * @param apiKey */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 if (apiKey !== undefined && apiKey !== null) { headers.set('api_key', String(apiKey)); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -311,7 +262,6 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -319,7 +269,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -327,33 +277,19 @@ export class PetService { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByStatus'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'status' is not null or undefined + public findPetsByStatusWithHttpInfo(status: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } + + let queryParameters = new URLSearchParams(); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -361,7 +297,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -373,7 +308,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByStatus`, requestOptions); } /** @@ -381,33 +316,19 @@ export class PetService { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/findByTags'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'tags' is not null or undefined + public findPetsByTagsWithHttpInfo(tags: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } + + let queryParameters = new URLSearchParams(); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -415,7 +336,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -427,7 +347,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/findByTags`, requestOptions); } /** @@ -435,38 +355,21 @@ export class PetService { * Returns a single pet * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -474,7 +377,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -482,29 +385,14 @@ export class PetService { * * @param body Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -512,14 +400,12 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - headers.set('Content-Type', 'application/json'); let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -527,7 +413,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet`, requestOptions); } /** @@ -537,44 +423,14 @@ export class PetService { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'petId' is not null or undefined + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - // to determine the Content-Type header - let consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); - let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (petstore_auth) required - // oauth required if (this.configuration.accessToken) { let accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() @@ -582,11 +438,19 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header + let consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + let canConsumeForm = this.canConsumeForm(consumes); + let useForm = false; + let formParams = new (useForm ? FormData : URLSearchParams as any)() as { + set(param: string, value: any): void; + }; if (name !== undefined) { formParams.set('name', name); } - if (status !== undefined) { formParams.set('status', status); } @@ -595,7 +459,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -603,7 +466,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); } /** @@ -613,26 +476,25 @@ export class PetService { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + let accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers.set('Authorization', 'Bearer ' + accessToken); } + // to determine the Content-Type header let consumes: string[] = [ 'multipart/form-data' ]; - - if (consumes != null && consumes.length > 0) { - headers.set('Content-Type', consumes.filter(item => this.isJsonMime(item)).join(";")); - } - let canConsumeForm = this.canConsumeForm(consumes); let useForm = false; useForm = canConsumeForm; @@ -640,29 +502,9 @@ export class PetService { set(param: string, value: any): void; }; - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - // authentication (petstore_auth) required - // oauth required - if (this.configuration.accessToken) { - let accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers.set('Authorization', 'Bearer ' + accessToken); - } - - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } - if (file !== undefined) { formParams.set('file', file); } @@ -671,7 +513,6 @@ export class PetService { method: RequestMethod.Post, headers: headers, body: formParams.toString(), - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -679,7 +520,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 4f4189c369b..ece39b793e5 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class StoreService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class StoreService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -83,7 +68,7 @@ export class StoreService { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteOrderWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -98,7 +83,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(extraHttpRequestParams?: any): Observable<{ [key: string]: number; }> { + public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -114,7 +99,7 @@ export class StoreService { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, extraHttpRequestParams?: any): Observable { + public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getOrderByIdWithHttpInfo(orderId, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -130,7 +115,7 @@ export class StoreService { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: Order, extraHttpRequestParams?: any): Observable { + public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.placeOrderWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,33 +132,16 @@ export class StoreService { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -181,39 +149,25 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/inventory'; + public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - // authentication (api_key) required if (this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -221,7 +175,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/inventory`, requestOptions); } /** @@ -229,33 +183,16 @@ export class StoreService { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'orderId' is not null or undefined + public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -263,7 +200,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); } /** @@ -271,27 +208,12 @@ export class StoreService { * * @param body order placed for purchasing the pet */ - public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/store/order'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -299,7 +221,6 @@ export class StoreService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -307,7 +228,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/store/order`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index f9cf1b9fb71..2e9b8eb9e17 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -31,8 +31,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; export class UserService { protected basePath = 'http://petstore.swagger.io/v2'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new Headers(); + public configuration = new Configuration(); constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { @@ -40,25 +40,10 @@ export class UserService { } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -83,7 +68,7 @@ export class UserService { * @summary Create user * @param body Created user object */ - public createUser(body: User, extraHttpRequestParams?: any): Observable<{}> { + public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUserWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -99,7 +84,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithArrayInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -115,7 +100,7 @@ export class UserService { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array, extraHttpRequestParams?: any): Observable<{}> { + public createUsersWithListInput(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -131,7 +116,7 @@ export class UserService { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, extraHttpRequestParams?: any): Observable<{}> { + public deleteUser(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.deleteUserWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -147,7 +132,7 @@ export class UserService { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, extraHttpRequestParams?: any): Observable { + public getUserByName(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.getUserByNameWithHttpInfo(username, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -164,7 +149,7 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, extraHttpRequestParams?: any): Observable { + public loginUser(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { return this.loginUserWithHttpInfo(username, password, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -179,7 +164,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(extraHttpRequestParams?: any): Observable<{}> { + public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -196,7 +181,7 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: User, extraHttpRequestParams?: any): Observable<{}> { + public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -213,27 +198,12 @@ export class UserService { * This can only be done by the logged in user. * @param body Created user object */ - public createUserWithHttpInfo(body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -241,7 +211,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -249,7 +218,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user`, requestOptions); } /** @@ -257,27 +226,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithArray'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithArrayInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -285,7 +239,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -293,7 +246,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithArray`, requestOptions); } /** @@ -301,27 +254,12 @@ export class UserService { * * @param body List of user object */ - public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/createWithList'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'body' is not null or undefined + public createUsersWithListInputWithHttpInfo(body: Array, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -329,7 +267,6 @@ export class UserService { method: RequestMethod.Post, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -337,7 +274,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/createWithList`, requestOptions); } /** @@ -345,33 +282,16 @@ export class UserService { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -379,7 +299,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -387,33 +307,16 @@ export class UserService { * * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -421,7 +324,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } /** @@ -430,39 +333,23 @@ export class UserService { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/login'; - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } - // verify required parameter 'password' is not null or undefined if (password === null || password === undefined) { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } + + let queryParameters = new URLSearchParams(); if (username !== undefined) { queryParameters.set('username', username); } - if (password !== undefined) { queryParameters.set('password', password); } - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -475,35 +362,20 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/login`, requestOptions); } /** * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/logout'; + public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -511,7 +383,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/logout`, requestOptions); } /** @@ -520,32 +392,15 @@ export class UserService { * @param username name that need to be deleted * @param body Updated user object */ - public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', encodeURIComponent(String(username))); - - let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - - // verify required parameter 'username' is not null or undefined + public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - + let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 headers.set('Content-Type', 'application/json'); @@ -553,7 +408,6 @@ export class UserService { method: RequestMethod.Put, headers: headers, body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612 - search: queryParameters, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -561,7 +415,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(path, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/package.json b/samples/client/petstore/typescript-angular-v4/npm/package.json index a15c011fe29..af9c5d898e6 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/package.json +++ b/samples/client/petstore/typescript-angular-v4/npm/package.json @@ -14,21 +14,21 @@ "postinstall": "npm run build" }, "peerDependencies": { - "@angular/core": "^4.2.5", - "@angular/http": "^4.2.5", - "@angular/common": "^4.2.5", - "@angular/compiler": "^4.2.5", + "@angular/core": "^4.0.0", + "@angular/http": "^4.0.0", + "@angular/common": "^4.0.0", + "@angular/compiler": "^4.0.0", "core-js": "^2.4.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6" }, "devDependencies": { - "@angular/core": "^4.2.5", - "@angular/http": "^4.2.5", - "@angular/common": "^4.2.5", - "@angular/compiler": "^4.2.5", - "@angular/platform-browser": "^4.2.5", + "@angular/core": "^4.0.0", + "@angular/http": "^4.0.0", + "@angular/common": "^4.0.0", + "@angular/compiler": "^4.0.0", + "@angular/platform-browser": "^4.0.0", "reflect-metadata": "^0.1.3", "rxjs": "^5.4.0", "zone.js": "^0.7.6", From f3e19e0fdc1ae6416c37bb637521323d88939a9f Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 30 Sep 2017 15:05:03 +0800 Subject: [PATCH 090/197] fix comma in method without parameters --- .../main/resources/typescript-angular/api.service.mustache | 4 ++-- .../typescript-angular-v2/default/api/store.service.ts | 4 ++-- .../typescript-angular-v2/default/api/user.service.ts | 4 ++-- .../petstore/typescript-angular-v2/npm/api/store.service.ts | 4 ++-- .../petstore/typescript-angular-v2/npm/api/user.service.ts | 4 ++-- .../with-interfaces/api/store.service.ts | 4 ++-- .../typescript-angular-v2/with-interfaces/api/user.service.ts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 5426add37bd..56e0e67dce8 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -86,7 +86,7 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ {{! if you change this method signature, also change the version below }} - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}, extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -111,7 +111,7 @@ export class {{classname}} { * {{notes}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ - public {{nickname}}{{^useHttpClient}}WithHttpInfo{{/useHttpClient}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}, extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#useHttpClient}}{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}{{/useHttpClient}}{{^useHttpClient}}Response{{/useHttpClient}}> { + public {{nickname}}{{^useHttpClient}}WithHttpInfo{{/useHttpClient}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^useHttpClient}}{{#hasParams}}, {{/hasParams}}extraHttpRequestParams?: RequestOptionsArgs{{/useHttpClient}}): Observable<{{#useHttpClient}}{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}{}{{/returnType}}{{/useHttpClient}}{{^useHttpClient}}Response{{/useHttpClient}}> { {{#allParams}} {{#required}} if ({{paramName}} === null || {{paramName}} === undefined) { diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index ece39b793e5..221c078d9f2 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -83,7 +83,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { + public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -156,7 +156,7 @@ export class StoreService { * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index dd5cfdb4a63..346ab1d241b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -165,7 +165,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -370,7 +370,7 @@ export class UserService { * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index ece39b793e5..221c078d9f2 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -83,7 +83,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { + public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -156,7 +156,7 @@ export class StoreService { * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index df87073fcae..069416742e0 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -164,7 +164,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -379,7 +379,7 @@ export class UserService { * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 7979fcedac2..baf0d6feaf4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -84,7 +84,7 @@ export class StoreService implements StoreServiceInterface { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { + public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -157,7 +157,7 @@ export class StoreService implements StoreServiceInterface { * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 956a6cb3eb1..1411df7d30c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -165,7 +165,7 @@ export class UserService implements UserServiceInterface { * * @summary Logs out current logged in user session */ - public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -370,7 +370,7 @@ export class UserService implements UserServiceInterface { * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 From 82b6e81897ac6ab86f5476bbabdf6c68fbcf0ca1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 30 Sep 2017 17:28:07 +0800 Subject: [PATCH 091/197] use String() to convert num, update TS angular samples --- .../TypeScriptAngularClientCodegen.java | 2 +- .../default/api/pet.service.ts | 10 +++---- .../default/api/store.service.ts | 5 ++-- .../default/api/user.service.ts | 6 ++--- .../npm/api/pet.service.ts | 11 ++++---- .../npm/api/store.service.ts | 5 ++-- .../npm/api/user.service.ts | 27 +++---------------- .../with-interfaces/api/pet.service.ts | 11 ++++---- .../with-interfaces/api/store.service.ts | 5 ++-- .../with-interfaces/api/user.service.ts | 7 ++--- .../npm/api/pet.service.ts | 12 ++++----- .../npm/api/store.service.ts | 9 ++++--- .../npm/api/user.service.ts | 11 ++++---- 13 files changed, 51 insertions(+), 70 deletions(-) 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 b2d4d5f316a..3283bdb3239 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 @@ -248,7 +248,7 @@ public Map postProcessOperations(Map operations) } // Convert path to TypeScript template string, applying URI encoding - op.path = op.path.replaceAll("\\{(.*?)\\}", "\\$\\{encodeURIComponent($1)\\}"); + op.path = op.path.replaceAll("\\{(.*?)\\}", "\\$\\{encodeURIComponent(String($1))\\}"); } // Add additional filename information for model imports in the services diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 810cc78fea1..481f693424e 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -269,7 +269,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -377,7 +377,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -447,7 +447,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (name !== undefined) { formParams.set('name', name); } @@ -466,7 +465,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -501,7 +500,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } @@ -520,7 +518,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 221c078d9f2..fba4c08d9aa 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -58,6 +58,7 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -149,7 +150,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** @@ -200,7 +201,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 346ab1d241b..d7c9ee1510a 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -300,7 +300,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -325,7 +325,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -416,7 +416,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 6be4b769281..481f693424e 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -59,6 +59,7 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -268,7 +269,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -376,7 +377,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -446,7 +447,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (name !== undefined) { formParams.set('name', name); } @@ -465,7 +465,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -500,7 +500,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } @@ -519,7 +518,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 221c078d9f2..fba4c08d9aa 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -58,6 +58,7 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -149,7 +150,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** @@ -200,7 +201,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 069416742e0..d7c9ee1510a 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -58,6 +58,7 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -299,7 +300,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -324,7 +325,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -351,16 +352,6 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -383,16 +374,6 @@ export class UserService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 - // to determine the Accept header - let produces: string[] = [ - 'application/xml', - 'application/json' - ]; - - if (produces != null && produces.length > 0) { - headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';')); - } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, headers: headers, @@ -435,7 +416,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 7ac0f042a05..b87a0bd2288 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -60,6 +60,7 @@ export class PetService implements PetServiceInterface { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -269,7 +270,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -377,7 +378,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -447,7 +448,6 @@ export class PetService implements PetServiceInterface { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (name !== undefined) { formParams.set('name', name); } @@ -466,7 +466,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -501,7 +501,6 @@ export class PetService implements PetServiceInterface { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } @@ -520,7 +519,7 @@ export class PetService implements PetServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index baf0d6feaf4..d5a468340c4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -59,6 +59,7 @@ export class StoreService implements StoreServiceInterface { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -150,7 +151,7 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** @@ -201,7 +202,7 @@ export class StoreService implements StoreServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 1411df7d30c..3574e7f2c7e 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -59,6 +59,7 @@ export class UserService implements UserServiceInterface { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -300,7 +301,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -325,7 +326,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -416,7 +417,7 @@ export class UserService implements UserServiceInterface { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 14993bde3d5..481f693424e 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -59,6 +59,7 @@ export class PetService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -258,7 +259,6 @@ export class PetService { headers.set('Authorization', 'Bearer ' + accessToken); } - let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, headers: headers, @@ -269,7 +269,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -377,7 +377,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -447,7 +447,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (name !== undefined) { formParams.set('name', name); } @@ -466,7 +465,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, requestOptions); } /** @@ -501,7 +500,6 @@ export class PetService { let formParams = new (useForm ? FormData : URLSearchParams as any)() as { set(param: string, value: any): void; }; - if (additionalMetadata !== undefined) { formParams.set('additionalMetadata', additionalMetadata); } @@ -520,7 +518,7 @@ export class PetService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, requestOptions); + return this.http.request(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, requestOptions); } } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index ece39b793e5..fba4c08d9aa 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -58,6 +58,7 @@ export class StoreService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -83,7 +84,7 @@ export class StoreService { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { + public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -149,14 +150,14 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** * Returns pet inventories by status * Returns a map of status codes to quantities */ - public getInventoryWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -200,7 +201,7 @@ export class StoreService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, requestOptions); + return this.http.request(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, requestOptions); } /** diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 2e9b8eb9e17..d7c9ee1510a 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -58,6 +58,7 @@ export class UserService { return false; } + public isJsonMime(mime: string): boolean { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); @@ -164,7 +165,7 @@ export class UserService { * * @summary Logs out current logged in user session */ - public logoutUser(, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { + public logoutUser(extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> { return this.logoutUserWithHttpInfo(extraHttpRequestParams) .map((response: Response) => { if (response.status === 204) { @@ -299,7 +300,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -324,7 +325,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } /** @@ -369,7 +370,7 @@ export class UserService { * Logs out current logged in user session * */ - public logoutUserWithHttpInfo(, extraHttpRequestParams?: RequestOptionsArgs): Observable { + public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -415,7 +416,7 @@ export class UserService { requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); } - return this.http.request(`${this.basePath}/user/${encodeURIComponent(username)}`, requestOptions); + return this.http.request(`${this.basePath}/user/${encodeURIComponent(String(username))}`, requestOptions); } } From c32281cd026987fb72edeca1cb1d18032e29fa6e Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 1 Oct 2017 14:24:04 +0800 Subject: [PATCH 092/197] add haskell to shippable ci (#6600) --- pom.xml.shippable | 1 + shippable.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pom.xml.shippable b/pom.xml.shippable index 7f04b3262e7..a73d38ae9aa 100644 --- a/pom.xml.shippable +++ b/pom.xml.shippable @@ -839,6 +839,7 @@ samples/client/petstore/elixir + samples/client/petstore/haskell-http-client diff --git a/shippable.yml b/shippable.yml index 6d6bb697c39..a6f111059eb 100644 --- a/shippable.yml +++ b/shippable.yml @@ -7,7 +7,11 @@ build: cache: true cache_dir_list: - $HOME/.m2 + - $SHIPPABLE_REPO_DIR/samples/client/petstore/haskell-http-client/.stack-work ci: + - sudo apt-get update -qq + # install stack + - curl -sSL https://get.haskellstack.org/ | sh # install elixir - wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb - sudo apt-get update From 8bd7d3912b641f6acb278fbc68eb82b2886496bc Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Sun, 1 Oct 2017 05:18:46 -0500 Subject: [PATCH 093/197] [haskell-http-client] fixes for fake-endpoints (#6597) * fix compile errors / sanitization for petstore-with-fake-endpoints-models-for-testing.yaml * correct mimetype logic * add makefile --- bin/haskell-http-client-petstore.sh | 7 +- .../languages/HaskellHttpClientCodegen.java | 252 +-- .../haskell-http-client/API.mustache | 5 +- .../haskell-http-client/Client.mustache | 2 +- .../haskell-http-client/Lens.mustache | 11 +- .../haskell-http-client/MimeTypes.mustache | 59 +- .../haskell-http-client/Model.mustache | 116 +- .../haskell-http-client.cabal.mustache | 2 + .../tests/Instances.mustache | 42 +- .../petstore/haskell-http-client/Makefile | 10 + .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-Client.html | 2 +- .../docs/SwaggerPetstore-Lens.html | 2 +- .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 2 +- .../docs/doc-index-45.html | 2 +- .../docs/doc-index-95.html | 2 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.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-F.html | 2 +- .../haskell-http-client/docs/doc-index-G.html | 2 +- .../haskell-http-client/docs/doc-index-H.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-R.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/doc-index-W.html | 2 +- .../haskell-http-client/docs/doc-index.html | 2 +- .../haskell-http-client/docs/index.html | 3 +- .../docs/mini_SwaggerPetstore-API.html | 2 +- .../docs/mini_SwaggerPetstore-Lens.html | 2 +- .../docs/mini_SwaggerPetstore-MimeTypes.html | 2 +- .../docs/mini_SwaggerPetstore-Model.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 10 +- .../docs/src/SwaggerPetstore.API.html | 1977 ++++++++++------- .../docs/src/SwaggerPetstore.Client.html | 198 +- .../docs/src/SwaggerPetstore.Lens.html | 771 +++++-- .../docs/src/SwaggerPetstore.Logging.html | 38 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 351 +-- .../docs/src/SwaggerPetstore.Model.html | 1729 +++++++++++--- .../haskell-http-client/example-app/Main.hs | 6 +- .../lib/SwaggerPetstore/API.hs | 413 +++- .../lib/SwaggerPetstore/Client.hs | 4 +- .../lib/SwaggerPetstore/Lens.hs | 453 +++- .../lib/SwaggerPetstore/MimeTypes.hs | 71 +- .../lib/SwaggerPetstore/Model.hs | 1147 +++++++++- .../swagger-petstore.cabal | 6 +- .../petstore/haskell-http-client/swagger.json | 900 +++++++- .../tests-integration/tests/Test.hs | 6 +- .../haskell-http-client/tests/Instances.hs | 304 ++- .../haskell-http-client/tests/Test.hs | 32 +- 59 files changed, 6972 insertions(+), 2013 deletions(-) create mode 100644 samples/client/petstore/haskell-http-client/Makefile diff --git a/bin/haskell-http-client-petstore.sh b/bin/haskell-http-client-petstore.sh index f128afe3f60..62b655666d7 100755 --- a/bin/haskell-http-client-petstore.sh +++ b/bin/haskell-http-client-petstore.sh @@ -26,7 +26,8 @@ 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/haskell-http-client -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l haskell-http-client -o samples/client/petstore/haskell-http-client" -echo "java ${JAVA_OPTS} -jar ${executable} ${ags}" -java $JAVA_OPTS -jar $executable $ags +args="$@ generate -t modules/swagger-codegen/src/main/resources/haskell-http-client -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l haskell-http-client -o samples/client/petstore/haskell-http-client" + +echo "java ${JAVA_OPTS} -jar ${executable} ${args}" +java $JAVA_OPTS -jar $executable $args 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 037af1b7787..157c4adfa1d 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 @@ -5,7 +5,6 @@ import io.swagger.models.ModelImpl; import io.swagger.models.Operation; import io.swagger.models.Swagger; -import io.swagger.models.parameters.Parameter; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; @@ -26,12 +25,10 @@ import java.io.IOException; import java.io.File; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; import java.util.regex.Matcher; -import java.util.regex.Pattern; public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -65,6 +62,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static final String MEDIA_TYPE = "mediaType"; static final String MEDIA_DATA_TYPE = "x-mediaDataType"; + static final String MEDIA_IS_JSON = "x-mediaIsJson"; protected Map uniqueOptionalParamsByName = new HashMap(); @@ -86,6 +84,8 @@ public String getHelp() { } + final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application/.*json(;.*)?"); + public HaskellHttpClientCodegen() { super(); @@ -120,7 +120,7 @@ public HaskellHttpClientCodegen() { "instance", "let", "in", "mdo", "module", "newtype", "proc", "qualified", "rec", - "type", "where" + "type", "where", "pure", "return" ) ); @@ -150,30 +150,33 @@ public HaskellHttpClientCodegen() { "Char", "Double", "List", - "FilePath" + "FilePath", + "Text" ) ); typeMapping.clear(); -// typeMapping.put("array", "List"); - typeMapping.put("set", "Set"); + // prim typeMapping.put("boolean", "Bool"); - typeMapping.put("string", "Text"); typeMapping.put("int", "Int"); typeMapping.put("long", "Integer"); typeMapping.put("short", "Int"); typeMapping.put("char", "Char"); typeMapping.put("float", "Float"); typeMapping.put("double", "Double"); - typeMapping.put("Date", "Day"); - typeMapping.put("DateTime", "UTCTime"); - typeMapping.put("file", "FilePath"); typeMapping.put("number", "Double"); typeMapping.put("integer", "Int"); - typeMapping.put("any", "Value"); + typeMapping.put("file", "FilePath"); + // lib + typeMapping.put("string", "Text"); typeMapping.put("UUID", "Text"); - typeMapping.put("binary", "ByteString"); - typeMapping.put("ByteArray", "ByteString"); + typeMapping.put("any", "A.Value"); + typeMapping.put("set", "Set.Set"); + // newtype + typeMapping.put("binary", "Binary"); + typeMapping.put("ByteArray", "ByteArray"); + typeMapping.put("date", "Date"); + typeMapping.put("DateTime", "DateTime"); knownMimeDataTypes.put("application/json", "MimeJSON"); knownMimeDataTypes.put("application/xml", "MimeXML"); @@ -181,6 +184,7 @@ public HaskellHttpClientCodegen() { knownMimeDataTypes.put("application/octet-stream", "MimeOctetStream"); knownMimeDataTypes.put("multipart/form-data", "MimeMultipartFormData"); knownMimeDataTypes.put("text/plain", "MimePlainText"); + knownMimeDataTypes.put("*/*", "MimeAny"); importMapping.clear(); importMapping.put("Map", "qualified Data.Map as Map"); @@ -203,8 +207,6 @@ public HaskellHttpClientCodegen() { cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated").defaultValue(Boolean.TRUE.toString())); - // cliOptions.add(new CliOption(MODEL_IMPORTS, "Additional imports in the Models file")); - // cliOptions.add(new CliOption(MODEL_EXTENSIONS, "Additional extensions in the Models file")); } public void setAllowFromJsonNulls(Boolean value) { @@ -332,17 +334,6 @@ public void processOpts() { } -// @Override -// public String apiFileFolder() { -// String apiName = (String)additionalProperties.get("title"); -// return outputFolder + File.separator + "lib/" + apiName; -// } -// @Override -// public String modelFileFolder() { -// String apiName = (String)additionalProperties.get("title"); -// return outputFolder + File.separator + "lib/" + apiName; -// } - @Override public void preprocessSwagger(Swagger swagger) { // From the title, compute a reasonable name for the package and the API @@ -407,19 +398,6 @@ public void preprocessSwagger(Swagger swagger) { additionalProperties.put("configType", apiName + "Config"); additionalProperties.put("swaggerVersion", swagger.getSwagger()); - // prepend ' -// List> replacements = new ArrayList<>(); -// Object[] replacementChars = specialCharReplacements.keySet().toArray(); -// for (int i = 0; i < replacementChars.length; i++) { -// String c = (String) replacementChars[i]; -// Map o = new HashMap<>(); -// o.put("char", c); -// o.put("replacement", "'" + specialCharReplacements.get(c)); -// o.put("hasMore", i != replacementChars.length - 1); -// replacements.add(o); -// } -// additionalProperties.put("specialCharReplacements", replacements); - //copy input swagger to output folder try { String swaggerJson = Json.pretty(swagger); @@ -441,9 +419,9 @@ public String getTypeDeclaration(Property p) { } else if (p instanceof MapProperty) { MapProperty mp = (MapProperty) p; Property inner = mp.getAdditionalProperties(); - return "Map.Map String " + getTypeDeclaration(inner); + return "(Map.Map String " + getTypeDeclaration(inner) + ")"; } - return fixModelChars(super.getTypeDeclaration(p)); + return super.getTypeDeclaration(p); } @Override @@ -451,17 +429,16 @@ 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); + return typeMapping.get(swaggerType); + } else if (languageSpecificPrimitives.contains(type)) { + return type; } else if (swaggerType == "object") { - type = "Value"; - } else if (typeMapping.containsValue(swaggerType)) { - type = swaggerType + "_"; + return "A.Value"; +// } else if (typeMapping.containsValue(swaggerType)) { +// return toModelName(swaggerType) + "_"; } else { - type = swaggerType; + return toModelName(swaggerType); } - return toModelName(type); } @Override @@ -479,8 +456,6 @@ public String toInstantiationType(Property p) { } else if (p instanceof ArrayProperty) { ArrayProperty ap = (ArrayProperty) p; String inner = getSwaggerType(ap.getItems()); - // Return only the inner type; the wrapping with QueryList is done - // somewhere else, where we have access to the collection format. return inner; } else { return null; @@ -493,12 +468,12 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op op.vendorExtensions.put("x-baseOperationId", op.operationId); op.vendorExtensions.put("x-haddockPath", String.format("%s %s", op.httpMethod, op.path.replace("/", "\\/"))); - op.operationId = toHsVarName(op.operationId); - op.vendorExtensions.put("x-operationType", toHsTypeName(op.operationId)); + op.operationId = toVarName(op.operationId); + op.vendorExtensions.put("x-operationType", toTypeName("Op", op.operationId)); op.vendorExtensions.put("x-hasBodyOrFormParam", op.getHasBodyParam() || op.getHasFormParams()); for (CodegenParameter param : op.allParams) { - param.vendorExtensions.put("x-operationType", capitalize(op.operationId)); + param.vendorExtensions.put("x-operationType", WordUtils.capitalize(op.operationId)); param.vendorExtensions.put("x-isBodyOrFormParam", param.isBodyParam || param.isFormParam); if (!StringUtils.isBlank(param.collectionFormat)) { param.vendorExtensions.put("x-collectionFormat", mapCollectionFormat(param.collectionFormat)); @@ -506,7 +481,7 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op if (!param.required) { op.vendorExtensions.put("x-hasOptionalParams", true); - String paramNameType = capitalize(param.paramName); + String paramNameType = toTypeName("Param", param.paramName); if (uniqueOptionalParamsByName.containsKey(paramNameType)) { CodegenParameter lastParam = this.uniqueOptionalParamsByName.get(paramNameType); @@ -532,7 +507,6 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op if (op.getHasPathParams()) { String remainingPath = op.path; for (CodegenParameter param : op.pathParams) { - param.paramName = toHsVarName(param.paramName); String[] pieces = remainingPath.split("\\{" + param.baseName + "\\}"); if (pieces.length == 0) throw new RuntimeException("paramName {" + param.baseName + "} not in path " + op.path); @@ -571,7 +545,7 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op for (Map m : op.consumes) { processMediaType(op,m); } - if (isMultipart(op.consumes)) { + if (isMultipartOperation(op.consumes)) { op.isMultipart = Boolean.TRUE; } } @@ -645,19 +619,14 @@ public Map postProcessOperationsWithModels(Map o public CodegenModel fromModel(String name, Model mod, Map allDefinitions) { CodegenModel model = super.fromModel(name, mod, allDefinitions); - // Clean up the class name to remove invalid characters - model.classname = fixModelChars(model.classname); - if (typeMapping.containsValue(model.classname)) { - model.classname += "_"; - } while (uniqueOptionalParamsByName.containsKey(model.classname)) { model.classname = generateNextName(model.classname); } // From the model name, compute the prefix for the fields. - String prefix = camelize(model.classname, true); + String prefix = WordUtils.uncapitalize(model.classname); for (CodegenProperty prop : model.vars) { - prop.name = toVarName(prefix + camelize(fixOperatorChars(prop.name))); + prop.name = toVarName(prefix, prop.name); } //String dataOrNewtype = "data"; @@ -666,25 +635,10 @@ public CodegenModel fromModel(String name, Model mod, Map allDefi return model; } - // Create newtypes for things with non-object types -// String modelType = ((ModelImpl) mod).getType(); -// if(modelType != "object" && typeMapping.containsKey(modelType)) { -// String newtype = typeMapping.get(modelType); -// model.vendorExtensions.put("x-customNewtype", newtype); -// } - modelNames.put(model.classname, model); return model; } - @Override - public CodegenParameter fromParameter(Parameter param, Set imports) { - CodegenParameter p = super.fromParameter(param, imports); - p.paramName = toHsVarName(p.baseName); - p.dataType = fixModelChars(p.dataType); - return p; - } - @Override public String escapeReservedWord(String name) { if (this.reservedWordsMappings().containsKey(name)) { @@ -693,13 +647,6 @@ public String escapeReservedWord(String name) { return "_" + name; } - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -726,17 +673,11 @@ private void processMediaType(CodegenOperation op, Map m) { if(StringUtils.isBlank(mediaType)) return; - String[] mediaTypeParts = mediaType.split("/",2); - if(mediaTypeParts.length > 1) { - m.put("x-mediaMainType", mediaTypeParts[0]); - m.put("x-mediaSubType", mediaTypeParts[1]); - } else { - m.put("x-mediaMainType", mediaTypeParts[0]); - m.put("x-mediaSubType", ""); - } - String mimeType = getMimeDataType(mediaType); m.put(MEDIA_DATA_TYPE, mimeType); + if (isJsonMimeType(mediaType)) { + m.put(MEDIA_IS_JSON, "true"); + } allMimeTypes.put(mediaType, m); if(!knownMimeDataTypes.containsKey(mediaType) && !unknownMimeTypes.contains(m)) { @@ -796,64 +737,9 @@ private String getMimeDataType(String mimeType) { return knownMimeDataTypes.get(mimeType); } String shortenedName = mimeType.replaceFirst("application/",""); - return "Mime" + toHsTypeName(shortenedName); - } - - private String toHsVarName(String paramName) { - return toVarName(camelize(fixOperatorChars(fixModelChars(paramName)), true)); - } - - private String toHsTypeName(String paramName) { - return toHsTypeName(paramName, ""); - } - - private String toHsTypeName(String paramName, String modelCharReplacement) { - return camelize(fixOperatorChars(fixModelChars(paramName, modelCharReplacement)), false); + return "Mime" + toTypeName("", shortenedName); } - private String fixOperatorChars(String string) { - if(string == null) return null; - StringBuilder sb = new StringBuilder(); - String name = string; - //Check if it is a reserved word, in which case the underscore is added when property name is generated. - if (string.startsWith("_")) { - if (reservedWords.contains(string.substring(1, string.length()))) { - name = string.substring(1, string.length()); - } else if (reservedWordsMappings.containsValue(string)) { - name = LEADING_UNDERSCORE.matcher(string).replaceFirst(""); - } - } - // prepend ' - for (char c : name.toCharArray()) { - String cString = String.valueOf(c); - if (specialCharReplacements.containsKey(cString)) { -// sb.append("'"); - sb.append(specialCharReplacements.get(cString)); - } else { - sb.append(c); - } - } - return sb.toString(); - } - - // Remove characters from a string that do not belong in a model classname - private String fixModelChars(String string, String replacement) { - if(string == null) return null; - return string.replace(".", replacement).replace("-", replacement); - } - - private String fixModelChars(String string) { - return fixModelChars(string, ""); - } - - private String capitalize(String word) { - if(word == null) return null; - if (word.length() > 0) { - word = word.substring(0, 1).toUpperCase() + word.substring(1); - } - - return word; - } private static String generateNextName(String name) { Pattern pattern = Pattern.compile("\\d+\\z"); Matcher matcher = pattern.matcher(name); @@ -865,7 +751,7 @@ private static String generateNextName(String name) { return name + "2"; } } - private static boolean isMultipart(List> consumes) { + private static boolean isMultipartOperation(List> consumes) { for(Map consume : consumes) { if (consume != null) { if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) { @@ -875,12 +761,58 @@ private static boolean isMultipart(List> consumes) { } return false; } + @Override + public String toVarName(String name) { + return toVarName("", name); + } + public String toVarName(String prefix, String name) { + Boolean hasPrefix = !StringUtils.isBlank(prefix); + name = underscore(sanitizeName(name.replaceAll("-", "_"))); + name = camelize(name, !hasPrefix); + if(hasPrefix) { + return prefix + name; + } else { + if (name.matches("^\\d.*")) + name = escapeReservedWord(name); + if (isReservedWord(name)) + name = escapeReservedWord(name); + return name; + } + } -// private boolean isModelledType(CodegenParameter param) { -// return isModelledType(param.baseType == null ? param.dataType : param.baseType); -// } -// -// private boolean isModelledType(String typeName) { -// return !languageSpecificPrimitives.contains(typeName) && !typeMapping.values().contains(typeName); -// } + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + public String toModelName(String name) { + return toTypeName("Model", name); + } + @Override + public String toModelFilename(String name) { + return toTypeName("Model", name); + } + public String toTypeName(String prefix, String name) { + name = camelize(underscore(sanitizeName(name))); + + if(StringUtils.isBlank(prefix)) return name; + + if (isReservedWord(name)) { + name = prefix + name; + } + if (name.matches("^\\d.*")) { + name = prefix + name; // e.g. 200Response => Model200Response (after camelize) + } + if (languageSpecificPrimitives.contains(name)) { + name = prefix + name; + } + if (typeMapping.containsValue(name)) { + name = prefix + name; + } + return name; + } + static boolean isJsonMimeType(String mime) { + return mime != null && JSON_MIME_PATTERN.matcher(mime).matches(); + } } 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 30c23fc0c37..f5869983182 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 @@ -22,14 +22,11 @@ import {{title}}.MimeTypes import {{title}}.Lens import qualified Data.Aeson as A -import Data.Aeson (Value) import qualified Data.Time as TI -import Data.Time (UTCTime) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL -import Data.ByteString.Lazy (ByteString) import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL @@ -45,6 +42,7 @@ import qualified Data.CaseInsensitive as CI import qualified Data.Data as P (Typeable) import qualified Data.Foldable as P import qualified Data.Map as Map +import qualified Data.Set as Set import qualified Data.Maybe as P import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Text as T @@ -58,7 +56,6 @@ import qualified Lens.Micro as L import Data.Monoid ((<>)) import Data.Function ((&)) -import Data.Set (Set) import Data.Text (Text) import GHC.Base ((<|>)) diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index 68228e22bbb..c56f377451b 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -81,7 +81,7 @@ instance Show {{configType}} where newConfig :: IO {{configType}} newConfig = do logCxt <- initLogContext - return $ SwaggerPetstoreConfig + return $ {{configType}} { configHost = "{{{basePath}}}" , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" , configLogExecWithContext = runDefaultLogExecWithContext diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache index 3ac0727fe49..a10d79faf99 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache @@ -10,17 +10,14 @@ Module : {{title}}.Lens module {{title}}.Lens where -import Data.Text (Text) - import qualified Data.Aeson as A -import Data.Aeson (Value) -import qualified Data.ByteString as B -import Data.ByteString.Lazy (ByteString) +import qualified Data.ByteString.Lazy as BL import qualified Data.Data as P (Data, Typeable) import qualified Data.Map as Map - +import qualified Data.Set as Set import qualified Data.Time as TI -import Data.Time (UTCTime) + +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 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 43e969d82d4..18a4c99cf3c 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 @@ -13,6 +13,7 @@ Module : {{title}}.MimeTypes module {{title}}.MimeTypes where +import {{title}}.Model as M import qualified Data.Aeson as A @@ -22,13 +23,16 @@ import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL + import qualified Network.HTTP.Media as ME import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH import qualified Data.Data as P (Typeable) import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Text as T +import qualified Data.String as P import qualified Data.Text.Encoding as T import qualified Control.Arrow as P (left) @@ -50,6 +54,7 @@ data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) data MimeOctetStream = MimeOctetStream deriving (P.Typeable) data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) {{#x-unknownMimeTypes}}data {{{x-mediaDataType}}} = {{{x-mediaDataType}}} deriving (P.Typeable) {{/x-unknownMimeTypes}} @@ -78,37 +83,36 @@ class P.Typeable mtype => MimeType mtype where -- ** MimeType Instances --- | @application/json@ +-- | @application/json; charset=utf-8@ instance MimeType MimeJSON where - mimeTypes _ = - [ "application" ME.// "json" ME./: ("charset", "utf-8") - , "application" ME.// "json" - ] - --- | @application/xml@ + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" - + mimeType _ = Just $ P.fromString "application/xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" - + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" - --- | @text/plain;charset=utf-8@ + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" instance MimeType MimeNoContent where mimeType _ = Nothing {{#x-unknownMimeTypes}} -- | @{{{mediaType}}}@ instance MimeType {{{x-mediaDataType}}} where - mimeType _ = Just $ "{{{x-mediaMainType}}}" ME.// "{{{x-mediaSubType}}}" + 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}} {{/x-unknownMimeTypes}} @@ -141,12 +145,23 @@ instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . -- | @BCL.pack@ instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack --- | @P.id@ instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id --- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 --- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary + +instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData DateTime 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 + +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam -- | @P.Right . P.const NoContent@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty 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 9176a1e047d..26ce58b91b7 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 @@ -17,24 +17,28 @@ Module : {{title}}.Model module {{title}}.Model where import Data.Aeson ((.:),(.:!),(.:?),(.=)) -import Data.Text (Text) - -import Data.Aeson (Value) -import Data.ByteString.Lazy (ByteString) import qualified Data.Aeson as A import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Base64.Lazy as BL64 import qualified Data.Data as P (Data, Typeable) import qualified Data.HashMap.Lazy as HM import qualified Data.Map as Map +import qualified Data.Set as Set import qualified Data.Maybe as P import qualified Data.Foldable as P import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH +import qualified Control.DeepSeq as NF +import qualified Data.Ix as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) +import Data.Text (Text) import qualified Data.Time as TI import qualified Data.Time.ISO8601 as TI -import Data.Time (UTCTime) import Control.Applicative ((<|>)) import Control.Applicative (Alternative) @@ -55,7 +59,6 @@ import qualified Prelude as P -- {{{.}}} -- {{/title}}{{#description}} -- {{{.}}}{{/description}} -{{^vendorExtensions.x-customNewtype}} data {{classname}} = {{classname}} { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{datatype}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#readOnly}}/ReadOnly/ {{/readOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{#hasMore}} , {{/hasMore}}{{/vars}} @@ -63,28 +66,28 @@ data {{classname}} = {{classname}} instance A.FromJSON {{classname}} where parseJSON = A.withObject "{{classname}}" $ \o -> - {{classname}} - <$>{{#vars}} (o {{#required}}.: {{/required}}{{^required}}{{^allowFromJsonNulls}}.:!{{/allowFromJsonNulls}}{{#allowFromJsonNulls}}.:?{{/allowFromJsonNulls}}{{/required}} "{{baseName}}"{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _readDate{{/isDate}}){{#hasMore}} + {{^hasVars}}pure {{/hasVars}}{{classname}} + {{#hasVars}}<$>{{/hasVars}}{{#vars}} (o {{#required}}.: {{/required}}{{^required}}{{^allowFromJsonNulls}}.:!{{/allowFromJsonNulls}}{{#allowFromJsonNulls}}.:?{{/allowFromJsonNulls}}{{/required}} "{{baseName}}"){{#hasMore}} <*>{{/hasMore}}{{/vars}} instance A.ToJSON {{classname}} where - toJSON {{classname}} {..} = + toJSON {{classname}} {{#hasVars}}{..}{{/hasVars}} = {{^allowToJsonNulls}}_omitNulls{{/allowToJsonNulls}}{{#allowToJsonNulls}}A.object{{/allowToJsonNulls}} - [ {{#vars}}"{{baseName}}" .= {{#isDateTime}}{{^required}}P.fmap {{/required}}_showDateTime{{/isDateTime}}{{#isDate}}{{^required}}P.fmap {{/required}}_showDate{{/isDate}} {{name}}{{#hasMore}} + [ {{#vars}}"{{baseName}}" .= {{name}}{{#hasMore}} , {{/hasMore}}{{/vars}} ] {{#vendorExtensions.x-hasMimeFormUrlEncoded}} instance WH.FromForm {{classname}} where fromForm f = - {{classname}} - <$>{{#vars}} ({{#required}}WH.parseUnique {{/required}}{{^required}}WH.parseMaybe {{/required}}"{{baseName}}" f{{#isDateTime}} >>={{^required}} P.mapM{{/required}} _readDateTime{{/isDateTime}}{{#isDate}} >>={{^required}} P.mapM{{/required}} _readDate{{/isDate}}){{#hasMore}} + {{^hasVars}}pure {{/hasVars}}{{classname}} + {{#hasVars}}<$>{{/hasVars}}{{#vars}} ({{#required}}WH.parseUnique {{/required}}{{^required}}WH.parseMaybe {{/required}}"{{baseName}}" f){{#hasMore}} <*>{{/hasMore}}{{/vars}} instance WH.ToForm {{classname}} where - toForm {{classname}} {..} = + toForm {{classname}} {{#hasVars}}{..}{{/hasVars}} = WH.Form $ HM.fromList $ P.catMaybes $ - [ {{#vars}}_toFormItem "{{baseName}}" ({{#required}}Just $ {{/required}}{{#isDateTime}}{{^required}}P.fmap {{/required}}_showDateTime {{/isDateTime}}{{#isDate}}{{^required}}P.fmap {{/required}}_showDate {{/isDate}}{{name}}){{#hasMore}} + [ {{#vars}}_toFormItem "{{baseName}}" ({{#required}}Just {{/required}}{{name}}){{#hasMore}} , {{/hasMore}}{{/vars}} ] {{/vendorExtensions.x-hasMimeFormUrlEncoded}} @@ -101,12 +104,6 @@ mk{{classname}} {{#requiredVars}}{{name}} {{/requiredVars}}= } {{/generateModelConstructors}} -{{/vendorExtensions.x-customNewtype}} -{{#vendorExtensions.x-customNewtype}} -newtype {{classname}} = {{classname}} {{vendorExtensions.x-customNewtype}} deriving (P.Show, P.Eq, P.Data, P.Typeable, P.Generic, A.FromJSON, A.ToJSON) -{-# WARNING {{classname}} "untested/unimlemented behavior" #-} -{{/vendorExtensions.x-customNewtype}} - {{/model}} {{/models}} @@ -135,6 +132,19 @@ _memptyToNothing x = x -- * DateTime Formatting +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t + -- | @{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ _readDateTime :: (TI.ParseTime t, Monad m, {{^dateTimeFormat}}Alternative m{{/dateTimeFormat}}) => String -> m t _readDateTime = @@ -142,7 +152,7 @@ _readDateTime = {-# INLINE _readDateTime #-} -- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ -_showDateTime :: ({{^dateTimeFormat}}t ~ UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String +_showDateTime :: ({{^dateTimeFormat}}t ~ TI.UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String _showDateTime = {{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} {-# INLINE _showDateTime #-} @@ -156,6 +166,19 @@ _parseISO8601 t = -- * Date Formatting +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t + -- | @TI.parseTimeM True TI.defaultTimeLocale "{{{dateFormat}}}"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = @@ -167,3 +190,54 @@ _showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}" {-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} \ 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 1125ab040da..97638e2afa8 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 @@ -44,6 +44,7 @@ library , unordered-containers , aeson >=1.0 && <2.0 , bytestring >=0.10.0 && <0.11 + , base64-bytestring >1.0 && <2.0 , containers >=0.5.0.0 && <0.6 , http-types >=0.8 && <0.10 , http-client >=0.5 && <0.6 @@ -61,6 +62,7 @@ library , safe-exceptions <0.2 , case-insensitive , microlens >= 0.4.3 && <0.5 + , deepseq >= 1.4 && <1.6 exposed-modules: {{title}} {{title}}.API diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache index 5057ecb312a..bf3e087d3cd 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -5,11 +5,11 @@ module Instances where import Data.Text (Text, pack) import Data.Char (isSpace) import Data.List (sort) -import Data.Time.Calendar (Day(..)) -import Data.Time.Clock (UTCTime(..), secondsToDiffTime) +import qualified Data.Time as TI import Test.QuickCheck import qualified Data.HashMap.Strict as HM import qualified Data.Set as Set +import qualified Data.ByteString.Lazy as BL import ApproxEq import {{title}}.Model @@ -17,13 +17,33 @@ import {{title}}.Model instance Arbitrary Text where arbitrary = pack <$> arbitrary -instance Arbitrary Day where - arbitrary = ModifiedJulianDay . (2000 +) <$> arbitrary - shrink = (ModifiedJulianDay <$>) . shrink . toModifiedJulianDay +instance Arbitrary TI.Day where + arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary + shrink = (TI.ModifiedJulianDay <$>) . shrink . TI.toModifiedJulianDay -instance Arbitrary UTCTime where +instance Arbitrary TI.UTCTime where arbitrary = - UTCTime <$> arbitrary <*> (secondsToDiffTime <$> choose (0, 86401)) + TI.UTCTime <$> arbitrary <*> (TI.secondsToDiffTime <$> choose (0, 86401)) + +instance Arbitrary BL.ByteString where + arbitrary = BL.pack <$> arbitrary + shrink xs = BL.pack <$> shrink (BL.unpack xs) + +instance Arbitrary ByteArray where + arbitrary = ByteArray <$> arbitrary + shrink (ByteArray xs) = ByteArray <$> shrink xs + +instance Arbitrary Binary where + arbitrary = Binary <$> arbitrary + shrink (Binary xs) = Binary <$> shrink xs + +instance Arbitrary DateTime where + arbitrary = DateTime <$> arbitrary + shrink (DateTime xs) = DateTime <$> shrink xs + +instance Arbitrary Date where + arbitrary = Date <$> arbitrary + shrink (Date xs) = Date <$> shrink xs -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups @@ -37,7 +57,7 @@ hasNoDups = go Set.empty , Set.size s' > Set.size s = go s' xs | otherwise = False -instance ApproxEq Day where +instance ApproxEq TI.Day where (=~) = (==) -- * Models @@ -46,9 +66,9 @@ instance ApproxEq Day where {{#model}} instance Arbitrary {{classname}} where arbitrary = - {{classname}} - <$> {{#vars}}arbitrary -- {{name}} :: {{^required}}Maybe {{/required}}{{datatype}} - {{#hasMore}}<*> {{/hasMore}}{{/vars}} + {{^hasVars}}pure {{/hasVars}}{{classname}} + {{#hasVars}} <$>{{/hasVars}} {{#vars}}arbitrary -- {{name}} :: {{^required}}Maybe {{/required}}{{datatype}} + {{#hasMore}} <*> {{/hasMore}}{{/vars}} {{/model}} {{/models}} diff --git a/samples/client/petstore/haskell-http-client/Makefile b/samples/client/petstore/haskell-http-client/Makefile new file mode 100644 index 00000000000..7d74a839ec9 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/Makefile @@ -0,0 +1,10 @@ +STACKCMD := stack --install-ghc +.PHONY: all clean build test test-integration build-example build-integration +all: clean build test build-example build-integration +clean: ; (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); +build: ; ($(STACKCMD) haddock); +test: ; ($(STACKCMD) test); +build-example: build ; (cd ./example-app; $(STACKCMD) build); +# a test-only project may exit with ExitFailure, despite building successfully +build-integration: build ; (cd ./tests-integration; $(STACKCMD) build --no-run-tests); +test-integration: build-integration ; (cd ./tests-integration; $(STACKCMD) test); 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 c19843f7d57..a12cfceb1ae 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

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
POST /pet

Add a new pet to the store

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: Integer

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: [Text]

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: petstore_auth

findPetsByTags

findPetsByTags Source #

Arguments

:: [Text]

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

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

AuthMethod: petstore_auth

getPetById

getPetById Source #

Arguments

:: Integer

"petId" - ID of pet to return

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

Find pet by ID

Returns a single pet

AuthMethod: api_key

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
PUT /pet

Update an existing pet

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> Integer

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

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

Updates a pet in the store with form data

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> Integer

"petId" - ID of pet to update

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

uploads an image

AuthMethod: petstore_auth

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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: Text

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

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

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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: api_key

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Integer

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

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

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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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 [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Text

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Text

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Text

"username" - The user name for login

-> Text

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Text

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Status Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiUnderscorekey Source # 

Optional Request Parameter Types

newtype Name Source #

Constructors

Name 

Fields

Instances

newtype Status Source #

Constructors

Status 

Fields

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #

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

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

_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res 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 #

\ No newline at end of file +

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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Double

"number" - None

-> Double

"double" - None

-> Text

"patternWithoutDelimiter" - None

-> ByteArray

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
POST /fake

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

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

AuthMethod: http_basic_test

Note: Has Produces instances, but no response schema

data TestEndpointParameters Source #

Instances

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

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - 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 ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> contentType

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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 EnumQueryDouble Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumQueryString Source #

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

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

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

HasOptionalParam TestEnumParameters EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Text

"param" - field1

-> Text

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
PATCH /fake_classname_test

To test class name in snake case

AuthMethod: api_key_query

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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
POST /pet

Add a new pet to the store

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: Integer

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: [Text]

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: petstore_auth

findPetsByTags

findPetsByTags Source #

Arguments

:: [Text]

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

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

AuthMethod: petstore_auth

getPetById

getPetById Source #

Arguments

:: Integer

"petId" - ID of pet to return

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

Find pet by ID

Returns a single pet

AuthMethod: api_key

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
PUT /pet

Update an existing pet

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> Integer

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

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

Updates a pet in the store with form data

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> Integer

"petId" - ID of pet to update

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

uploads an image

AuthMethod: petstore_auth

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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: Text

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: api_key

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Integer

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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 [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Text

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Text

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Text

"username" - The user name for login

-> Text

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Text

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Status 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 # 
HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumQueryString Source #

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

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

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

HasOptionalParam TestEnumParameters EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - 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 ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Optional Request Parameter Types

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 #

newtype Name2 Source #

Constructors

Name2 

Fields

newtype Status Source #

Constructors

Status 

Fields

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #

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

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

_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res 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 #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index 54087571b77..41f6eb8830f 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: IO SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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"

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

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

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

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 #

ApiResponse

Category

Order

Pet

Tag

User

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

Synopsis

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 #

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/SwaggerPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html index 58030dc136a..cd7a997db83 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

 

Synopsis

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json
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
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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 MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source # 
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 MimeNoContent Source # 
MimeType MimeOctetStream Source # 
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
MimeType MimeJSON Source #
application/json

MimeType Instances

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 ByteString Source #
P.id
MimeRender MimeMultipartFormData String Source #
BCL.pack
MimeRender MimeMultipartFormData Text Source #
BL.fromStrict . T.encodeUtf8
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

class MimeType mtype => Consumes req mtype Source #

Instances

Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
Consumes UpdatePet MimeXML Source #
application/xml
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeXML Source #
application/xml
Consumes AddPet MimeJSON Source #
application/json

Request Produces

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
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
MimeType MimeXmlCharsetutf8 Source #
application/xml; 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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
\ 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 2e94ca821d5..37d0e07c5a8 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Synopsis

Models

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (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)

Order

data Order Source #

Pet Order

An order for a pets from the pet store

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

Pet

data Pet Source #

a Pet

A pet for sale in the pet store

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

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

Tag

data Tag Source #

Pet Tag

A tag for a pet

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

a User

A User who is purchasing from the pet store

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

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 #

DateTime Formatting

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

_parseISO8601

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

TI.formatISO8601Millis

Date Formatting

_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"
\ 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

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

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

Animal

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

mkClassModel :: ClassModel Source #

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

Client

data Client Source #

Constructors

Client 

Fields

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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

mkMapTest :: MapTest Source #

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

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 #

Model for testing model name same as property name

Constructors

Name 

Fields

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 #

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

Pet

data Pet Source #

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 #

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

Cat

data Cat Source #

Constructors

Cat 

Fields

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

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

Dog

data Dog Source #

Constructors

Dog 

Fields

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

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

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 #

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

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 # 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html b/samples/client/petstore/haskell-http-client/docs/doc-index-45.html index b075b316c57..49d982e2f0d 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-45.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.API, SwaggerPetstore
\ No newline at end of file +

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

Index - -

-&-SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index 7c4ba0203b2..5dce1ac0d01 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.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 - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ 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 0c70842879e..24126d08079 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

AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - A

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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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 01798755240..4623a6e6494 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.API, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
ApiUnderscorekey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, 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
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
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.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Lens_SwaggerPetstore.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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
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
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
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
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterBoolean 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterComposite 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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
ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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
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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unBodyOuterBooleanSwaggerPetstore.API, SwaggerPetstore
unBodyOuterCompositeSwaggerPetstore.API, SwaggerPetstore
unBodyOuterStringSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, 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 e50148774b0..8c002a7b450 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

Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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 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 50baaa0befa..32c2921e4d8 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

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
\ 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, 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 07d76cf97de..ee818dc6d85 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

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
\ No newline at end of file +

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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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 1d4374339f9..7835551eb87 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, 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 diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html index 81e4217389e..d09d2dbedda 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - H)

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

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.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 b190c9d63e1..f3b5b707ff2 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
\ 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.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 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 34300a382d5..de449c7ec9c 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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 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 bfc39c25bc2..029952395b9 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

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
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
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
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, 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 09dd3efbb76..d65496e48f7 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.Lens, 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 78a8242a188..56e802e81ea 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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 60ab39ed038..64db7b5535a 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

ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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

ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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
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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 0c476d5eb64..0f437964190 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

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

Index - R

removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - R

ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, 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 edbcbd89f67..3976204b67d 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.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
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 - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 224de1d846b..45dbcad9af9 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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 f83238befbf..78746152051 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiUnderscorekeySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unNameSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unBodyOuterBooleanSwaggerPetstore.API, SwaggerPetstore
unBodyOuterCompositeSwaggerPetstore.API, SwaggerPetstore
unBodyOuterStringSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html index 4db5785b8f0..c117283a2a7 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - W)

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

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index.html b/samples/client/petstore/haskell-http-client/docs/doc-index.html index d1c15e2898d..d302882ba96 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index.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

\ No newline at end of file +

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

\ 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 828f1906ded..66b20478cf9 100644 --- a/samples/client/petstore/haskell-http-client/docs/index.html +++ b/samples/client/petstore/haskell-http-client/docs/index.html @@ -2,5 +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

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

apiVersion: 0.0.1

swagger version: 2.0

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

\ 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

apiVersion: 0.0.1

swagger version: 2.0

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

\ 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 index 53a2e86e806..3717a4943a5 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

SwaggerPetstore.API

Operations

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Optional Request Parameter Types

data Name

data Status

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

\ No newline at end of file +

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Optional Request Parameter Types

data Body

data Int32

data Int64

data ApiKey

data Name2

data Status

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html index 930ee673c3e..6ba9318a6b2 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Lens.html @@ -1,4 +1,4 @@ SwaggerPetstore.Lens

SwaggerPetstore.Lens

\ No newline at end of file +

SwaggerPetstore.Lens

Type Aliases

type Lens_' s a

type Lens_ s t a b

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-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html index 2e03b6a10c5..88f9b9437e4 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html @@ -1,4 +1,4 @@ SwaggerPetstore.MimeTypes

SwaggerPetstore.MimeTypes

Content Negotiation

Mime Types

data MimeXML

MimeType Class

class MimeType mtype

MimeType Instances

MimeRender Class

class MimeRender mtype x

MimeRender Instances

MimeUnrender Class

class MimeUnrender mtype o

MimeUnrender Instances

Request Consumes

class Consumes req mtype

Request Produces

class Produces req mtype

\ No newline at end of file +

SwaggerPetstore.MimeTypes

Content Negotiation

Mime Types

data MimeXML

data MimeAny

MimeType Class

class MimeType mtype

MimeType Instances

MimeRender Class

class MimeRender mtype x

MimeRender Instances

MimeUnrender Class

class MimeUnrender mtype o

MimeUnrender Instances

Request Consumes

class Consumes req mtype

Request Produces

class Produces req mtype

\ 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 index afc8c09022d..aab7ca5e3da 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

SwaggerPetstore.Model

\ No newline at end of file +

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

Utils

DateTime Formatting

Date Formatting

data Date

Byte/Binary Formatting

data Binary

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 5698d1fe765..51b2f6462e0 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -30,7 +30,7 @@ bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath bindir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/bin" -libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-Kuz5nG0AYvXTOw4CQ9HS" +libdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0-6vvnt0nNbFQ21xc4iZiS7J" dynlibdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/lib/x86_64-linux-ghc-8.0.2" datadir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/share/x86_64-linux-ghc-8.0.2/swagger-petstore-0.1.0.0" libexecdir = "/home/jon/fs/git/swagger-codegen/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-9.0/8.0.2/libexec" @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 6bffe8754f0..5e01f7d2025 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 @@ -22,846 +22,1233 @@ import SwaggerPetstore.Lens import qualified Data.Aeson as A -import Data.Aeson (Value) - -import qualified Data.Time as TI -import Data.Time (UTCTime) - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import Data.ByteString.Lazy (ByteString) -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL - -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Media as ME -import qualified Network.HTTP.Types as NH + +import qualified Data.Time as TI + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL + +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.HttpApiData as WH +import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI -import qualified Data.Data as P (Typeable) -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.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 GHC.Base as P (Alternative) -import qualified Control.Arrow as P (left) +import qualified Data.CaseInsensitive as CI +import qualified Data.Data as P (Typeable) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +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 GHC.Base as P (Alternative) +import qualified Control.Arrow as P (left) + +import qualified Lens.Micro as L -import qualified Lens.Micro as L - -import Data.Monoid ((<>)) -import Data.Function ((&)) -import Data.Set (Set) -import Data.Text (Text) -import GHC.Base ((<|>)) +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 -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 + --- * Operations +-- ** AnotherFake - --- ** Pet - --- *** addPet - --- | @POST \/pet@ --- --- Add a new pet to the store --- --- --- --- AuthMethod: petstore_auth --- --- Note: Has 'Produces' instances, but no response schema --- -addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = - _mkRequest "POST" ["/pet"] - `setBodyParam` body - -data AddPet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam AddPet Pet +-- *** testSpecialTags + +-- | @PATCH \/another-fake\/dummy@ +-- +-- To test special tags +-- +-- To test special tags +-- +testSpecialTags + :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestSpecialTags contentType Client +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 + --- | @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: petstore_auth --- --- Note: Has 'Produces' instances, but no response schema --- -deletePet - :: Integer -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = - _mkRequest "DELETE" ["/pet/",toPath petId] - - -data DeletePet -instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey xs) = - req `setHeader` toHeader ("api_key", xs) --- | @application/xml@ -instance Produces DeletePet MimeXML --- | @application/json@ -instance Produces DeletePet MimeJSON - +-- ** Fake + +-- *** fakeOuterBooleanSerialize + +-- | @POST \/fake\/outer\/boolean@ +-- +-- Test serialization of outer boolean types +-- +fakeOuterBooleanSerialize + :: (Consumes FakeOuterBooleanSerialize contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite +fakeOuterCompositeSerialize _ = + _mkRequest "POST" ["/fake/outer/composite"] + +data FakeOuterCompositeSerialize + +-- | /Body Param/ "body" - Input composite as post body +instance HasBodyParam FakeOuterCompositeSerialize OuterComposite + +-- *** fakeOuterNumberSerialize --- *** findPetsByStatus - --- | @GET \/pet\/findByStatus@ +-- | @POST \/fake\/outer\/number@ +-- +-- Test serialization of outer number types -- --- Finds Pets by status --- --- Multiple status values can be provided with comma separated strings --- --- AuthMethod: petstore_auth --- -findPetsByStatus - :: [Text] -- ^ "status" - Status values that need to be considered for filter - -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = - _mkRequest "GET" ["/pet/findByStatus"] - `_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: petstore_auth --- -findPetsByTags - :: [Text] -- ^ "tags" - Tags to filter by - -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = - _mkRequest "GET" ["/pet/findByTags"] - `_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: api_key --- -getPetById - :: Integer -- ^ "petId" - ID of pet to return - -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = - _mkRequest "GET" ["/pet/",toPath petId] - - -data GetPetById --- | @application/xml@ -instance Produces GetPetById MimeXML --- | @application/json@ -instance Produces GetPetById MimeJSON - - --- *** updatePet - --- | @PUT \/pet@ --- --- Update an existing pet --- --- --- --- AuthMethod: petstore_auth --- --- Note: Has 'Produces' instances, but no response schema --- -updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => contentType -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = - _mkRequest "PUT" ["/pet"] - `setBodyParam` body - -data UpdatePet +fakeOuterNumberSerialize + :: (Consumes FakeOuterNumberSerialize contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString +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 -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClientModel contentType Client +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: http_basic_test +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEndpointParameters + :: (Consumes TestEndpointParameters contentType) + => contentType -- ^ request content-type ('MimeType') + -> Double -- ^ "number" - None + -> Double -- ^ "double" - None + -> Text -- ^ "patternWithoutDelimiter" - None + -> ByteArray -- ^ "byte" - None + -> SwaggerPetstoreRequest TestEndpointParameters contentType res +testEndpointParameters _ number double patternWithoutDelimiter byte = + _mkRequest "POST" ["/fake"] + `_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) --- | /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: petstore_auth --- --- Note: Has 'Produces' instances, but no response schema --- -updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = - _mkRequest "POST" ["/pet/",toPath petId] - +-- | /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) -data UpdatePetWithForm - --- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = - req `_addForm` toForm ("name", xs) - --- | /Optional Param/ "status" - Updated status of the pet -instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status xs) = - req `_addForm` toForm ("status", xs) - --- | @application/x-www-form-urlencoded@ -instance Consumes UpdatePetWithForm MimeFormUrlEncoded +-- | /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@ -instance Produces UpdatePetWithForm MimeXML --- | @application/json@ -instance Produces UpdatePetWithForm MimeJSON +-- | @application/xml; charset=utf-8@ +instance Produces TestEndpointParameters MimeXmlCharsetutf8 +-- | @application/json; charset=utf-8@ +instance Produces TestEndpointParameters MimeJsonCharsetutf8 --- *** uploadFile +-- *** testEnumParameters --- | @POST \/pet\/{petId}\/uploadImage@ +-- | @GET \/fake@ -- --- uploads an image +-- To test enum parameters -- --- +-- To test enum parameters -- --- AuthMethod: petstore_auth +-- Note: Has 'Produces' instances, but no response schema -- -uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - +testEnumParameters + :: (Consumes TestEnumParameters contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest TestEnumParameters contentType res +testEnumParameters _ = + _mkRequest "GET" ["/fake"] + +data TestEnumParameters -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 +-- | /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) --- | @application/json@ -instance Produces UploadFile MimeJSON - - --- ** Store - --- *** deleteOrder - --- | @DELETE \/store\/order\/{orderId}@ --- --- 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 - :: Text -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder orderId = - _mkRequest "DELETE" ["/store/order/",toPath orderId] - - -data DeleteOrder --- | @application/xml@ -instance Produces DeleteOrder MimeXML --- | @application/json@ -instance Produces DeleteOrder MimeJSON - - --- *** getInventory +-- | /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 + --- | @GET \/store\/inventory@ --- --- Returns pet inventories by status +-- *** testJsonFormData + +-- | @GET \/fake\/jsonFormData@ -- --- Returns a map of status codes to quantities +-- test json serialization of form data -- --- AuthMethod: api_key +-- -- -getInventory - :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map.Map String Int) -getInventory = - _mkRequest "GET" ["/store/inventory"] - -data GetInventory --- | @application/json@ -instance Produces GetInventory MimeJSON - - --- *** getOrderById - --- | @GET \/store\/order\/{orderId}@ --- --- Find purchase order by ID --- --- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions --- -getOrderById - :: Integer -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById 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 -- ^ request content-type ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -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 -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -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 +testJsonFormData + :: (Consumes TestJsonFormData contentType) + => contentType -- ^ request content-type ('MimeType') + -> Text -- ^ "param" - field1 + -> Text -- ^ "param2" - field2 + -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent +testJsonFormData _ param 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: api_key_query +-- +testClassname + :: (Consumes TestClassname contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClassname contentType Client +testClassname _ body = + _mkRequest "PATCH" ["/fake_classname_test"] + `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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +addPet + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = + _mkRequest "POST" ["/pet"] + `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 - --- *** createUsersWithArrayInput - --- | @POST \/user\/createWithArray@ +-- | @DELETE \/pet\/{petId}@ +-- +-- Deletes a pet +-- -- --- Creates list of users with given input array --- +-- +-- AuthMethod: petstore_auth -- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = - _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body - -data CreateUsersWithArrayInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput [User] --- | @application/xml@ -instance Produces CreateUsersWithArrayInput MimeXML --- | @application/json@ -instance Produces CreateUsersWithArrayInput MimeJSON +-- Note: Has 'Produces' instances, but no response schema +-- +deletePet + :: Integer -- ^ "petId" - Pet id to delete + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +deletePet petId = + _mkRequest "DELETE" ["/pet/",toPath petId] + + +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 - --- *** createUsersWithListInput - --- | @POST \/user\/createWithList@ --- --- Creates list of users with given input array --- +-- | @GET \/pet\/findByStatus@ +-- +-- Finds Pets by status +-- +-- Multiple status values can be provided with comma separated strings +-- +-- AuthMethod: petstore_auth -- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) - => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = - _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body - -data CreateUsersWithListInput +findPetsByStatus + :: [Text] -- ^ "status" - Status values that need to be considered for filter + -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] +findPetsByStatus status = + _mkRequest "GET" ["/pet/findByStatus"] + `_setQuery` toQueryColl CommaSeparated ("status", Just status) + +data FindPetsByStatus +-- | @application/xml@ +instance Produces FindPetsByStatus MimeXML +-- | @application/json@ +instance Produces FindPetsByStatus MimeJSON + --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput [User] --- | @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 - :: Text -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser username = - _mkRequest "DELETE" ["/user/",toPath username] - +-- *** findPetsByTags + +-- | @GET \/pet\/findByTags@ +-- +-- Finds Pets by tags +-- +-- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +-- +-- AuthMethod: petstore_auth +-- +findPetsByTags + :: [Text] -- ^ "tags" - Tags to filter by + -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] +findPetsByTags tags = + _mkRequest "GET" ["/pet/findByTags"] + `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) + +{-# DEPRECATED findPetsByTags "" #-} + +data FindPetsByTags +-- | @application/xml@ +instance Produces FindPetsByTags MimeXML +-- | @application/json@ +instance Produces FindPetsByTags MimeJSON -data DeleteUser --- | @application/xml@ -instance Produces DeleteUser MimeXML --- | @application/json@ -instance Produces DeleteUser MimeJSON - - --- *** getUserByName - --- | @GET \/user\/{username}@ + +-- *** getPetById + +-- | @GET \/pet\/{petId}@ +-- +-- Find pet by ID +-- +-- Returns a single pet +-- +-- AuthMethod: api_key -- --- Get user by user name --- --- --- -getUserByName - :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName username = - _mkRequest "GET" ["/user/",toPath username] - - -data GetUserByName --- | @application/xml@ -instance Produces GetUserByName MimeXML --- | @application/json@ -instance Produces GetUserByName MimeJSON - - --- *** loginUser - --- | @GET \/user\/login@ +getPetById + :: Integer -- ^ "petId" - ID of pet to return + -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet +getPetById petId = + _mkRequest "GET" ["/pet/",toPath petId] + + +data GetPetById +-- | @application/xml@ +instance Produces GetPetById MimeXML +-- | @application/json@ +instance Produces GetPetById MimeJSON + + +-- *** updatePet + +-- | @PUT \/pet@ +-- +-- Update an existing pet +-- +-- -- --- Logs user into the system +-- AuthMethod: petstore_auth -- --- +-- Note: Has 'Produces' instances, but no response schema -- -loginUser - :: Text -- ^ "username" - The user name for login - -> Text -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username password = - _mkRequest "GET" ["/user/login"] - `_setQuery` toQuery ("username", Just username) - `_setQuery` toQuery ("password", Just password) +updatePet + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest UpdatePet contentType res +updatePet _ body = + _mkRequest "PUT" ["/pet"] + `setBodyParam` body -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 - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res -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 -- ^ request content-type ('MimeType') - -> Text -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ username body = - _mkRequest "PUT" ["/user/",toPath username] - - `setBodyParam` body - -data UpdateUser +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: petstore_auth +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePetWithForm + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') + -> Integer -- ^ "petId" - ID of pet that needs to be updated + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ petId = + _mkRequest "POST" ["/pet/",toPath petId] + + +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 Status where + applyOptionalParam req (Status xs) = + req `_addForm` toForm ("status", xs) + +-- | @application/x-www-form-urlencoded@ +instance Consumes UpdatePetWithForm MimeFormUrlEncoded --- | /Body Param/ "body" - Updated user object -instance HasBodyParam UpdateUser User --- | @application/xml@ -instance Produces UpdateUser MimeXML --- | @application/json@ -instance Produces UpdateUser MimeJSON - +-- | @application/xml@ +instance Produces UpdatePetWithForm MimeXML +-- | @application/json@ +instance Produces UpdatePetWithForm MimeJSON + + +-- *** uploadFile - --- * HasBodyParam - --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} - - -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * Optional Request Parameter Types +-- | @POST \/pet\/{petId}\/uploadImage@ +-- +-- uploads an image +-- +-- +-- +-- AuthMethod: petstore_auth +-- +uploadFile + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') + -> Integer -- ^ "petId" - ID of pet to update + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +uploadFile _ petId = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + + +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 - -newtype ApiUnderscorekey = ApiUnderscorekey { unApiUnderscorekey :: Text } deriving (P.Eq, P.Show) +-- | @multipart/form-data@ +instance Consumes UploadFile MimeMultipartFormData -newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) - -newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) +-- | @application/json@ +instance Produces UploadFile MimeJSON + -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) +-- ** Store -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) +-- *** deleteOrder - --- * SwaggerPetstoreRequest - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest - { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , rParams :: Params -- ^ params of SwaggerPetstoreRequest - } - deriving (P.Show) - --- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod -{-# INLINE rMethodL #-} - --- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath -{-# INLINE rUrlPathL #-} +-- | @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 + :: Text -- ^ "orderId" - ID of the order that needs to be deleted + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +deleteOrder orderId = + _mkRequest "DELETE" ["/store/order/",toPath orderId] + + +data DeleteOrder +-- | @application/xml@ +instance Produces DeleteOrder MimeXML +-- | @application/json@ +instance Produces DeleteOrder MimeJSON --- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams -{-# INLINE rParamsL #-} - --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | 'paramsQuery' Lens -paramsQueryL :: Lens_' Params NH.Query -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 -{-# INLINE paramsHeadersL #-} + +-- *** getInventory + +-- | @GET \/store\/inventory@ +-- +-- Returns pet inventories by status +-- +-- Returns a map of status codes to quantities +-- +-- AuthMethod: api_key +-- +getInventory + :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) +getInventory = + _mkRequest "GET" ["/store/inventory"] + +data GetInventory +-- | @application/json@ +instance Produces GetInventory MimeJSON + + +-- *** getOrderById --- | 'paramsBody' Lens -paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody -{-# INLINE paramsBodyL #-} - --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** SwaggerPetstoreRequest Utils - -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone - -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) - -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & - L.over - (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) - where - cifst = CI.mk . P.fst - +-- | @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 + :: Integer -- ^ "orderId" - ID of pet that needs to be fetched + -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order +getOrderById 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 -- ^ request content-type ('MimeType') + -> Order -- ^ "body" - order placed for purchasing the pet + -> SwaggerPetstoreRequest PlaceOrder contentType Order +placeOrder _ body = + _mkRequest "POST" ["/store/order"] + `setBodyParam` body + +data PlaceOrder -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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 -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +-- | /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 -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = - req & - L.over - (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) - where - cifst = CI.mk . P.fst - -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) - -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) - -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +-- | @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 -- ^ request content-type ('MimeType') + -> User -- ^ "body" - Created user object + -> SwaggerPetstoreRequest CreateUser contentType res +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 + -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) - - --- ** Params Utils - -toPath - :: 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] - -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 - --- *** Swagger `CollectionFormat` Utils - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') - -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 - where - 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 - -_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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - - \ No newline at end of file +-- *** 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 [User]) + => contentType -- ^ request content-type ('MimeType') + -> [User] -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +createUsersWithArrayInput _ body = + _mkRequest "POST" ["/user/createWithArray"] + `setBodyParam` body + +data CreateUsersWithArrayInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithArrayInput [User] +-- | @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 [User]) + => contentType -- ^ request content-type ('MimeType') + -> [User] -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +createUsersWithListInput _ body = + _mkRequest "POST" ["/user/createWithList"] + `setBodyParam` body + +data CreateUsersWithListInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithListInput [User] +-- | @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 + :: Text -- ^ "username" - The name that needs to be deleted + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser 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 + :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + -> SwaggerPetstoreRequest GetUserByName MimeNoContent User +getUserByName 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 + :: Text -- ^ "username" - The user name for login + -> Text -- ^ "password" - The password for login in clear text + -> SwaggerPetstoreRequest LoginUser MimeNoContent Text +loginUser username 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 + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res +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 -- ^ request content-type ('MimeType') + -> Text -- ^ "username" - name that need to be deleted + -> User -- ^ "body" - Updated user object + -> SwaggerPetstoreRequest UpdateUser contentType res +updateUser _ 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 + + + +-- * HasBodyParam + +-- | Designates the body parameter of a request +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + 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 + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} + +infixl 2 -&- + +-- * Optional Request Parameter Types + + +newtype BodyOuterBoolean = BodyOuterBoolean { unBodyOuterBoolean :: OuterBoolean } deriving (P.Eq, P.Show) + +newtype BodyOuterComposite = BodyOuterComposite { unBodyOuterComposite :: OuterComposite } deriving (P.Eq, P.Show) + +newtype Body = Body { unBody :: OuterNumber } deriving (P.Eq, P.Show) + +newtype BodyOuterString = BodyOuterString { unBodyOuterString :: OuterString } deriving (P.Eq, P.Show) + +newtype ParamInteger = ParamInteger { unParamInteger :: Int } 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 ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) + +newtype ParamString = ParamString { unParamString :: 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 Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) + +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) + +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show) + +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) + +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) + +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) + +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) + +newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) + +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) + +newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) + +newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) + +newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) + + +-- * SwaggerPetstoreRequest + +-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest + { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest + , rParams :: Params -- ^ params of SwaggerPetstoreRequest + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) + +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) + +-- ** SwaggerPetstoreRequest Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) + +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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 +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +_setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst + +_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +_addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + + +-- ** Params Utils + +toPath + :: 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] + +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 + +-- *** Swagger `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 + where + 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 + +_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.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 + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + + \ 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 1322b6658ca..664b2de3d63 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 @@ -62,17 +62,17 @@ -- | display the config instance 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 -- -- configHost: -- --- @http://petstore.swagger.io/v2@ +-- @http://petstore.swagger.io:80/v2@ -- -- configUserAgent: -- @@ -80,27 +80,27 @@ -- newConfig :: IO SwaggerPetstoreConfig newConfig = do - logCxt <- initLogContext + logCxt <- initLogContext return $ SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" + { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "swagger-haskell-http-client/1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt + , configLogContext = logCxt } 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 } 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} -- * Dispatch @@ -108,21 +108,21 @@ -- | 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + 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) @@ -136,130 +136,130 @@ -- | send a request returning the 'MimeResult' 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do case mimeUnrender' 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) + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - return parsedResult + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + 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 -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (rParams req1) 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 req1) 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.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index eddc4581818..42c518137fd 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -10,185 +10,622 @@ module SwaggerPetstore.Lens where -import Data.Text (Text) - -import qualified Data.Aeson as A -import Data.Aeson (Value) -import qualified Data.ByteString as B -import Data.ByteString.Lazy (ByteString) -import qualified Data.Data as P (Data, Typeable) -import qualified Data.Map as Map +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Data, Typeable) +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Time as TI + +import Data.Text (Text) -import qualified Data.Time as TI -import Data.Time (UTCTime) +import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P -import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P - -import SwaggerPetstore.Model - --- * Type Aliases +import SwaggerPetstore.Model + +-- * 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 + +-- * AdditionalPropertiesClass - --- * ApiResponse - --- | 'apiResponseCode' Lens -apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -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 -{-# INLINE apiResponseTypeL #-} - --- | 'apiResponseMessage' Lens -apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage -{-# INLINE apiResponseMessageL #-} - +-- | 'additionalPropertiesClassMapProperty' Lens +additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +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 +{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} + + + +-- * Animal + +-- | 'animalClassName' Lens +animalClassNameL :: Lens_' Animal (Text) +animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName +{-# INLINE animalClassNameL #-} - --- * Category - --- | 'categoryId' Lens -categoryIdL :: Lens_' Category (Maybe Integer) -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 -{-# INLINE categoryNameL #-} +-- | 'animalColor' Lens +animalColorL :: Lens_' Animal (Maybe Text) +animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor +{-# INLINE animalColorL #-} + + + +-- * AnimalFarm + + + +-- * ApiResponse - - --- * Order - --- | 'orderId' Lens -orderIdL :: Lens_' Order (Maybe Integer) -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 -{-# INLINE orderPetIdL #-} - --- | 'orderQuantity' Lens -orderQuantityL :: Lens_' Order (Maybe Int) -orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity -{-# INLINE orderQuantityL #-} +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +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 +{-# INLINE apiResponseTypeL #-} + +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} + + + +-- * ArrayOfArrayOfNumberOnly --- | 'orderShipDate' Lens -orderShipDateL :: Lens_' Order (Maybe UTCTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate -{-# INLINE orderShipDateL #-} +-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens +arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} --- | 'orderStatus' Lens -orderStatusL :: Lens_' Order (Maybe Text) -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 -{-# INLINE orderCompleteL #-} + + +-- * ArrayOfNumberOnly + +-- | 'arrayOfNumberOnlyArrayNumber' Lens +arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +{-# INLINE arrayOfNumberOnlyArrayNumberL #-} + - --- * Pet - --- | 'petId' Lens -petIdL :: Lens_' Pet (Maybe Integer) -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 -{-# INLINE petCategoryL #-} - --- | 'petName' Lens -petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName -{-# INLINE petNameL #-} +-- * ArrayTest + +-- | 'arrayTestArrayOfString' Lens +arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) +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 +{-# INLINE arrayTestArrayArrayOfIntegerL #-} + +-- | 'arrayTestArrayArrayOfModel' Lens +arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +{-# INLINE arrayTestArrayArrayOfModelL #-} + --- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet ([Text]) -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 -{-# INLINE petTagsL #-} - --- | 'petStatus' Lens -petStatusL :: Lens_' Pet (Maybe Text) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus -{-# INLINE petStatusL #-} - - - --- * Tag - --- | 'tagId' Lens -tagIdL :: Lens_' Tag (Maybe Integer) -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 -{-# INLINE tagNameL #-} - - - --- * User + +-- * Capitalization + +-- | 'capitalizationSmallCamel' Lens +capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalCamelL #-} + +-- | 'capitalizationSmallSnake' Lens +capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalSnakeL #-} + +-- | 'capitalizationScaEthFlowPoints' Lens +capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationAttNameL #-} --- | 'userId' Lens -userIdL :: Lens_' User (Maybe Integer) -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 -{-# INLINE userUsernameL #-} - --- | 'userFirstName' Lens -userFirstNameL :: Lens_' User (Maybe Text) -userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName -{-# INLINE userFirstNameL #-} + + +-- * Category + +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +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 +{-# INLINE categoryNameL #-} + --- | 'userLastName' Lens -userLastNameL :: Lens_' User (Maybe Text) -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 -{-# INLINE userEmailL #-} + +-- * ClassModel + +-- | 'classModelClass' Lens +classModelClassL :: Lens_' ClassModel (Maybe Text) +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +{-# INLINE classModelClassL #-} + + --- | 'userPassword' Lens -userPasswordL :: Lens_' User (Maybe Text) -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 -{-# INLINE userPhoneL #-} - --- | 'userUserStatus' Lens -userUserStatusL :: Lens_' User (Maybe Int) -userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus -{-# INLINE userUserStatusL #-} - +-- * Client + +-- | 'clientClient' Lens +clientClientL :: Lens_' Client (Maybe Text) +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +{-# INLINE clientClientL #-} + + + +-- * EnumArrays + +-- | 'enumArraysJustSymbol' Lens +enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text) +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +{-# INLINE enumArraysJustSymbolL #-} - \ No newline at end of file +-- | 'enumArraysArrayEnum' Lens +enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text]) +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +{-# INLINE enumArraysArrayEnumL #-} + + + +-- * EnumClass + + + +-- * EnumTest + +-- | 'enumTestEnumString' Lens +enumTestEnumStringL :: Lens_' EnumTest (Maybe Text) +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +{-# INLINE enumTestEnumStringL #-} + +-- | 'enumTestEnumInteger' Lens +enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int) +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +{-# INLINE enumTestEnumIntegerL #-} + +-- | 'enumTestEnumNumber' Lens +enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double) +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 +{-# INLINE enumTestOuterEnumL #-} + + + +-- * FormatTest + +-- | 'formatTestInteger' Lens +formatTestIntegerL :: Lens_' FormatTest (Maybe Int) +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 +{-# INLINE formatTestInt32L #-} + +-- | 'formatTestInt64' Lens +formatTestInt64L :: Lens_' FormatTest (Maybe Integer) +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +{-# INLINE formatTestInt64L #-} + +-- | 'formatTestNumber' Lens +formatTestNumberL :: Lens_' FormatTest (Double) +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 +{-# INLINE formatTestFloatL #-} + +-- | 'formatTestDouble' Lens +formatTestDoubleL :: Lens_' FormatTest (Maybe Double) +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 +{-# INLINE formatTestStringL #-} + +-- | 'formatTestByte' Lens +formatTestByteL :: Lens_' FormatTest (ByteArray) +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 +{-# INLINE formatTestBinaryL #-} + +-- | 'formatTestDate' Lens +formatTestDateL :: Lens_' FormatTest (Date) +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 +{-# INLINE formatTestDateTimeL #-} + +-- | 'formatTestUuid' Lens +formatTestUuidL :: Lens_' FormatTest (Maybe Text) +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +{-# INLINE formatTestUuidL #-} + +-- | 'formatTestPassword' Lens +formatTestPasswordL :: Lens_' FormatTest (Text) +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +{-# INLINE formatTestPasswordL #-} + + + +-- * HasOnlyReadOnly + +-- | 'hasOnlyReadOnlyBar' Lens +hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) +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 +{-# INLINE hasOnlyReadOnlyFooL #-} + + + +-- * MapTest + +-- | 'mapTestMapMapOfString' Lens +mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +{-# INLINE mapTestMapMapOfStringL #-} + +-- | 'mapTestMapOfEnumString' Lens +mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text)) +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +{-# INLINE mapTestMapOfEnumStringL #-} + + + +-- * MixedPropertiesAndAdditionalPropertiesClass + +-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens +mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) +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 +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens +mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} + + + +-- * Model200Response + +-- | 'model200ResponseName' Lens +model200ResponseNameL :: Lens_' Model200Response (Maybe Int) +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 +{-# INLINE model200ResponseClassL #-} + + + +-- * ModelList + +-- | 'modelList123List' Lens +modelList123ListL :: Lens_' ModelList (Maybe Text) +modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List +{-# INLINE modelList123ListL #-} + + + +-- * ModelReturn + +-- | 'modelReturnReturn' Lens +modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +{-# INLINE modelReturnReturnL #-} + + + +-- * Name + +-- | 'nameName' Lens +nameNameL :: Lens_' Name (Int) +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 +{-# INLINE nameSnakeCaseL #-} + +-- | 'nameProperty' Lens +namePropertyL :: Lens_' Name (Maybe Text) +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 +{-# INLINE name123NumberL #-} + + + +-- * NumberOnly + +-- | 'numberOnlyJustNumber' Lens +numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +{-# INLINE numberOnlyJustNumberL #-} + + + +-- * Order + +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +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 +{-# INLINE orderPetIdL #-} + +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +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 +{-# INLINE orderShipDateL #-} + +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +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 +{-# INLINE orderCompleteL #-} + + + +-- * OuterBoolean + + + +-- * OuterComposite + +-- | 'outerCompositeMyNumber' Lens +outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber) +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 +{-# INLINE outerCompositeMyStringL #-} + +-- | 'outerCompositeMyBoolean' Lens +outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean) +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +{-# INLINE outerCompositeMyBooleanL #-} + + + +-- * OuterEnum + + + +-- * OuterNumber + + + +-- * OuterString + + + +-- * Pet + +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +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 +{-# INLINE petCategoryL #-} + +-- | 'petName' Lens +petNameL :: Lens_' Pet (Text) +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +{-# INLINE petNameL #-} + +-- | 'petPhotoUrls' Lens +petPhotoUrlsL :: Lens_' Pet ([Text]) +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 +{-# INLINE petTagsL #-} + +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} + + + +-- * ReadOnlyFirst + +-- | 'readOnlyFirstBar' Lens +readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) +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 +{-# INLINE readOnlyFirstBazL #-} + + + +-- * SpecialModelName + +-- | 'specialModelNameSpecialPropertyName' Lens +specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +{-# INLINE specialModelNameSpecialPropertyNameL #-} + + + +-- * Tag + +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +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 +{-# INLINE tagNameL #-} + + + +-- * User + +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +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 +{-# INLINE userUsernameL #-} + +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +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 +{-# INLINE userLastNameL #-} + +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +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 +{-# INLINE userPasswordL #-} + +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +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 +{-# INLINE userUserStatusL #-} + + + +-- * Cat + +-- | 'catClassName' Lens +catClassNameL :: Lens_' Cat (Text) +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 +{-# INLINE catColorL #-} + +-- | 'catDeclawed' Lens +catDeclawedL :: Lens_' Cat (Maybe Bool) +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +{-# INLINE catDeclawedL #-} + + + +-- * Dog + +-- | 'dogClassName' Lens +dogClassNameL :: Lens_' Dog (Text) +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 +{-# INLINE dogColorL #-} + +-- | 'dogBreed' Lens +dogBreedL :: Lens_' Dog (Maybe Text) +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +{-# INLINE dogBreedL #-} + + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html index 8df26c2340a..f4a1beb4223 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -24,11 +24,11 @@ -- * Type Aliases (for compatability) -- | Runs a Katip logging block with the Log environment -type LogExecWithContext = forall m. P.MonadIO m => - LogContext -> LogExec m +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m -- | A Katip logging block -type LogExec m = forall a. LG.KatipT m a -> m a +type LogExec m = forall a. LG.KatipT m a -> m a -- | A Katip Log environment type LogContext = LG.LogEnv @@ -54,9 +54,9 @@ -- | A Katip Log environment which targets stdout stdoutLoggingContext :: LogContext -> IO LogContext -stdoutLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 - LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt -- * stderr logger @@ -66,34 +66,34 @@ -- | A Katip Log environment which targets stderr stderrLoggingContext :: LogContext -> IO LogContext -stderrLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 - LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt -- * Null logger -- | Disables Katip logging runNullLogExec :: LogExecWithContext -runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) -- * Log Msg -- | Log a katip message -_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () -_log src level msg = do - LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) -- * Log Exceptions -- | re-throws exceptions after logging them logExceptions - :: (LG.Katip m, E.MonadCatch m, Applicative m) - => Text -> m a -> m a -logExceptions src = + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = E.handle - (\(e :: E.SomeException) -> do - _log src LG.ErrorS ((T.pack . show) e) - E.throw e) + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) -- * Log Level 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 42836733cfd..d2c23acd46c 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 @@ -13,179 +13,208 @@ module SwaggerPetstore.MimeTypes where - -import qualified Data.Aeson as A - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL - -import qualified Network.HTTP.Media as ME +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.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL + -import qualified Web.FormUrlEncoded as WH +import qualified Network.HTTP.Media as ME -import qualified Data.Data as P (Typeable) -import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) - -import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) -import qualified Prelude as P - --- * Content Negotiation - --- | A type for responses without content-body. -data NoContent = NoContent - deriving (P.Show, P.Eq) +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import qualified Data.Data as P (Typeable) +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.String as P +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) + +import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) +import qualified Prelude as P + +-- * Content Negotiation --- ** Mime Types - -data MimeJSON = MimeJSON deriving (P.Typeable) -data MimeXML = MimeXML deriving (P.Typeable) -data MimePlainText = MimePlainText deriving (P.Typeable) -data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) -data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) -data MimeOctetStream = MimeOctetStream deriving (P.Typeable) -data MimeNoContent = MimeNoContent deriving (P.Typeable) - - --- ** MimeType Class - -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] - Nothing -> [] - - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of - [] -> Nothing - (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 Instances +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq) + +-- ** Mime Types + +data MimeJSON = MimeJSON deriving (P.Typeable) +data MimeXML = MimeXML deriving (P.Typeable) +data MimePlainText = MimePlainText deriving (P.Typeable) +data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) +data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) +data MimeOctetStream = MimeOctetStream deriving (P.Typeable) +data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) + +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) +data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) + +-- ** MimeType Class + +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] + Nothing -> [] + + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of + [] -> Nothing + (x:_) -> Just x --- | @application/json@ -instance MimeType MimeJSON where - mimeTypes _ = - [ "application" ME.// "json" ME./: ("charset", "utf-8") - , "application" ME.// "json" - ] + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + +-- ** MimeType Instances --- | @application/xml@ -instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" - --- | @application/x-www-form-urlencoded@ -instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" - --- | @multipart/form-data@ -instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" - --- | @text/plain;charset=utf-8@ +-- | @application/json; charset=utf-8@ +instance MimeType MimeJSON where + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXML where + mimeType _ = Just $ P.fromString "application/xml" +-- | @application/x-www-form-urlencoded@ +instance MimeType MimeFormUrlEncoded where + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" +-- | @multipart/form-data@ +instance MimeType MimeMultipartFormData where + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") -instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" -instance MimeType MimeNoContent where - 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 + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ +instance MimeType MimeOctetStream where + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" +instance MimeType MimeNoContent where + mimeType _ = Nothing + +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" - --- ** MimeRender Instances - --- | `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 - --- | @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 --- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack +-- | @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 + + +-- ** 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 + --- | @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 --- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack +-- ** MimeRender Instances + +-- | `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 -- | @P.id@ -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack --- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty - --- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec --- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec --- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec --- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec - - --- ** 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 - --- ** MimeUnrender Instances - --- | @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 --- | @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 --- | @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 --- | @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 - --- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent - - --- ** Request Consumes +-- | @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 +-- | @BCL.pack@ +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack + +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary + +instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData DateTime 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 + +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam + +-- | @P.Right . P.const NoContent@ +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty + +-- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec +-- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec +-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec +-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec + +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined + +-- ** 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 => Consumes req mtype where +-- ** MimeUnrender Instances --- ** Request Produces - -class MimeType mtype => Produces req mtype where - \ No newline at end of file +-- | @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 +-- | @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 +-- | @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 +-- | @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 + +-- | @P.Right . P.const NoContent@ +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined +-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** Request Consumes + +class MimeType mtype => Consumes req mtype where + +-- ** Request Produces + +class MimeType mtype => Produces req mtype where + \ 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 f7d6ec052bb..643a514eb4c 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 @@ -17,361 +17,1400 @@ module SwaggerPetstore.Model where import Data.Aeson ((.:),(.:!),(.:?),(.=)) -import Data.Text (Text) - -import Data.Aeson (Value) -import Data.ByteString.Lazy (ByteString) - -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.Data as P (Data, Typeable) -import qualified Data.HashMap.Lazy as HM -import qualified Data.Map as Map -import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import qualified Data.Time as TI -import qualified Data.Time.ISO8601 as TI -import Data.Time (UTCTime) - -import Control.Applicative ((<|>)) -import Control.Applicative (Alternative) -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.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Base64.Lazy as BL64 +import qualified Data.Data as P (Data, Typeable) +import qualified Data.HashMap.Lazy as HM +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Maybe as P +import qualified Data.Foldable as P +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH +import qualified Control.DeepSeq as NF +import qualified Data.Ix as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) +import Data.Text (Text) + +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 as TI + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P --- ** ApiResponse --- | --- An uploaded response --- --- Describes the result of uploading an image resource -data ApiResponse = ApiResponse - { apiResponseCode :: !(Maybe Int) -- ^ "code" - , apiResponseType :: !(Maybe Text) -- ^ "type" - , apiResponseMessage :: !(Maybe Text) -- ^ "message" + +-- * Models + + +-- ** 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) -instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> - ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") - -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 - } - - - --- ** Category --- | --- Pet catehgry --- --- A category for a pet -data Category = Category - { categoryId :: !(Maybe Integer) -- ^ "id" - , categoryName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> - Category - <$> (o .:? "id") - <*> (o .:? "name") +instance A.FromJSON AdditionalPropertiesClass where + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + AdditionalPropertiesClass + <$> (o .:? "map_property") + <*> (o .:? "map_of_map_property") + +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 + } + + +-- ** Animal +-- | +data Animal = Animal + { animalClassName :: !(Text) -- ^ /Required/ "className" + , animalColor :: !(Maybe Text) -- ^ "color" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Animal where + parseJSON = A.withObject "Animal" $ \o -> + Animal + <$> (o .: "className") + <*> (o .:? "color") + +instance A.ToJSON Animal where + toJSON Animal {..} = + _omitNulls + [ "className" .= animalClassName + , "color" .= animalColor + ] -instance A.ToJSON Category where - toJSON Category {..} = - _omitNulls - [ "id" .= categoryId - , "name" .= categoryName - ] - - --- | 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 'Animal' (by applying it's required fields, if any) +mkAnimal + :: Text -- ^ 'animalClassName' + -> Animal +mkAnimal animalClassName = + Animal + { animalClassName + , animalColor = Nothing + } + + +-- ** AnimalFarm +-- | +data AnimalFarm = AnimalFarm + { + } deriving (P.Show,P.Eq,P.Typeable) - --- ** Order --- | --- Pet Order --- --- An order for a pets from the pet store -data Order = Order - { orderId :: !(Maybe Integer) -- ^ "id" - , orderPetId :: !(Maybe Integer) -- ^ "petId" - , orderQuantity :: !(Maybe Int) -- ^ "quantity" - , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" - , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status - , orderComplete :: !(Maybe Bool) -- ^ "complete" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> - Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate" >>= P.mapM _readDateTime) - <*> (o .:? "status") - <*> (o .:? "complete") - -instance A.ToJSON Order where - toJSON Order {..} = - _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= P.fmap _showDateTime orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete - ] +instance A.FromJSON AnimalFarm where + parseJSON = A.withObject "AnimalFarm" $ \o -> + pure 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 +-- | +data ApiResponse = ApiResponse + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ApiResponse where + parseJSON = A.withObject "ApiResponse" $ \o -> + ApiResponse + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") - --- | 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 - } - - - --- ** Pet --- | --- a Pet --- --- A pet for sale in the pet store -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 Text) -- ^ "status" - pet status in the store - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> - Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") - -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 - } - - - --- ** Tag --- | --- Pet Tag --- --- A tag for a pet -data Tag = Tag - { tagId :: !(Maybe Integer) -- ^ "id" - , tagName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - -instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> - Tag - <$> (o .:? "id") - <*> (o .:? "name") - -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 --- | --- a User --- --- A User who is purchasing from the pet store -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 +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 +-- | +data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ArrayOfArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + ArrayOfArrayOfNumberOnly + <$> (o .:? "ArrayArrayNumber") + +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 +-- | +data ArrayOfNumberOnly = ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + ArrayOfNumberOnly + <$> (o .:? "ArrayNumber") + +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 +-- | +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) + +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") + +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 +-- | +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) -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 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 - } - - +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") + +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 +-- | +data Category = Category + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show,P.Eq,P.Typeable) --- * 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 - where - notNull (_, A.Null) = False - notNull _ = True - -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x +instance A.FromJSON Category where + parseJSON = A.withObject "Category" $ \o -> + Category + <$> (o .:? "id") + <*> (o .:? "name") + +instance A.ToJSON Category where + toJSON Category {..} = + _omitNulls + [ "id" .= categoryId + , "name" .= categoryName + ] -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_emptyToNothing x = x -{-# INLINE _emptyToNothing #-} - -_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 - --- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_readDateTime = - _parseISO8601 -{-# INLINE _readDateTime #-} + +-- | Construct a value of type 'Category' (by applying it's required fields, if any) +mkCategory + :: Category +mkCategory = + Category + { categoryId = Nothing + , categoryName = Nothing + } + + +-- ** ClassModel +-- | +-- Model for testing model with \"_class\" property +data ClassModel = ClassModel + { classModelClass :: !(Maybe Text) -- ^ "_class" + } deriving (P.Show,P.Eq,P.Typeable) --- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String -_showDateTime = - TI.formatISO8601Millis -{-# INLINE _showDateTime #-} - -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - --- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t -_readDate = - TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _readDate #-} +instance A.FromJSON ClassModel where + parseJSON = A.withObject "ClassModel" $ \o -> + ClassModel + <$> (o .:? "_class") + +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 + } + --- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ -_showDate :: TI.FormatTime t => t -> String -_showDate = - TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} \ No newline at end of file +-- ** Client +-- | +data Client = Client + { clientClient :: !(Maybe Text) -- ^ "client" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Client where + parseJSON = A.withObject "Client" $ \o -> + Client + <$> (o .:? "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 +-- | +data EnumArrays = EnumArrays + { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumArrays where + parseJSON = A.withObject "EnumArrays" $ \o -> + EnumArrays + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") + +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 + } + + +-- ** EnumClass +-- | +data EnumClass = EnumClass + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumClass where + parseJSON = A.withObject "EnumClass" $ \o -> + pure EnumClass + + +instance A.ToJSON EnumClass where + toJSON EnumClass = + _omitNulls + [ + ] + + +-- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) +mkEnumClass + :: EnumClass +mkEnumClass = + EnumClass + { + } + + +-- ** EnumTest +-- | +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" + , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number" + , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumTest where + parseJSON = A.withObject "EnumTest" $ \o -> + EnumTest + <$> (o .:? "enum_string") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") + +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 + } + + +-- ** 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) + +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") + +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 +-- | +data HasOnlyReadOnly = HasOnlyReadOnly + { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" + , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON HasOnlyReadOnly where + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + HasOnlyReadOnly + <$> (o .:? "bar") + <*> (o .:? "foo") + +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _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 +-- | +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "map_of_enum_string" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON MapTest where + parseJSON = A.withObject "MapTest" $ \o -> + MapTest + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") + +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 +-- | +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) + +instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + MixedPropertiesAndAdditionalPropertiesClass + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") + +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 +-- | +-- 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) + +instance A.FromJSON Model200Response where + parseJSON = A.withObject "Model200Response" $ \o -> + Model200Response + <$> (o .:? "name") + <*> (o .:? "class") + +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 +-- | +data ModelList = ModelList + { modelList123List :: !(Maybe Text) -- ^ "123-list" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ModelList where + parseJSON = A.withObject "ModelList" $ \o -> + ModelList + <$> (o .:? "123-list") + +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 +-- | +-- Model for testing reserved words +data ModelReturn = ModelReturn + { modelReturnReturn :: !(Maybe Int) -- ^ "return" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ModelReturn where + parseJSON = A.withObject "ModelReturn" $ \o -> + ModelReturn + <$> (o .:? "return") + +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 +-- | +-- 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) + +instance A.FromJSON Name where + parseJSON = A.withObject "Name" $ \o -> + Name + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") + +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 +-- | +data NumberOnly = NumberOnly + { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON NumberOnly where + parseJSON = A.withObject "NumberOnly" $ \o -> + NumberOnly + <$> (o .:? "JustNumber") + +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 +-- | +data Order = Order + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" + , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Order where + parseJSON = A.withObject "Order" $ \o -> + Order + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate") + <*> (o .:? "status") + <*> (o .:? "complete") + +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 +-- | +data OuterBoolean = OuterBoolean + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterBoolean where + parseJSON = A.withObject "OuterBoolean" $ \o -> + pure OuterBoolean + + +instance A.ToJSON OuterBoolean where + toJSON OuterBoolean = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) +mkOuterBoolean + :: OuterBoolean +mkOuterBoolean = + OuterBoolean + { + } + + +-- ** 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) + +instance A.FromJSON OuterComposite where + parseJSON = A.withObject "OuterComposite" $ \o -> + OuterComposite + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") + +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 + } + + +-- ** OuterEnum +-- | +data OuterEnum = OuterEnum + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterEnum where + parseJSON = A.withObject "OuterEnum" $ \o -> + pure OuterEnum + + +instance A.ToJSON OuterEnum where + toJSON OuterEnum = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) +mkOuterEnum + :: OuterEnum +mkOuterEnum = + OuterEnum + { + } + + +-- ** OuterNumber +-- | +data OuterNumber = OuterNumber + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterNumber where + parseJSON = A.withObject "OuterNumber" $ \o -> + pure OuterNumber + + +instance A.ToJSON OuterNumber where + toJSON OuterNumber = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) +mkOuterNumber + :: OuterNumber +mkOuterNumber = + OuterNumber + { + } + + +-- ** OuterString +-- | +data OuterString = OuterString + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterString where + parseJSON = A.withObject "OuterString" $ \o -> + pure OuterString + + +instance A.ToJSON OuterString where + toJSON OuterString = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterString' (by applying it's required fields, if any) +mkOuterString + :: OuterString +mkOuterString = + OuterString + { + } + + +-- ** 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 Text) -- ^ "status" - pet status in the store + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Pet where + parseJSON = A.withObject "Pet" $ \o -> + Pet + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") + +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 +-- | +data ReadOnlyFirst = ReadOnlyFirst + { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" + , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ReadOnlyFirst where + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + ReadOnlyFirst + <$> (o .:? "bar") + <*> (o .:? "baz") + +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 + } + + +-- ** SpecialModelName +-- | +data SpecialModelName = SpecialModelName + { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON SpecialModelName where + parseJSON = A.withObject "SpecialModelName" $ \o -> + SpecialModelName + <$> (o .:? "$special[property.name]") + +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 +-- | +data Tag = Tag + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Tag where + parseJSON = A.withObject "Tag" $ \o -> + Tag + <$> (o .:? "id") + <*> (o .:? "name") + +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 +-- | +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) + +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 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 +-- | +data Cat = Cat + { catClassName :: !(Text) -- ^ /Required/ "className" + , catColor :: !(Maybe Text) -- ^ "color" + , catDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Cat where + parseJSON = A.withObject "Cat" $ \o -> + Cat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + +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 +-- | +data Dog = Dog + { dogClassName :: !(Text) -- ^ /Required/ "className" + , dogColor :: !(Maybe Text) -- ^ "color" + , dogBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Dog where + parseJSON = A.withObject "Dog" $ \o -> + Dog + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") + +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 + } + + +-- * 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 + where + notNull (_, A.Null) = False + notNull _ = True + +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x + +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_emptyToNothing x = x +{-# INLINE _emptyToNothing #-} + +_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 + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t + +-- | @_parseISO8601@ +_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 = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t + +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_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 TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index 717d03643f0..d4faad4d5ca 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -120,7 +120,7 @@ runPet mgr config = do -- instance S.HasOptionalParam S.UpdatePetWithForm S.Status -- -- Defined in ‘SwaggerPetstore.API’ let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded pid - `S.applyOptionalParam` S.Name "petName" + `S.applyOptionalParam` S.Name2 "petName" `S.applyOptionalParam` S.Status "pending" _ <- S.dispatchLbs mgr config updatePetWithFormRequest S.MimeJSON @@ -133,7 +133,7 @@ runPet mgr config = do -- deletePet let deletePetRequest = S.deletePet pid - `S.applyOptionalParam` S.ApiUnderscorekey "api key" + `S.applyOptionalParam` S.ApiKey "api key" _ <- S.dispatchLbs mgr config deletePetRequest S.MimeJSON return () @@ -161,7 +161,7 @@ runStore mgr config = do -- placeOrder now <- TI.getCurrentTime - let placeOrderRequest = S.placeOrder S.MimeJSON (S.mkOrder { S.orderId = Just 21, S.orderQuantity = Just 210, S.orderShipDate = Just now}) + let placeOrderRequest = S.placeOrder S.MimeJSON (S.mkOrder { S.orderId = Just 21, S.orderQuantity = Just 210, S.orderShipDate = Just (S.DateTime now)}) placeOrderResult <- S.dispatchMime mgr config placeOrderRequest S.MimeJSON mapM_ (\r -> putStrLn $ "placeOrderResult: " <> show r) placeOrderResult 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 bd49d5fd629..c0408b8fb9e 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -22,14 +22,11 @@ import SwaggerPetstore.MimeTypes import SwaggerPetstore.Lens import qualified Data.Aeson as A -import Data.Aeson (Value) import qualified Data.Time as TI -import Data.Time (UTCTime) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL -import Data.ByteString.Lazy (ByteString) import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL @@ -45,6 +42,7 @@ import qualified Data.CaseInsensitive as CI import qualified Data.Data as P (Typeable) import qualified Data.Foldable as P import qualified Data.Map as Map +import qualified Data.Set as Set import qualified Data.Maybe as P import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Text as T @@ -58,7 +56,6 @@ import qualified Lens.Micro as L import Data.Monoid ((<>)) import Data.Function ((&)) -import Data.Set (Set) import Data.Text (Text) import GHC.Base ((<|>)) @@ -68,6 +65,352 @@ 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 -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestSpecialTags contentType Client +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString +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 -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClientModel contentType Client +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: http_basic_test +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEndpointParameters + :: (Consumes TestEndpointParameters contentType) + => contentType -- ^ request content-type ('MimeType') + -> Double -- ^ "number" - None + -> Double -- ^ "double" - None + -> Text -- ^ "patternWithoutDelimiter" - None + -> ByteArray -- ^ "byte" - None + -> SwaggerPetstoreRequest TestEndpointParameters contentType res +testEndpointParameters _ number double patternWithoutDelimiter byte = + _mkRequest "POST" ["/fake"] + `_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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest TestEnumParameters contentType res +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 + + +-- *** testJsonFormData + +-- | @GET \/fake\/jsonFormData@ +-- +-- test json serialization of form data +-- +-- +-- +testJsonFormData + :: (Consumes TestJsonFormData contentType) + => contentType -- ^ request content-type ('MimeType') + -> Text -- ^ "param" - field1 + -> Text -- ^ "param2" - field2 + -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent +testJsonFormData _ param 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: api_key_query +-- +testClassname + :: (Consumes TestClassname contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClassname contentType Client +testClassname _ body = + _mkRequest "PATCH" ["/fake_classname_test"] + `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 @@ -127,8 +470,8 @@ deletePet petId = data DeletePet -instance HasOptionalParam DeletePet ApiUnderscorekey where - applyOptionalParam req (ApiUnderscorekey xs) = +instance HasOptionalParam DeletePet ApiKey where + applyOptionalParam req (ApiKey xs) = req `setHeader` toHeader ("api_key", xs) -- | @application/xml@ instance Produces DeletePet MimeXML @@ -271,8 +614,8 @@ updatePetWithForm _ petId = data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name where - applyOptionalParam req (Name xs) = +instance HasOptionalParam UpdatePetWithForm Name2 where + applyOptionalParam req (Name2 xs) = req `_addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet @@ -331,7 +674,7 @@ instance Produces UploadFile MimeJSON -- *** deleteOrder --- | @DELETE \/store\/order\/{orderId}@ +-- | @DELETE \/store\/order\/{order_id}@ -- -- Delete purchase order by ID -- @@ -364,7 +707,7 @@ instance Produces DeleteOrder MimeJSON -- AuthMethod: api_key -- getInventory - :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map.Map String Int) + :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) getInventory = _mkRequest "GET" ["/store/inventory"] @@ -375,7 +718,7 @@ instance Produces GetInventory MimeJSON -- *** getOrderById --- | @GET \/store\/order\/{orderId}@ +-- | @GET \/store\/order\/{order_id}@ -- -- Find purchase order by ID -- @@ -664,9 +1007,53 @@ infixl 2 -&- -- * Optional Request Parameter Types -newtype ApiUnderscorekey = ApiUnderscorekey { unApiUnderscorekey :: Text } deriving (P.Eq, P.Show) +newtype BodyOuterBoolean = BodyOuterBoolean { unBodyOuterBoolean :: OuterBoolean } deriving (P.Eq, P.Show) + +newtype BodyOuterComposite = BodyOuterComposite { unBodyOuterComposite :: OuterComposite } deriving (P.Eq, P.Show) + +newtype Body = Body { unBody :: OuterNumber } deriving (P.Eq, P.Show) + +newtype BodyOuterString = BodyOuterString { unBodyOuterString :: OuterString } deriving (P.Eq, P.Show) + +newtype ParamInteger = ParamInteger { unParamInteger :: Int } 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 ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) + +newtype ParamString = ParamString { unParamString :: 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 Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) + +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) + +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show) + +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) + +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) + +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) + +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) + +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) + +newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -newtype Name = Name { unName :: Text } deriving (P.Eq, P.Show) +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index ade235e502c..b68ce51a7bd 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -72,7 +72,7 @@ instance Show SwaggerPetstoreConfig where -- -- configHost: -- --- @http://petstore.swagger.io/v2@ +-- @http://petstore.swagger.io:80/v2@ -- -- configUserAgent: -- @@ -82,7 +82,7 @@ newConfig :: IO SwaggerPetstoreConfig newConfig = do logCxt <- initLogContext return $ SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io/v2" + { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "swagger-haskell-http-client/1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs index db36f380fbe..b645d189d7a 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs @@ -10,17 +10,14 @@ Module : SwaggerPetstore.Lens module SwaggerPetstore.Lens where -import Data.Text (Text) - import qualified Data.Aeson as A -import Data.Aeson (Value) -import qualified Data.ByteString as B -import Data.ByteString.Lazy (ByteString) +import qualified Data.ByteString.Lazy as BL import qualified Data.Data as P (Data, Typeable) import qualified Data.Map as Map - +import qualified Data.Set as Set import qualified Data.Time as TI -import Data.Time (UTCTime) + +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 @@ -33,6 +30,38 @@ 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 +-- * AdditionalPropertiesClass + +-- | 'additionalPropertiesClassMapProperty' Lens +additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +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 +{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} + + + +-- * Animal + +-- | 'animalClassName' Lens +animalClassNameL :: Lens_' Animal (Text) +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 +{-# INLINE animalColorL #-} + + + +-- * AnimalFarm + + + -- * ApiResponse -- | 'apiResponseCode' Lens @@ -52,6 +81,77 @@ apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { ap +-- * ArrayOfArrayOfNumberOnly + +-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens +arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} + + + +-- * ArrayOfNumberOnly + +-- | 'arrayOfNumberOnlyArrayNumber' Lens +arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +{-# INLINE arrayOfNumberOnlyArrayNumberL #-} + + + +-- * ArrayTest + +-- | 'arrayTestArrayOfString' Lens +arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) +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 +{-# INLINE arrayTestArrayArrayOfIntegerL #-} + +-- | 'arrayTestArrayArrayOfModel' Lens +arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +{-# INLINE arrayTestArrayArrayOfModelL #-} + + + +-- * Capitalization + +-- | 'capitalizationSmallCamel' Lens +capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalCamelL #-} + +-- | 'capitalizationSmallSnake' Lens +capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalSnakeL #-} + +-- | 'capitalizationScaEthFlowPoints' Lens +capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationAttNameL #-} + + + -- * Category -- | 'categoryId' Lens @@ -66,6 +166,247 @@ categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) +-- * ClassModel + +-- | 'classModelClass' Lens +classModelClassL :: Lens_' ClassModel (Maybe Text) +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +{-# INLINE classModelClassL #-} + + + +-- * Client + +-- | 'clientClient' Lens +clientClientL :: Lens_' Client (Maybe Text) +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +{-# INLINE clientClientL #-} + + + +-- * EnumArrays + +-- | 'enumArraysJustSymbol' Lens +enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text) +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +{-# INLINE enumArraysJustSymbolL #-} + +-- | 'enumArraysArrayEnum' Lens +enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text]) +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +{-# INLINE enumArraysArrayEnumL #-} + + + +-- * EnumClass + + + +-- * EnumTest + +-- | 'enumTestEnumString' Lens +enumTestEnumStringL :: Lens_' EnumTest (Maybe Text) +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +{-# INLINE enumTestEnumStringL #-} + +-- | 'enumTestEnumInteger' Lens +enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int) +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +{-# INLINE enumTestEnumIntegerL #-} + +-- | 'enumTestEnumNumber' Lens +enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double) +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 +{-# INLINE enumTestOuterEnumL #-} + + + +-- * FormatTest + +-- | 'formatTestInteger' Lens +formatTestIntegerL :: Lens_' FormatTest (Maybe Int) +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 +{-# INLINE formatTestInt32L #-} + +-- | 'formatTestInt64' Lens +formatTestInt64L :: Lens_' FormatTest (Maybe Integer) +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +{-# INLINE formatTestInt64L #-} + +-- | 'formatTestNumber' Lens +formatTestNumberL :: Lens_' FormatTest (Double) +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 +{-# INLINE formatTestFloatL #-} + +-- | 'formatTestDouble' Lens +formatTestDoubleL :: Lens_' FormatTest (Maybe Double) +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 +{-# INLINE formatTestStringL #-} + +-- | 'formatTestByte' Lens +formatTestByteL :: Lens_' FormatTest (ByteArray) +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 +{-# INLINE formatTestBinaryL #-} + +-- | 'formatTestDate' Lens +formatTestDateL :: Lens_' FormatTest (Date) +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 +{-# INLINE formatTestDateTimeL #-} + +-- | 'formatTestUuid' Lens +formatTestUuidL :: Lens_' FormatTest (Maybe Text) +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +{-# INLINE formatTestUuidL #-} + +-- | 'formatTestPassword' Lens +formatTestPasswordL :: Lens_' FormatTest (Text) +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +{-# INLINE formatTestPasswordL #-} + + + +-- * HasOnlyReadOnly + +-- | 'hasOnlyReadOnlyBar' Lens +hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) +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 +{-# INLINE hasOnlyReadOnlyFooL #-} + + + +-- * MapTest + +-- | 'mapTestMapMapOfString' Lens +mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +{-# INLINE mapTestMapMapOfStringL #-} + +-- | 'mapTestMapOfEnumString' Lens +mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text)) +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +{-# INLINE mapTestMapOfEnumStringL #-} + + + +-- * MixedPropertiesAndAdditionalPropertiesClass + +-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens +mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) +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 +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens +mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} + + + +-- * Model200Response + +-- | 'model200ResponseName' Lens +model200ResponseNameL :: Lens_' Model200Response (Maybe Int) +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 +{-# INLINE model200ResponseClassL #-} + + + +-- * ModelList + +-- | 'modelList123List' Lens +modelList123ListL :: Lens_' ModelList (Maybe Text) +modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List +{-# INLINE modelList123ListL #-} + + + +-- * ModelReturn + +-- | 'modelReturnReturn' Lens +modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +{-# INLINE modelReturnReturnL #-} + + + +-- * Name + +-- | 'nameName' Lens +nameNameL :: Lens_' Name (Int) +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 +{-# INLINE nameSnakeCaseL #-} + +-- | 'nameProperty' Lens +namePropertyL :: Lens_' Name (Maybe Text) +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 +{-# INLINE name123NumberL #-} + + + +-- * NumberOnly + +-- | 'numberOnlyJustNumber' Lens +numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +{-# INLINE numberOnlyJustNumberL #-} + + + -- * Order -- | 'orderId' Lens @@ -84,7 +425,7 @@ orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> {-# INLINE orderQuantityL #-} -- | 'orderShipDate' Lens -orderShipDateL :: Lens_' Order (Maybe UTCTime) +orderShipDateL :: Lens_' Order (Maybe DateTime) orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} @@ -100,6 +441,41 @@ orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> +-- * OuterBoolean + + + +-- * OuterComposite + +-- | 'outerCompositeMyNumber' Lens +outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber) +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 +{-# INLINE outerCompositeMyStringL #-} + +-- | 'outerCompositeMyBoolean' Lens +outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean) +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +{-# INLINE outerCompositeMyBooleanL #-} + + + +-- * OuterEnum + + + +-- * OuterNumber + + + +-- * OuterString + + + -- * Pet -- | 'petId' Lens @@ -134,6 +510,29 @@ petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +-- * ReadOnlyFirst + +-- | 'readOnlyFirstBar' Lens +readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) +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 +{-# INLINE readOnlyFirstBazL #-} + + + +-- * SpecialModelName + +-- | 'specialModelNameSpecialPropertyName' Lens +specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +{-# INLINE specialModelNameSpecialPropertyNameL #-} + + + -- * Tag -- | 'tagId' Lens @@ -191,3 +590,41 @@ userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$ {-# INLINE userUserStatusL #-} + +-- * Cat + +-- | 'catClassName' Lens +catClassNameL :: Lens_' Cat (Text) +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 +{-# INLINE catColorL #-} + +-- | 'catDeclawed' Lens +catDeclawedL :: Lens_' Cat (Maybe Bool) +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +{-# INLINE catDeclawedL #-} + + + +-- * Dog + +-- | 'dogClassName' Lens +dogClassNameL :: Lens_' Dog (Text) +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 +{-# INLINE dogColorL #-} + +-- | 'dogBreed' Lens +dogBreedL :: Lens_' Dog (Maybe Text) +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +{-# INLINE dogBreedL #-} + + 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 d10b66356a3..d7abb7681bb 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs @@ -13,6 +13,7 @@ Module : SwaggerPetstore.MimeTypes module SwaggerPetstore.MimeTypes where +import SwaggerPetstore.Model as M import qualified Data.Aeson as A @@ -22,13 +23,16 @@ import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL + import qualified Network.HTTP.Media as ME import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH import qualified Data.Data as P (Typeable) import qualified Data.Proxy as P (Proxy(..)) import qualified Data.Text as T +import qualified Data.String as P import qualified Data.Text.Encoding as T import qualified Control.Arrow as P (left) @@ -50,7 +54,10 @@ data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) data MimeOctetStream = MimeOctetStream deriving (P.Typeable) data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) +data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) -- ** MimeType Class @@ -76,33 +83,40 @@ class P.Typeable mtype => MimeType mtype where -- ** MimeType Instances --- | @application/json@ +-- | @application/json; charset=utf-8@ instance MimeType MimeJSON where - mimeTypes _ = - [ "application" ME.// "json" ME./: ("charset", "utf-8") - , "application" ME.// "json" - ] - --- | @application/xml@ + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ instance MimeType MimeXML where - mimeType _ = Just $ "application" ME.// "xml" - + mimeType _ = Just $ P.fromString "application/xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ "application" ME.// "x-www-form-urlencoded" - + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ "multipart" ME.// "form-data" - --- | @text/plain;charset=utf-8@ + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ "text" ME.// "plain" ME./: ("charset", "utf-8") + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ instance MimeType MimeOctetStream where - mimeType _ = Just $ "application" ME.// "octet-stream" + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" instance MimeType MimeNoContent where mimeType _ = Nothing +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" + +-- | @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 + -- ** MimeRender Class @@ -133,12 +147,23 @@ instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . -- | @BCL.pack@ instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack --- | @P.id@ instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id --- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 --- | @BCL.pack@ -instance MimeRender MimeMultipartFormData String where mimeRender _ = BCL.pack +instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary + +instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData DateTime 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 + +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam -- | @P.Right . P.const NoContent@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty @@ -148,6 +173,8 @@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.emp -- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec -- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined -- ** MimeUnrender Class @@ -180,6 +207,8 @@ 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 +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined +-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined -- ** Request Consumes 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 b1c1399a556..8942406f205 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -17,24 +17,28 @@ Module : SwaggerPetstore.Model module SwaggerPetstore.Model where import Data.Aeson ((.:),(.:!),(.:?),(.=)) -import Data.Text (Text) - -import Data.Aeson (Value) -import Data.ByteString.Lazy (ByteString) import qualified Data.Aeson as A import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Base64.Lazy as BL64 import qualified Data.Data as P (Data, Typeable) import qualified Data.HashMap.Lazy as HM import qualified Data.Map as Map +import qualified Data.Set as Set import qualified Data.Maybe as P import qualified Data.Foldable as P import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH +import qualified Control.DeepSeq as NF +import qualified Data.Ix as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) +import Data.Text (Text) import qualified Data.Time as TI import qualified Data.Time.ISO8601 as TI -import Data.Time (UTCTime) import Control.Applicative ((<|>)) import Control.Applicative (Alternative) @@ -46,11 +50,98 @@ import qualified Prelude as P -- * Models +-- ** 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) + +instance A.FromJSON AdditionalPropertiesClass where + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + AdditionalPropertiesClass + <$> (o .:? "map_property") + <*> (o .:? "map_of_map_property") + +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 + } + + +-- ** Animal +-- | +data Animal = Animal + { animalClassName :: !(Text) -- ^ /Required/ "className" + , animalColor :: !(Maybe Text) -- ^ "color" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Animal where + parseJSON = A.withObject "Animal" $ \o -> + Animal + <$> (o .: "className") + <*> (o .:? "color") + +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 +-- | +data AnimalFarm = AnimalFarm + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON AnimalFarm where + parseJSON = A.withObject "AnimalFarm" $ \o -> + pure 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 -- | --- An uploaded response --- --- Describes the result of uploading an image resource data ApiResponse = ApiResponse { apiResponseCode :: !(Maybe Int) -- ^ "code" , apiResponseType :: !(Maybe Text) -- ^ "type" @@ -67,9 +158,9 @@ instance A.FromJSON ApiResponse where instance A.ToJSON ApiResponse where toJSON ApiResponse {..} = _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage ] @@ -84,12 +175,144 @@ mkApiResponse = } +-- ** ArrayOfArrayOfNumberOnly +-- | +data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ArrayOfArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + ArrayOfArrayOfNumberOnly + <$> (o .:? "ArrayArrayNumber") + +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 +-- | +data ArrayOfNumberOnly = ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + ArrayOfNumberOnly + <$> (o .:? "ArrayNumber") + +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 +-- | +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) + +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") + +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 +-- | +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) + +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") + +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 -- | --- Pet catehgry --- --- A category for a pet data Category = Category { categoryId :: !(Maybe Integer) -- ^ "id" , categoryName :: !(Maybe Text) -- ^ "name" @@ -104,8 +327,8 @@ instance A.FromJSON Category where instance A.ToJSON Category where toJSON Category {..} = _omitNulls - [ "id" .= categoryId - , "name" .= categoryName + [ "id" .= categoryId + , "name" .= categoryName ] @@ -119,17 +342,496 @@ mkCategory = } +-- ** ClassModel +-- | +-- Model for testing model with \"_class\" property +data ClassModel = ClassModel + { classModelClass :: !(Maybe Text) -- ^ "_class" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ClassModel where + parseJSON = A.withObject "ClassModel" $ \o -> + ClassModel + <$> (o .:? "_class") + +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 +-- | +data Client = Client + { clientClient :: !(Maybe Text) -- ^ "client" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Client where + parseJSON = A.withObject "Client" $ \o -> + Client + <$> (o .:? "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 +-- | +data EnumArrays = EnumArrays + { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumArrays where + parseJSON = A.withObject "EnumArrays" $ \o -> + EnumArrays + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") + +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 + } + + +-- ** EnumClass +-- | +data EnumClass = EnumClass + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumClass where + parseJSON = A.withObject "EnumClass" $ \o -> + pure EnumClass + + +instance A.ToJSON EnumClass where + toJSON EnumClass = + _omitNulls + [ + ] + + +-- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) +mkEnumClass + :: EnumClass +mkEnumClass = + EnumClass + { + } + + +-- ** EnumTest +-- | +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" + , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number" + , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON EnumTest where + parseJSON = A.withObject "EnumTest" $ \o -> + EnumTest + <$> (o .:? "enum_string") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") + +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 + } + + +-- ** 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) + +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") + +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 +-- | +data HasOnlyReadOnly = HasOnlyReadOnly + { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" + , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON HasOnlyReadOnly where + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + HasOnlyReadOnly + <$> (o .:? "bar") + <*> (o .:? "foo") + +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _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 +-- | +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "map_of_enum_string" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON MapTest where + parseJSON = A.withObject "MapTest" $ \o -> + MapTest + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") + +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 +-- | +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) + +instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + MixedPropertiesAndAdditionalPropertiesClass + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") + +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 +-- | +-- 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) + +instance A.FromJSON Model200Response where + parseJSON = A.withObject "Model200Response" $ \o -> + Model200Response + <$> (o .:? "name") + <*> (o .:? "class") + +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 +-- | +data ModelList = ModelList + { modelList123List :: !(Maybe Text) -- ^ "123-list" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ModelList where + parseJSON = A.withObject "ModelList" $ \o -> + ModelList + <$> (o .:? "123-list") + +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 +-- | +-- Model for testing reserved words +data ModelReturn = ModelReturn + { modelReturnReturn :: !(Maybe Int) -- ^ "return" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ModelReturn where + parseJSON = A.withObject "ModelReturn" $ \o -> + ModelReturn + <$> (o .:? "return") + +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 +-- | +-- 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) + +instance A.FromJSON Name where + parseJSON = A.withObject "Name" $ \o -> + Name + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") + +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 +-- | +data NumberOnly = NumberOnly + { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON NumberOnly where + parseJSON = A.withObject "NumberOnly" $ \o -> + NumberOnly + <$> (o .:? "JustNumber") + +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 -- | --- Pet Order --- --- An order for a pets from the pet store data Order = Order { orderId :: !(Maybe Integer) -- ^ "id" , orderPetId :: !(Maybe Integer) -- ^ "petId" , orderQuantity :: !(Maybe Int) -- ^ "quantity" - , orderShipDate :: !(Maybe UTCTime) -- ^ "shipDate" + , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) @@ -140,19 +842,19 @@ instance A.FromJSON Order where <$> (o .:? "id") <*> (o .:? "petId") <*> (o .:? "quantity") - <*> (o .:? "shipDate" >>= P.mapM _readDateTime) + <*> (o .:? "shipDate") <*> (o .:? "status") <*> (o .:? "complete") instance A.ToJSON Order where toJSON Order {..} = _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= P.fmap _showDateTime orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete ] @@ -170,12 +872,151 @@ mkOrder = } +-- ** OuterBoolean +-- | +data OuterBoolean = OuterBoolean + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterBoolean where + parseJSON = A.withObject "OuterBoolean" $ \o -> + pure OuterBoolean + + +instance A.ToJSON OuterBoolean where + toJSON OuterBoolean = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) +mkOuterBoolean + :: OuterBoolean +mkOuterBoolean = + OuterBoolean + { + } + + +-- ** 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) + +instance A.FromJSON OuterComposite where + parseJSON = A.withObject "OuterComposite" $ \o -> + OuterComposite + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") + +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 + } + + +-- ** OuterEnum +-- | +data OuterEnum = OuterEnum + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterEnum where + parseJSON = A.withObject "OuterEnum" $ \o -> + pure OuterEnum + + +instance A.ToJSON OuterEnum where + toJSON OuterEnum = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) +mkOuterEnum + :: OuterEnum +mkOuterEnum = + OuterEnum + { + } + + +-- ** OuterNumber +-- | +data OuterNumber = OuterNumber + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterNumber where + parseJSON = A.withObject "OuterNumber" $ \o -> + pure OuterNumber + + +instance A.ToJSON OuterNumber where + toJSON OuterNumber = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) +mkOuterNumber + :: OuterNumber +mkOuterNumber = + OuterNumber + { + } + + +-- ** OuterString +-- | +data OuterString = OuterString + { + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON OuterString where + parseJSON = A.withObject "OuterString" $ \o -> + pure OuterString + + +instance A.ToJSON OuterString where + toJSON OuterString = + _omitNulls + [ + ] + + +-- | Construct a value of type 'OuterString' (by applying it's required fields, if any) +mkOuterString + :: OuterString +mkOuterString = + OuterString + { + } + -- ** Pet -- | --- a Pet --- --- A pet for sale in the pet store data Pet = Pet { petId :: !(Maybe Integer) -- ^ "id" , petCategory :: !(Maybe Category) -- ^ "category" @@ -198,12 +1039,12 @@ instance A.FromJSON Pet where instance A.ToJSON Pet where toJSON Pet {..} = _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus ] @@ -223,12 +1064,66 @@ mkPet petName petPhotoUrls = } +-- ** ReadOnlyFirst +-- | +data ReadOnlyFirst = ReadOnlyFirst + { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" + , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON ReadOnlyFirst where + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + ReadOnlyFirst + <$> (o .:? "bar") + <*> (o .:? "baz") + +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 + } + + +-- ** SpecialModelName +-- | +data SpecialModelName = SpecialModelName + { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON SpecialModelName where + parseJSON = A.withObject "SpecialModelName" $ \o -> + SpecialModelName + <$> (o .:? "$special[property.name]") + +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 -- | --- Pet Tag --- --- A tag for a pet data Tag = Tag { tagId :: !(Maybe Integer) -- ^ "id" , tagName :: !(Maybe Text) -- ^ "name" @@ -243,8 +1138,8 @@ instance A.FromJSON Tag where instance A.ToJSON Tag where toJSON Tag {..} = _omitNulls - [ "id" .= tagId - , "name" .= tagName + [ "id" .= tagId + , "name" .= tagName ] @@ -258,12 +1153,8 @@ mkTag = } - -- ** User -- | --- a User --- --- A User who is purchasing from the pet store data User = User { userId :: !(Maybe Integer) -- ^ "id" , userUsername :: !(Maybe Text) -- ^ "username" @@ -290,14 +1181,14 @@ instance A.FromJSON User where instance A.ToJSON User where toJSON User {..} = _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus ] @@ -317,6 +1208,77 @@ mkUser = } +-- ** Cat +-- | +data Cat = Cat + { catClassName :: !(Text) -- ^ /Required/ "className" + , catColor :: !(Maybe Text) -- ^ "color" + , catDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Cat where + parseJSON = A.withObject "Cat" $ \o -> + Cat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + +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 +-- | +data Dog = Dog + { dogClassName :: !(Text) -- ^ /Required/ "className" + , dogColor :: !(Maybe Text) -- ^ "color" + , dogBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show,P.Eq,P.Typeable) + +instance A.FromJSON Dog where + parseJSON = A.withObject "Dog" $ \o -> + Dog + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") + +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 + } + -- * Utils @@ -343,6 +1305,19 @@ _memptyToNothing x = x -- * DateTime Formatting +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t + -- | @_parseISO8601@ _readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _readDateTime = @@ -350,7 +1325,7 @@ _readDateTime = {-# INLINE _readDateTime #-} -- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} @@ -364,6 +1339,19 @@ _parseISO8601 t = -- * Date Formatting +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t + -- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ _readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = @@ -375,3 +1363,54 @@ _showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index fec52d34259..d2f9e7c9098 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -8,9 +8,9 @@ synopsis: Auto-generated swagger-petstore API Client description: . Client library for calling the swagger-petstore API based on http-client. . - host: petstore.swagger.io + host: petstore.swagger.io:80 . - base path: http://petstore.swagger.io/v2 + base path: http://petstore.swagger.io:80/v2 . apiVersion: 0.0.1 . @@ -42,6 +42,7 @@ library , unordered-containers , aeson >=1.0 && <2.0 , bytestring >=0.10.0 && <0.11 + , base64-bytestring >1.0 && <2.0 , containers >=0.5.0.0 && <0.6 , http-types >=0.8 && <0.10 , http-client >=0.5 && <0.6 @@ -59,6 +60,7 @@ library , safe-exceptions <0.2 , case-insensitive , microlens >= 0.4.3 && <0.5 + , deepseq >= 1.4 && <1.6 exposed-modules: SwaggerPetstore SwaggerPetstore.API diff --git a/samples/client/petstore/haskell-http-client/swagger.json b/samples/client/petstore/haskell-http-client/swagger.json index a16c8a8a14d..305643090e8 100644 --- a/samples/client/petstore/haskell-http-client/swagger.json +++ b/samples/client/petstore/haskell-http-client/swagger.json @@ -1,7 +1,7 @@ { "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.", + "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: \" \\", "version" : "1.0.0", "title" : "Swagger Petstore", "termsOfService" : "http://swagger.io/terms/", @@ -13,7 +13,7 @@ "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, - "host" : "petstore.swagger.io", + "host" : "petstore.swagger.io:80", "basePath" : "/v2", "tags" : [ { "name" : "pet", @@ -363,7 +363,7 @@ } } }, - "/store/order/{orderId}" : { + "/store/order/{order_id}" : { "get" : { "tags" : [ "store" ], "summary" : "Find purchase order by ID", @@ -371,7 +371,7 @@ "operationId" : "getOrderById", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of pet that needs to be fetched", "required" : true, @@ -402,7 +402,7 @@ "operationId" : "deleteOrder", "produces" : [ "application/xml", "application/json" ], "parameters" : [ { - "name" : "orderId", + "name" : "order_id", "in" : "path", "description" : "ID of the order that needs to be deleted", "required" : true, @@ -634,6 +634,428 @@ } } } + }, + "/fake_classname_test" : { + "patch" : { + "tags" : [ "fake_classname_tags 123#$%^" ], + "summary" : "To test class name in snake case", + "operationId" : "testClassname", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + }, + "security" : [ { + "api_key_query" : [ ] + } ] + } + }, + "/fake" : { + "get" : { + "tags" : [ "fake" ], + "summary" : "To test enum parameters", + "description" : "To test enum parameters", + "operationId" : "testEnumParameters", + "consumes" : [ "*/*" ], + "produces" : [ "*/*" ], + "parameters" : [ { + "name" : "enum_form_string_array", + "in" : "formData", + "description" : "Form parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_form_string", + "in" : "formData", + "description" : "Form parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_header_string_array", + "in" : "header", + "description" : "Header parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_header_string", + "in" : "header", + "description" : "Header parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_query_string_array", + "in" : "query", + "description" : "Query parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_query_string", + "in" : "query", + "description" : "Query parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_query_integer", + "in" : "query", + "description" : "Query parameter enum test (double)", + "required" : false, + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -2 ] + }, { + "name" : "enum_query_double", + "in" : "formData", + "description" : "Query parameter enum test (double)", + "required" : false, + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + } ], + "responses" : { + "400" : { + "description" : "Invalid request" + }, + "404" : { + "description" : "Not found" + } + } + }, + "post" : { + "tags" : [ "fake" ], + "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "operationId" : "testEndpointParameters", + "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], + "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], + "parameters" : [ { + "name" : "integer", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "maximum" : 100, + "minimum" : 10 + }, { + "name" : "int32", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "maximum" : 200, + "minimum" : 20, + "format" : "int32" + }, { + "name" : "int64", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "format" : "int64" + }, { + "name" : "number", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "number", + "maximum" : 543.2, + "minimum" : 32.1 + }, { + "name" : "float", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "number", + "maximum" : 987.6, + "format" : "float" + }, { + "name" : "double", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "number", + "maximum" : 123.4, + "minimum" : 67.8, + "format" : "double" + }, { + "name" : "string", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "pattern" : "/[a-z]/i" + }, { + "name" : "pattern_without_delimiter", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "string", + "pattern" : "^[A-Z].*" + }, { + "name" : "byte", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "string", + "format" : "byte" + }, { + "name" : "binary", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "binary" + }, { + "name" : "date", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "date" + }, { + "name" : "dateTime", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "date-time" + }, { + "name" : "password", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "maxLength" : 64, + "minLength" : 10, + "format" : "password" + }, { + "name" : "callback", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "security" : [ { + "http_basic_test" : [ ] + } ] + }, + "patch" : { + "tags" : [ "fake" ], + "summary" : "To test \"client\" model", + "description" : "To test \"client\" model", + "operationId" : "testClientModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + } + } + }, + "/fake/outer/number" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer number types", + "operationId" : "fakeOuterNumberSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input number as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterNumber" + } + } ], + "responses" : { + "200" : { + "description" : "Output number", + "schema" : { + "$ref" : "#/definitions/OuterNumber" + } + } + } + } + }, + "/fake/outer/string" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer string types", + "operationId" : "fakeOuterStringSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input string as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterString" + } + } ], + "responses" : { + "200" : { + "description" : "Output string", + "schema" : { + "$ref" : "#/definitions/OuterString" + } + } + } + } + }, + "/fake/outer/boolean" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer boolean types", + "operationId" : "fakeOuterBooleanSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input boolean as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterBoolean" + } + } ], + "responses" : { + "200" : { + "description" : "Output boolean", + "schema" : { + "$ref" : "#/definitions/OuterBoolean" + } + } + } + } + }, + "/fake/outer/composite" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of object with outer number type", + "operationId" : "fakeOuterCompositeSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input composite as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterComposite" + } + } ], + "responses" : { + "200" : { + "description" : "Output composite", + "schema" : { + "$ref" : "#/definitions/OuterComposite" + } + } + } + } + }, + "/fake/jsonFormData" : { + "get" : { + "tags" : [ "fake" ], + "summary" : "test json serialization of form data", + "description" : "", + "operationId" : "testJsonFormData", + "consumes" : [ "application/json" ], + "parameters" : [ { + "name" : "param", + "in" : "formData", + "description" : "field1", + "required" : true, + "type" : "string" + }, { + "name" : "param2", + "in" : "formData", + "description" : "field2", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation" + } + } + } + }, + "/another-fake/dummy" : { + "patch" : { + "tags" : [ "$another-fake?" ], + "summary" : "To test special tags", + "description" : "To test special tags", + "operationId" : "test_special_tags", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + } + } } }, "securityDefinitions" : { @@ -650,6 +1072,14 @@ "type" : "apiKey", "name" : "api_key", "in" : "header" + }, + "api_key_query" : { + "type" : "apiKey", + "name" : "api_key_query", + "in" : "query" + }, + "http_basic_test" : { + "type" : "basic" } }, "definitions" : { @@ -682,8 +1112,6 @@ "default" : false } }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", "xml" : { "name" : "Order" } @@ -699,8 +1127,6 @@ "type" : "string" } }, - "title" : "Pet catehgry", - "description" : "A category for a pet", "xml" : { "name" : "Category" } @@ -710,7 +1136,8 @@ "properties" : { "id" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "x-is-unique" : true }, "username" : { "type" : "string" @@ -736,8 +1163,6 @@ "description" : "User Status" } }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", "xml" : { "name" : "User" } @@ -753,8 +1178,6 @@ "type" : "string" } }, - "title" : "Pet Tag", - "description" : "A tag for a pet", "xml" : { "name" : "Tag" } @@ -765,7 +1188,8 @@ "properties" : { "id" : { "type" : "integer", - "format" : "int64" + "format" : "int64", + "x-is-unique" : true }, "category" : { "$ref" : "#/definitions/Category" @@ -800,8 +1224,6 @@ "enum" : [ "available", "pending", "sold" ] } }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", "xml" : { "name" : "Pet" } @@ -819,9 +1241,449 @@ "message" : { "type" : "string" } + } + }, + "$special[model.name]" : { + "properties" : { + "$special[property.name]" : { + "type" : "integer", + "format" : "int64" + } + }, + "xml" : { + "name" : "$special[model.name]" + } + }, + "Return" : { + "properties" : { + "return" : { + "type" : "integer", + "format" : "int32" + } + }, + "description" : "Model for testing reserved words", + "xml" : { + "name" : "Return" + } + }, + "Name" : { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "snake_case" : { + "type" : "integer", + "format" : "int32", + "readOnly" : true + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "type" : "integer", + "readOnly" : true + } + }, + "description" : "Model for testing model name same as property name", + "xml" : { + "name" : "Name" + } + }, + "200_response" : { + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "class" : { + "type" : "string" + } + }, + "description" : "Model for testing model name starting with number", + "xml" : { + "name" : "Name" + } + }, + "ClassModel" : { + "properties" : { + "_class" : { + "type" : "string" + } }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" + "description" : "Model for testing model with \"_class\" property" + }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/definitions/Animal" + }, { + "type" : "object", + "properties" : { + "breed" : { + "type" : "string" + } + } + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/definitions/Animal" + }, { + "type" : "object", + "properties" : { + "declawed" : { + "type" : "boolean" + } + } + } ] + }, + "Animal" : { + "type" : "object", + "required" : [ "className" ], + "discriminator" : "className", + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "type" : "string", + "default" : "red" + } + } + }, + "AnimalFarm" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Animal" + } + }, + "format_test" : { + "type" : "object", + "required" : [ "byte", "date", "number", "password" ], + "properties" : { + "integer" : { + "type" : "integer", + "minimum" : 10, + "maximum" : 100 + }, + "int32" : { + "type" : "integer", + "format" : "int32", + "minimum" : 20, + "maximum" : 200 + }, + "int64" : { + "type" : "integer", + "format" : "int64" + }, + "number" : { + "type" : "number", + "minimum" : 32.1, + "maximum" : 543.2 + }, + "float" : { + "type" : "number", + "format" : "float", + "minimum" : 54.3, + "maximum" : 987.6 + }, + "double" : { + "type" : "number", + "format" : "double", + "minimum" : 67.8, + "maximum" : 123.4 + }, + "string" : { + "type" : "string", + "pattern" : "/[a-z]/i" + }, + "byte" : { + "type" : "string", + "format" : "byte", + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + }, + "binary" : { + "type" : "string", + "format" : "binary" + }, + "date" : { + "type" : "string", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "password" : { + "type" : "string", + "format" : "password", + "minLength" : 10, + "maxLength" : 64 + } + } + }, + "EnumClass" : { + "type" : "string", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "default" : "-efg" + }, + "Enum_Test" : { + "type" : "object", + "properties" : { + "enum_string" : { + "type" : "string", + "enum" : [ "UPPER", "lower", "" ] + }, + "enum_integer" : { + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -1 ] + }, + "enum_number" : { + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + }, + "outerEnum" : { + "$ref" : "#/definitions/OuterEnum" + } + } + }, + "AdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "map_of_map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + } + }, + "MixedPropertiesAndAdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "map" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/Animal" + } + } + } + }, + "List" : { + "type" : "object", + "properties" : { + "123-list" : { + "type" : "string" + } + } + }, + "Client" : { + "type" : "object", + "properties" : { + "client" : { + "type" : "string" + } + } + }, + "ReadOnlyFirst" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "baz" : { + "type" : "string" + } + } + }, + "hasOnlyReadOnly" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "foo" : { + "type" : "string", + "readOnly" : true + } + } + }, + "Capitalization" : { + "type" : "object", + "properties" : { + "smallCamel" : { + "type" : "string" + }, + "CapitalCamel" : { + "type" : "string" + }, + "small_Snake" : { + "type" : "string" + }, + "Capital_Snake" : { + "type" : "string" + }, + "SCA_ETH_Flow_Points" : { + "type" : "string" + }, + "ATT_NAME" : { + "type" : "string", + "description" : "Name of the pet\n" + } + } + }, + "MapTest" : { + "type" : "object", + "properties" : { + "map_map_of_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "map_of_enum_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "enum" : [ "UPPER", "lower" ] + } + } + } + }, + "ArrayTest" : { + "type" : "object", + "properties" : { + "array_of_string" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "array_array_of_integer" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "array_array_of_model" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ReadOnlyFirst" + } + } + } + } + }, + "NumberOnly" : { + "type" : "object", + "properties" : { + "JustNumber" : { + "type" : "number" + } + } + }, + "ArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayNumber" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + }, + "ArrayOfArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayArrayNumber" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + } + }, + "EnumArrays" : { + "type" : "object", + "properties" : { + "just_symbol" : { + "type" : "string", + "enum" : [ ">=", "$" ] + }, + "array_enum" : { + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "fish", "crab" ] + } + } + } + }, + "OuterEnum" : { + "type" : "string", + "enum" : [ "placed", "approved", "delivered" ] + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean" + }, + "OuterComposite" : { + "type" : "object", + "properties" : { + "my_number" : { + "$ref" : "#/definitions/OuterNumber" + }, + "my_string" : { + "$ref" : "#/definitions/OuterString" + }, + "my_boolean" : { + "$ref" : "#/definitions/OuterBoolean" + } + } } }, "externalDocs" : { diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index 36663eb5fd3..4d00e2ec92f 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -130,7 +130,7 @@ testPetOps mgr config = readIORef _pet >>= \case Just S.Pet {S.petId = Just petId} -> do let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded petId - `S.applyOptionalParam` S.Name "petName" + `S.applyOptionalParam` S.Name2 "petName" `S.applyOptionalParam` S.Status "pending" updatePetWithFormResponse <- S.dispatchLbs mgr config updatePetWithFormRequest S.MimeJSON NH.responseStatus updatePetWithFormResponse `shouldBe` NH.status200 @@ -156,7 +156,7 @@ testPetOps mgr config = _ -> pendingWith "no petId") $ it "deletePet" $ \petId -> do let deletePetRequest = S.deletePet petId - `S.applyOptionalParam` S.ApiUnderscorekey "api key" + `S.applyOptionalParam` S.ApiKey "api key" deletePetResponse <- S.dispatchLbs mgr config deletePetRequest S.MimeJSON NH.responseStatus deletePetResponse `shouldBe` NH.status200 @@ -185,7 +185,7 @@ testStoreOps mgr config = do (S.mkOrder { S.orderId = Just 21 , S.orderQuantity = Just 210 - , S.orderShipDate = Just now + , S.orderShipDate = Just (S.DateTime now) }) placeOrderResult <- S.dispatchMime mgr config placeOrderRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse placeOrderResult) `shouldBe` NH.status200 diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 850a838576f..87f3d95f95f 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -5,11 +5,11 @@ module Instances where import Data.Text (Text, pack) import Data.Char (isSpace) import Data.List (sort) -import Data.Time.Calendar (Day(..)) -import Data.Time.Clock (UTCTime(..), secondsToDiffTime) +import qualified Data.Time as TI import Test.QuickCheck import qualified Data.HashMap.Strict as HM import qualified Data.Set as Set +import qualified Data.ByteString.Lazy as BL import ApproxEq import SwaggerPetstore.Model @@ -17,13 +17,33 @@ import SwaggerPetstore.Model instance Arbitrary Text where arbitrary = pack <$> arbitrary -instance Arbitrary Day where - arbitrary = ModifiedJulianDay . (2000 +) <$> arbitrary - shrink = (ModifiedJulianDay <$>) . shrink . toModifiedJulianDay +instance Arbitrary TI.Day where + arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary + shrink = (TI.ModifiedJulianDay <$>) . shrink . TI.toModifiedJulianDay -instance Arbitrary UTCTime where +instance Arbitrary TI.UTCTime where arbitrary = - UTCTime <$> arbitrary <*> (secondsToDiffTime <$> choose (0, 86401)) + TI.UTCTime <$> arbitrary <*> (TI.secondsToDiffTime <$> choose (0, 86401)) + +instance Arbitrary BL.ByteString where + arbitrary = BL.pack <$> arbitrary + shrink xs = BL.pack <$> shrink (BL.unpack xs) + +instance Arbitrary ByteArray where + arbitrary = ByteArray <$> arbitrary + shrink (ByteArray xs) = ByteArray <$> shrink xs + +instance Arbitrary Binary where + arbitrary = Binary <$> arbitrary + shrink (Binary xs) = Binary <$> shrink xs + +instance Arbitrary DateTime where + arbitrary = DateTime <$> arbitrary + shrink (DateTime xs) = DateTime <$> shrink xs + +instance Arbitrary Date where + arbitrary = Date <$> arbitrary + shrink (Date xs) = Date <$> shrink xs -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups @@ -37,66 +57,280 @@ hasNoDups = go Set.empty , Set.size s' > Set.size s = go s' xs | otherwise = False -instance ApproxEq Day where +instance ApproxEq TI.Day where (=~) = (==) -- * Models +instance Arbitrary AdditionalPropertiesClass where + arbitrary = + AdditionalPropertiesClass + <$> arbitrary -- additionalPropertiesClassMapProperty :: Maybe (Map.Map String Text) + <*> arbitrary -- additionalPropertiesClassMapOfMapProperty :: Maybe (Map.Map String (Map.Map String Text)) + + +instance Arbitrary Animal where + arbitrary = + Animal + <$> arbitrary -- animalClassName :: Text + <*> arbitrary -- animalColor :: Maybe Text + + +instance Arbitrary AnimalFarm where + arbitrary = + pure AnimalFarm + + instance Arbitrary ApiResponse where arbitrary = ApiResponse - <$> arbitrary -- apiResponseCode :: Maybe Int - <*> arbitrary -- apiResponseType :: Maybe Text - <*> arbitrary -- apiResponseMessage :: Maybe Text + <$> arbitrary -- apiResponseCode :: Maybe Int + <*> arbitrary -- apiResponseType :: Maybe Text + <*> arbitrary -- apiResponseMessage :: Maybe Text + + +instance Arbitrary ArrayOfArrayOfNumberOnly where + arbitrary = + ArrayOfArrayOfNumberOnly + <$> arbitrary -- arrayOfArrayOfNumberOnlyArrayArrayNumber :: Maybe [[Double]] + + +instance Arbitrary ArrayOfNumberOnly where + arbitrary = + ArrayOfNumberOnly + <$> arbitrary -- arrayOfNumberOnlyArrayNumber :: Maybe [Double] + + +instance Arbitrary ArrayTest where + arbitrary = + ArrayTest + <$> arbitrary -- arrayTestArrayOfString :: Maybe [Text] + <*> arbitrary -- arrayTestArrayArrayOfInteger :: Maybe [[Integer]] + <*> arbitrary -- arrayTestArrayArrayOfModel :: Maybe [[ReadOnlyFirst]] + + +instance Arbitrary Capitalization where + arbitrary = + Capitalization + <$> arbitrary -- capitalizationSmallCamel :: Maybe Text + <*> arbitrary -- capitalizationCapitalCamel :: Maybe Text + <*> arbitrary -- capitalizationSmallSnake :: Maybe Text + <*> arbitrary -- capitalizationCapitalSnake :: Maybe Text + <*> arbitrary -- capitalizationScaEthFlowPoints :: Maybe Text + <*> arbitrary -- capitalizationAttName :: Maybe Text instance Arbitrary Category where arbitrary = Category - <$> arbitrary -- categoryId :: Maybe Integer - <*> arbitrary -- categoryName :: Maybe Text + <$> arbitrary -- categoryId :: Maybe Integer + <*> arbitrary -- categoryName :: Maybe Text + + +instance Arbitrary ClassModel where + arbitrary = + ClassModel + <$> arbitrary -- classModelClass :: Maybe Text + + +instance Arbitrary Client where + arbitrary = + Client + <$> arbitrary -- clientClient :: Maybe Text + + +instance Arbitrary EnumArrays where + arbitrary = + EnumArrays + <$> arbitrary -- enumArraysJustSymbol :: Maybe Text + <*> arbitrary -- enumArraysArrayEnum :: Maybe [Text] + + +instance Arbitrary EnumClass where + arbitrary = + pure EnumClass + + +instance Arbitrary EnumTest where + arbitrary = + EnumTest + <$> arbitrary -- enumTestEnumString :: Maybe Text + <*> arbitrary -- enumTestEnumInteger :: Maybe Int + <*> arbitrary -- enumTestEnumNumber :: Maybe Double + <*> arbitrary -- enumTestOuterEnum :: Maybe OuterEnum + + +instance Arbitrary FormatTest where + arbitrary = + FormatTest + <$> arbitrary -- formatTestInteger :: Maybe Int + <*> arbitrary -- formatTestInt32 :: Maybe Int + <*> arbitrary -- formatTestInt64 :: Maybe Integer + <*> arbitrary -- formatTestNumber :: Double + <*> arbitrary -- formatTestFloat :: Maybe Float + <*> arbitrary -- formatTestDouble :: Maybe Double + <*> arbitrary -- formatTestString :: Maybe Text + <*> arbitrary -- formatTestByte :: ByteArray + <*> arbitrary -- formatTestBinary :: Maybe Binary + <*> arbitrary -- formatTestDate :: Date + <*> arbitrary -- formatTestDateTime :: Maybe DateTime + <*> arbitrary -- formatTestUuid :: Maybe Text + <*> arbitrary -- formatTestPassword :: Text + + +instance Arbitrary HasOnlyReadOnly where + arbitrary = + HasOnlyReadOnly + <$> arbitrary -- hasOnlyReadOnlyBar :: Maybe Text + <*> arbitrary -- hasOnlyReadOnlyFoo :: Maybe Text + + +instance Arbitrary MapTest where + arbitrary = + MapTest + <$> arbitrary -- mapTestMapMapOfString :: Maybe (Map.Map String (Map.Map String Text)) + <*> arbitrary -- mapTestMapOfEnumString :: Maybe (Map.Map String Text) + + +instance Arbitrary MixedPropertiesAndAdditionalPropertiesClass where + arbitrary = + MixedPropertiesAndAdditionalPropertiesClass + <$> arbitrary -- mixedPropertiesAndAdditionalPropertiesClassUuid :: Maybe Text + <*> arbitrary -- mixedPropertiesAndAdditionalPropertiesClassDateTime :: Maybe DateTime + <*> arbitrary -- mixedPropertiesAndAdditionalPropertiesClassMap :: Maybe (Map.Map String Animal) + + +instance Arbitrary Model200Response where + arbitrary = + Model200Response + <$> arbitrary -- model200ResponseName :: Maybe Int + <*> arbitrary -- model200ResponseClass :: Maybe Text + + +instance Arbitrary ModelList where + arbitrary = + ModelList + <$> arbitrary -- modelList123List :: Maybe Text + + +instance Arbitrary ModelReturn where + arbitrary = + ModelReturn + <$> arbitrary -- modelReturnReturn :: Maybe Int + + +instance Arbitrary Name where + arbitrary = + Name + <$> arbitrary -- nameName :: Int + <*> arbitrary -- nameSnakeCase :: Maybe Int + <*> arbitrary -- nameProperty :: Maybe Text + <*> arbitrary -- name123Number :: Maybe Int + + +instance Arbitrary NumberOnly where + arbitrary = + NumberOnly + <$> arbitrary -- numberOnlyJustNumber :: Maybe Double instance Arbitrary Order where arbitrary = Order - <$> arbitrary -- orderId :: Maybe Integer - <*> arbitrary -- orderPetId :: Maybe Integer - <*> arbitrary -- orderQuantity :: Maybe Int - <*> arbitrary -- orderShipDate :: Maybe UTCTime - <*> arbitrary -- orderStatus :: Maybe Text - <*> arbitrary -- orderComplete :: Maybe Bool + <$> arbitrary -- orderId :: Maybe Integer + <*> arbitrary -- orderPetId :: Maybe Integer + <*> arbitrary -- orderQuantity :: Maybe Int + <*> arbitrary -- orderShipDate :: Maybe DateTime + <*> arbitrary -- orderStatus :: Maybe Text + <*> arbitrary -- orderComplete :: Maybe Bool + + +instance Arbitrary OuterBoolean where + arbitrary = + pure OuterBoolean + + +instance Arbitrary OuterComposite where + arbitrary = + OuterComposite + <$> arbitrary -- outerCompositeMyNumber :: Maybe OuterNumber + <*> arbitrary -- outerCompositeMyString :: Maybe OuterString + <*> arbitrary -- outerCompositeMyBoolean :: Maybe OuterBoolean +instance Arbitrary OuterEnum where + arbitrary = + pure OuterEnum + + +instance Arbitrary OuterNumber where + arbitrary = + pure OuterNumber + + +instance Arbitrary OuterString where + arbitrary = + pure OuterString + + instance Arbitrary Pet where arbitrary = Pet - <$> arbitrary -- petId :: Maybe Integer - <*> arbitrary -- petCategory :: Maybe Category - <*> arbitrary -- petName :: Text - <*> arbitrary -- petPhotoUrls :: [Text] - <*> arbitrary -- petTags :: Maybe [Tag] - <*> arbitrary -- petStatus :: Maybe Text + <$> arbitrary -- petId :: Maybe Integer + <*> arbitrary -- petCategory :: Maybe Category + <*> arbitrary -- petName :: Text + <*> arbitrary -- petPhotoUrls :: [Text] + <*> arbitrary -- petTags :: Maybe [Tag] + <*> arbitrary -- petStatus :: Maybe Text + + +instance Arbitrary ReadOnlyFirst where + arbitrary = + ReadOnlyFirst + <$> arbitrary -- readOnlyFirstBar :: Maybe Text + <*> arbitrary -- readOnlyFirstBaz :: Maybe Text + + +instance Arbitrary SpecialModelName where + arbitrary = + SpecialModelName + <$> arbitrary -- specialModelNameSpecialPropertyName :: Maybe Integer instance Arbitrary Tag where arbitrary = Tag - <$> arbitrary -- tagId :: Maybe Integer - <*> arbitrary -- tagName :: Maybe Text + <$> arbitrary -- tagId :: Maybe Integer + <*> arbitrary -- tagName :: Maybe Text instance Arbitrary User where arbitrary = User - <$> arbitrary -- userId :: Maybe Integer - <*> arbitrary -- userUsername :: Maybe Text - <*> arbitrary -- userFirstName :: Maybe Text - <*> arbitrary -- userLastName :: Maybe Text - <*> arbitrary -- userEmail :: Maybe Text - <*> arbitrary -- userPassword :: Maybe Text - <*> arbitrary -- userPhone :: Maybe Text - <*> arbitrary -- userUserStatus :: Maybe Int + <$> arbitrary -- userId :: Maybe Integer + <*> arbitrary -- userUsername :: Maybe Text + <*> arbitrary -- userFirstName :: Maybe Text + <*> arbitrary -- userLastName :: Maybe Text + <*> arbitrary -- userEmail :: Maybe Text + <*> arbitrary -- userPassword :: Maybe Text + <*> arbitrary -- userPhone :: Maybe Text + <*> arbitrary -- userUserStatus :: Maybe Int + + +instance Arbitrary Cat where + arbitrary = + Cat + <$> arbitrary -- catClassName :: Text + <*> arbitrary -- catColor :: Maybe Text + <*> arbitrary -- catDeclawed :: Maybe Bool + + +instance Arbitrary Dog where + arbitrary = + Dog + <$> arbitrary -- dogClassName :: Text + <*> arbitrary -- dogColor :: Maybe Text + <*> arbitrary -- dogBreed :: Maybe Text diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index 81253e34028..5ed151beee6 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -19,10 +19,40 @@ main :: IO () main = hspec $ modifyMaxSize (const 10) $ do describe "JSON instances" $ - do propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) + do propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy Animal) + propMimeEq MimeJSON (Proxy :: Proxy AnimalFarm) + propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) + propMimeEq MimeJSON (Proxy :: Proxy Capitalization) propMimeEq MimeJSON (Proxy :: Proxy Category) + propMimeEq MimeJSON (Proxy :: Proxy ClassModel) + propMimeEq MimeJSON (Proxy :: Proxy Client) + propMimeEq MimeJSON (Proxy :: Proxy EnumArrays) + propMimeEq MimeJSON (Proxy :: Proxy EnumClass) + propMimeEq MimeJSON (Proxy :: Proxy EnumTest) + propMimeEq MimeJSON (Proxy :: Proxy FormatTest) + propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) + propMimeEq MimeJSON (Proxy :: Proxy MapTest) + propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy Model200Response) + propMimeEq MimeJSON (Proxy :: Proxy ModelList) + propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) + propMimeEq MimeJSON (Proxy :: Proxy Name) + propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) propMimeEq MimeJSON (Proxy :: Proxy Order) + propMimeEq MimeJSON (Proxy :: Proxy OuterBoolean) + propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) + propMimeEq MimeJSON (Proxy :: Proxy OuterNumber) + propMimeEq MimeJSON (Proxy :: Proxy OuterString) propMimeEq MimeJSON (Proxy :: Proxy Pet) + propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) + propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) propMimeEq MimeJSON (Proxy :: Proxy Tag) propMimeEq MimeJSON (Proxy :: Proxy User) + propMimeEq MimeJSON (Proxy :: Proxy Cat) + propMimeEq MimeJSON (Proxy :: Proxy Dog) From 6e7ad13e1b327b45ce9cdafdfb6c1b46fe8b8b32 Mon Sep 17 00:00:00 2001 From: Benjamin Douglas Date: Sun, 1 Oct 2017 19:54:41 -0700 Subject: [PATCH 094/197] Pre-calculate type aliases before processing models (#6559) A type alias in this context is where a model is simply another name for a primitive type, such as `MyString` in the following model definitions: MyList: type: array items: $ref: '#/definitions/MyString' MyString: type: string It is valid to use a type alias as a property in another object or array model, even if the object/array is defined before the alias is, as in the example above. However, the current alias logic only looks "back" in list of previously defined models, meaning that `MyList` would not know that `MyString` is an alias. This change fixes the incorrect behavior by pre-calculating the list of aliases before any models are processed. It also changes the test endpoint to verify the correct behavior even when an object is defined before an alias it uses. --- .../io/swagger/codegen/DefaultCodegen.java | 36 ++++++++++++++++--- .../languages/AbstractJavaCodegen.java | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 12 +++---- 3 files changed, 38 insertions(+), 12 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 63e42e82f10..6ebda3dccc5 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 @@ -119,7 +119,7 @@ public class DefaultCodegen { // Then translated back during JSON encoding and decoding protected Map specialCharReplacements = new HashMap(); // When a model is an alias for a simple type - protected Map typeAliases = new HashMap<>(); + protected Map typeAliases = null; protected String ignoreFilePathOverride; @@ -1312,6 +1312,10 @@ public CodegenModel fromModel(String name, Model model) { * @return Codegen Model object */ public CodegenModel fromModel(String name, Model model, Map allDefinitions) { + if (typeAliases == null) { + // Only do this once during first call + typeAliases = getAllAliases(allDefinitions); + } CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL); if (reservedWords.contains(name)) { m.name = escapeReservedWord(name); @@ -1327,6 +1331,7 @@ public CodegenModel fromModel(String name, Model model, Map allDe m.modelJson = Json.pretty(model); m.externalDocs = model.getExternalDocs(); m.vendorExtensions = model.getVendorExtensions(); + m.isAlias = typeAliases.containsKey(name); if (model instanceof ModelImpl) { ModelImpl modelImpl = (ModelImpl) model; @@ -1444,10 +1449,6 @@ public CodegenModel fromModel(String name, Model model, Map allDe ModelImpl impl = (ModelImpl) model; if (impl.getType() != null) { Property p = PropertyBuilder.build(impl.getType(), impl.getFormat(), null); - if (!impl.getType().equals("object") && impl.getEnum() == null) { - typeAliases.put(name, impl.getType()); - m.isAlias = true; - } m.dataType = getSwaggerType(p); } if(impl.getEnum() != null && impl.getEnum().size() > 0) { @@ -3166,6 +3167,31 @@ private void addVars(CodegenModel m, List vars, Map getAllAliases(Map allDefinitions) { + Map aliases = new HashMap<>(); + if (allDefinitions != null) { + for (Map.Entry entry : allDefinitions.entrySet()) { + String swaggerName = entry.getKey(); + Model m = entry.getValue(); + if (m instanceof ModelImpl) { + ModelImpl impl = (ModelImpl) m; + if (impl.getType() != null && + !impl.getType().equals("object") && + impl.getEnum() == null) { + aliases.put(swaggerName, impl.getType()); + } + } + } + } + return aliases; + } + /** * Remove characters not suitable for variable or method name from the input and camelize it * diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 64460b2f5fc..a83acffcb25 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -619,7 +619,7 @@ public String getTypeDeclaration(Property p) { @Override public String getAlias(String name) { - if (typeAliases.containsKey(name)) { + if (typeAliases != null && typeAliases.containsKey(name)) { return typeAliases.get(name); } return name; diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 19db9dcbf51..059a5ef4980 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1402,12 +1402,6 @@ definitions: - "placed" - "approved" - "delivered" - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean OuterComposite: type: object properties: @@ -1417,6 +1411,12 @@ definitions: $ref: '#/definitions/OuterString' my_boolean: $ref: '#/definitions/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean externalDocs: description: Find out more about Swagger url: 'http://swagger.io' From 1f4013e7f17396b3de096fe9fd98d2984a1484f7 Mon Sep 17 00:00:00 2001 From: craffael Date: Mon, 2 Oct 2017 05:10:09 +0200 Subject: [PATCH 095/197] [NancyFx] provide option to override package context (#6593) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * Add the option packageContext for nancyFx which allows a better adjustment of the namespace. * run nancyfx-petstore-server.bat --- .../codegen/languages/NancyFXServerCodegen.java | 5 ++++- samples/server/petstore/nancyfx/IO.Swagger.sln | 10 +++++----- .../petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NancyFXServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NancyFXServerCodegen.java index 3d21bed182a..5e577b4c3de 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NancyFXServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/NancyFXServerCodegen.java @@ -45,6 +45,7 @@ public class NancyFXServerCodegen extends AbstractCSharpCodegen { private static final String MODEL_NAMESPACE = "Models"; private static final String IMMUTABLE_OPTION = "immutable"; private static final String USE_BASE_PATH = "writeModulePath"; + private static final String PACKAGE_CONTEXT = "packageContext"; private static final Map> propertyToSwaggerTypeMapping = createPropertyToSwaggerTypeMapping(); @@ -76,6 +77,7 @@ public NancyFXServerCodegen() { addOption(SOURCE_FOLDER, SOURCE_FOLDER_DESC, sourceFolder); addOption(INTERFACE_PREFIX, INTERFACE_PREFIX_DESC, interfacePrefix); addOption(OPTIONAL_PROJECT_GUID,OPTIONAL_PROJECT_GUID_DESC, null); + addOption(PACKAGE_CONTEXT, "Optionally overrides the PackageContext which determines the namespace (namespace=packageName.packageContext). If not set, packageContext will default to basePath.", null); // CLI Switches addSwitch(SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_BY_REQUIRED_FLAG_DESC, sortParamsByRequiredFlag); @@ -335,7 +337,8 @@ public String toModelName(final String name) { @Override public void preprocessSwagger(final Swagger swagger) { - additionalProperties.put("packageContext", sanitizeName(swagger.getBasePath())); + final String packageContextOption = (String) additionalProperties.get(PACKAGE_CONTEXT); + additionalProperties.put("packageContext", packageContextOption == null ? sanitizeName(swagger.getBasePath()) : packageContextOption); final Object basePathOption = additionalProperties.get(USE_BASE_PATH); additionalProperties.put("baseContext", basePathOption == null ? swagger.getBasePath() : "/"); } diff --git a/samples/server/petstore/nancyfx/IO.Swagger.sln b/samples/server/petstore/nancyfx/IO.Swagger.sln index 1e40deb1a14..234aa6fb01c 100644 --- a/samples/server/petstore/nancyfx/IO.Swagger.sln +++ b/samples/server/petstore/nancyfx/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU +{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}.Debug|Any CPU.Build.0 = Debug|Any CPU +{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}.Release|Any CPU.ActiveCfg = Release|Any CPU +{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj index e1577197b6f..6c13d64b402 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} + {DFBD27E3-36EF-45CB-9D6D-EF500915B5CF} Library Properties IO.Swagger.v2 From 44bf1d69cb3ddc483aa533ef01fe790c51bc617d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Bols=C3=B8?= Date: Mon, 2 Oct 2017 05:24:08 +0200 Subject: [PATCH 096/197] Fix for self-referential imports in typescript-angular client (#6450) --- .../codegen/languages/TypeScriptAngularClientCodegen.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 3283bdb3239..cab99599846 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 @@ -270,19 +270,21 @@ public Map postProcessModels(Map objs) { for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); - mo.put("tsImports", toTsImports(cm.imports)); + mo.put("tsImports", toTsImports(cm,cm.imports)); } return result; } - private List> toTsImports(Set imports) { + private List> toTsImports(CodegenModel cm, Set imports) { List> tsImports = new ArrayList<>(); for(String im : imports) { + if(!im.equals(cm.classname)) { HashMap tsImport = new HashMap<>(); tsImport.put("classname", im); tsImport.put("filename", toModelFilename(im)); tsImports.add(tsImport); + } } return tsImports; } From b5200ba12c0b0e35616752864d7be757b85b5f74 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 2 Oct 2017 13:06:45 +0800 Subject: [PATCH 097/197] cache stack in shippable ci --- shippable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shippable.yml b/shippable.yml index a6f111059eb..b377d4005ff 100644 --- a/shippable.yml +++ b/shippable.yml @@ -7,7 +7,7 @@ build: cache: true cache_dir_list: - $HOME/.m2 - - $SHIPPABLE_REPO_DIR/samples/client/petstore/haskell-http-client/.stack-work + - $HOME/.stack ci: - sudo apt-get update -qq # install stack From bb919346bfc473ef75a285b66da88ab63d4f10a8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 2 Oct 2017 13:15:49 +0800 Subject: [PATCH 098/197] cache elixir deps --- shippable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/shippable.yml b/shippable.yml index b377d4005ff..b55496cf569 100644 --- a/shippable.yml +++ b/shippable.yml @@ -8,6 +8,7 @@ build: cache_dir_list: - $HOME/.m2 - $HOME/.stack + - $SHIPPABLE_REPO_DIR/samples/client/petstore/elixir/deps ci: - sudo apt-get update -qq # install stack From 900aad6da485a286cb4bff0e89d7c8912742756a Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 2 Oct 2017 21:14:09 +0800 Subject: [PATCH 099/197] add links to blog posts in techium.jp --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 96af0c1ddc7..854954774a5 100644 --- a/README.md +++ b/README.md @@ -890,6 +890,8 @@ Presentations/Videos/Tutorials/Books - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) +- 2017/09/08 - [Swagger Codegen で自動生成したクライアントSDKを使う(iOS編)](http://blog.techium.jp/entry/2017/09/08/071650) by [kfurue](http://profile.hatena.ne.jp/kfurue/) +- 2017/09/09 - [Swagger Codegen で自動生成したクライアントSDKを使う(RxSwift 編)](http://blog.techium.jp/entry/2017/09/09/113003) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) From 28a5b74dbf313529a2fc697d46e9ed870cfd6a30 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 2 Oct 2017 23:52:01 +0800 Subject: [PATCH 100/197] add partial header to haskell http client (#6606) --- .../haskell-http-client/API.mustache | 1 + .../haskell-http-client/Client.mustache | 1 + .../haskell-http-client/Lens.mustache | 3 +- .../haskell-http-client/LoggingKatip.mustache | 1 + .../LoggingMonadLogger.mustache | 1 + .../haskell-http-client/MimeTypes.mustache | 2 +- .../haskell-http-client/Model.mustache | 3 +- .../haskell-http-client/TopLevel.mustache | 1 + .../partial_header.mustache | 17 ++++++++++ .../lib/SwaggerPetstore.hs | 10 ++++++ .../lib/SwaggerPetstore/API.hs | 10 ++++++ .../lib/SwaggerPetstore/Client.hs | 10 ++++++ .../lib/SwaggerPetstore/Lens.hs | 10 ++++++ .../lib/SwaggerPetstore/Logging.hs | 10 ++++++ .../lib/SwaggerPetstore/MimeTypes.hs | 9 +++++ .../lib/SwaggerPetstore/Model.hs | 12 ++++++- .../petstore/haskell-http-client/swagger.json | 34 +++++++++---------- 17 files changed, 114 insertions(+), 21 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache 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 f5869983182..06cad2f8d0c 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,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.API -} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index c56f377451b..c2e6655e790 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.Client -} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache index a10d79faf99..458c33eb96b 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.Lens -} @@ -43,4 +44,4 @@ type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t {{/vars}} {{/model}} -{{/models}} \ No newline at end of file +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache index 470df933b09..3b3877a41ce 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.Logging Katip Logging functions diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache index a9737b70e01..e0a15329c13 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.Logging monad-logger Logging functions 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 18a4c99cf3c..b111a1da1e5 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 @@ -1,4 +1,4 @@ - +{{>partial_header}} {-| Module : {{title}}.MimeTypes -} 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 26ce58b91b7..3cf877fd2ce 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 @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}}.Model -} @@ -240,4 +241,4 @@ _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStric _showBinaryBase64 :: Binary -> Text _showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} \ No newline at end of file +{-# INLINE _showBinaryBase64 #-} 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 83e2c8ed979..2522a571fba 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 @@ -1,3 +1,4 @@ +{{>partial_header}} {-| Module : {{title}} -} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache new file mode 100644 index 00000000000..7fc0581b639 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache @@ -0,0 +1,17 @@ +{- + {{#appName}} + {{{appName}}} + + {{/appName}} + {{#appDescription}} + {{{appDescription}}} + + {{/appDescription}} + {{#version}} + OpenAPI spec version: {{{version}}} + {{/version}} + {{#infoEmail}} + Contact: {{{infoEmail}}} + {{/infoEmail}} + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index cb5e7c140c1..6e1700d709b 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore -} 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 c0408b8fb9e..320722d1a21 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore.API -} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index b68ce51a7bd..041f7a11013 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore.Client -} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs index b645d189d7a..105cb19b0b2 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore.Lens -} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs index 7ab4bac9186..2842b5ee15f 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore.Logging Katip Logging functions 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 d7abb7681bb..1eac4d19189 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs @@ -1,3 +1,12 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} {-| Module : SwaggerPetstore.MimeTypes 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 8942406f205..24e45353039 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -1,3 +1,13 @@ +{- + 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: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + {-| Module : SwaggerPetstore.Model -} @@ -1413,4 +1423,4 @@ _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStric _showBinaryBase64 :: Binary -> Text _showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} \ No newline at end of file +{-# INLINE _showBinaryBase64 #-} diff --git a/samples/client/petstore/haskell-http-client/swagger.json b/samples/client/petstore/haskell-http-client/swagger.json index 305643090e8..4af4303cdb8 100644 --- a/samples/client/petstore/haskell-http-client/swagger.json +++ b/samples/client/petstore/haskell-http-client/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_query_string", @@ -1662,15 +1662,6 @@ "type" : "string", "enum" : [ "placed", "approved", "delivered" ] }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" - }, "OuterComposite" : { "type" : "object", "properties" : { @@ -1684,6 +1675,15 @@ "$ref" : "#/definitions/OuterBoolean" } } + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean" } }, "externalDocs" : { From 1896e9664862b32137f0d57e01e2e5e052c814ff Mon Sep 17 00:00:00 2001 From: craffael Date: Tue, 3 Oct 2017 09:14:28 +0200 Subject: [PATCH 101/197] [nancyfx] fix interface prefix (#6595) * Retrofit2: Return ResponseBody if response if file. Until now -------------------- If a swagger endpoint returned a file (e.g. an image), then the Retrofit2 template has choosen the return type java.io.File. However, retrofit cannot deal with this and throws a com.google.gson.stream.MalformedJsonException. New: ------------------- If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint will return a okhttp3.ResponseBody which can be used to retrieve the file. * fix Interface Prefix --- modules/swagger-codegen/src/main/resources/nancyfx/api.mustache | 2 +- samples/server/petstore/nancyfx/IO.Swagger.sln | 2 +- .../server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache b/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache index a2634d9ab81..038977fb6d4 100644 --- a/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache +++ b/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache @@ -22,7 +22,7 @@ namespace {{packageName}}.{{packageContext}}.Modules /// Sets up HTTP methods mappings. /// /// Service handling requests - public {{classname}}Module({{classname}}Service service) : base("{{{baseContext}}}") + public {{classname}}Module({{interfacePrefix}}{{classname}}Service service) : base("{{{baseContext}}}") { {{#operation}} {{httpMethod}}["{{{path}}}"] = parameters => { diff --git a/samples/server/petstore/nancyfx/IO.Swagger.sln b/samples/server/petstore/nancyfx/IO.Swagger.sln index 234aa6fb01c..680fe56caa0 100644 --- a/samples/server/petstore/nancyfx/IO.Swagger.sln +++ b/samples/server/petstore/nancyfx/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{DFBD27E3-36EF-45CB-9D6D-EF500915B5CF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{19B8107D-38E2-4D32-B74F-C45470A9FCA3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj index 6c13d64b402..b7bb26dd9df 100644 --- a/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/nancyfx/src/IO.Swagger/IO.Swagger.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - {DFBD27E3-36EF-45CB-9D6D-EF500915B5CF} + {19B8107D-38E2-4D32-B74F-C45470A9FCA3} Library Properties IO.Swagger.v2 From 74e31699da6a6818abcfc1917516c88dcc492654 Mon Sep 17 00:00:00 2001 From: Pierre Deman Date: Tue, 3 Oct 2017 10:58:27 +0200 Subject: [PATCH 102/197] CsharpDotNet2Client - Use clientPackage in additionalProperties (#6581) * CsharpDotNet2Client - Use clientPackage in additionalProperties if provided * Give execution rights for csharp-dotnet2-petstore.sh * Fix generation of C#.net2 apiPackage, modelPackage, clientPackage * Fix modelPackage property missing when generating models * Initialize clientPackage in constructor --- bin/csharp-dotnet2-petstore.sh | 0 .../io/swagger/codegen/DefaultGenerator.java | 157 +++++++----------- .../languages/CsharpDotNet2ClientCodegen.java | 25 +-- .../CsharpDotNet2/ApiClient.mustache | 2 +- .../CsharpDotNet2/ApiException.mustache | 2 +- .../CsharpDotNet2/Configuration.mustache | 2 +- .../resources/CsharpDotNet2/README.mustache | 8 +- .../main/resources/CsharpDotNet2/api.mustache | 6 +- .../resources/CsharpDotNet2/api_doc.mustache | 6 +- .../resources/CsharpDotNet2/model.mustache | 2 +- .../CsharpDotNet2/model_doc.mustache | 2 +- .../Lib/SwaggerClient/README.md | 4 +- .../Lib/SwaggerClient/docs/PetApi.md | 2 +- .../Lib/SwaggerClient/docs/StoreApi.md | 2 +- .../Lib/SwaggerClient/docs/UserApi.md | 2 +- 15 files changed, 92 insertions(+), 130 deletions(-) mode change 100644 => 100755 bin/csharp-dotnet2-petstore.sh diff --git a/bin/csharp-dotnet2-petstore.sh b/bin/csharp-dotnet2-petstore.sh old mode 100644 new mode 100755 diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 5a73e826ff5..ab85cf0c4fe 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -1,54 +1,24 @@ package io.swagger.codegen; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; - import io.swagger.codegen.ignore.CodegenIgnoreProcessor; import io.swagger.codegen.languages.AbstractJavaCodegen; import io.swagger.codegen.utils.ImplementationVersion; -import io.swagger.models.ComposedModel; -import io.swagger.models.Contact; -import io.swagger.models.Info; -import io.swagger.models.License; -import io.swagger.models.Model; -import io.swagger.models.Operation; -import io.swagger.models.Path; -import io.swagger.models.RefModel; -import io.swagger.models.SecurityRequirement; -import io.swagger.models.Swagger; -import io.swagger.models.Tag; +import io.swagger.models.*; import io.swagger.models.auth.OAuth2Definition; import io.swagger.models.auth.SecuritySchemeDefinition; import io.swagger.models.parameters.Parameter; import io.swagger.util.Json; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.util.*; public class DefaultGenerator extends AbstractGenerator implements Generator { protected final Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class); @@ -75,16 +45,16 @@ public Generator opts(ClientOptInput opts) { this.config.additionalProperties().putAll(opts.getOpts().getProperties()); String ignoreFileLocation = this.config.getIgnoreFilePathOverride(); - if(ignoreFileLocation != null) { + if (ignoreFileLocation != null) { final File ignoreFile = new File(ignoreFileLocation); - if(ignoreFile.exists() && ignoreFile.canRead()) { + if (ignoreFile.exists() && ignoreFile.canRead()) { this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); } else { LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); } } - if(this.ignoreProcessor == null) { + if (this.ignoreProcessor == null) { this.ignoreProcessor = new CodegenIgnoreProcessor(this.config.getOutputDir()); } @@ -102,7 +72,7 @@ private String getScheme() { return scheme; } - private String getHost(){ + private String getHost() { StringBuilder hostBuilder = new StringBuilder(); hostBuilder.append(getScheme()); hostBuilder.append("://"); @@ -120,30 +90,30 @@ private String getHost(){ private void configureGeneratorProperties() { // allows generating only models by specifying a CSV of models to generate, or empty for all - generateApis = System.getProperty("apis") != null ? true:null; - generateModels = System.getProperty("models") != null ? true: null; - generateSupportingFiles = System.getProperty("supportingFiles") != null ? true:null; + generateApis = System.getProperty("apis") != null ? true : null; + generateModels = System.getProperty("models") != null ? true : null; + generateSupportingFiles = System.getProperty("supportingFiles") != null ? true : null; if (generateApis == null && generateModels == null && generateSupportingFiles == null) { // no specifics are set, generate everything generateApis = generateModels = generateSupportingFiles = true; } else { - if(generateApis == null) { + if (generateApis == null) { generateApis = false; } - if(generateModels == null) { + if (generateModels == null) { generateModels = false; } - if(generateSupportingFiles == null) { + if (generateSupportingFiles == null) { generateSupportingFiles = false; } } // model/api tests and documentation options rely on parent generate options (api or model) and no other options. // They default to true in all scenarios and can only be marked false explicitly - generateModelTests = System.getProperty("modelTests") != null ? Boolean.valueOf(System.getProperty("modelTests")): true; - generateModelDocumentation = System.getProperty("modelDocs") != null ? Boolean.valueOf(System.getProperty("modelDocs")):true; - generateApiTests = System.getProperty("apiTests") != null ? Boolean.valueOf(System.getProperty("apiTests")): true; - generateApiDocumentation = System.getProperty("apiDocs") != null ? Boolean.valueOf(System.getProperty("apiDocs")):true; + generateModelTests = System.getProperty("modelTests") != null ? Boolean.valueOf(System.getProperty("modelTests")) : true; + generateModelDocumentation = System.getProperty("modelDocs") != null ? Boolean.valueOf(System.getProperty("modelDocs")) : true; + generateApiTests = System.getProperty("apiTests") != null ? Boolean.valueOf(System.getProperty("apiTests")) : true; + generateApiDocumentation = System.getProperty("apiDocs") != null ? Boolean.valueOf(System.getProperty("apiDocs")) : true; // Additional properties added for tests to exclude references in project related files @@ -153,7 +123,7 @@ private void configureGeneratorProperties() { config.additionalProperties().put(CodegenConstants.GENERATE_API_DOCS, generateApiDocumentation); config.additionalProperties().put(CodegenConstants.GENERATE_MODEL_DOCS, generateModelDocumentation); - if(!generateApiTests && !generateModelTests) { + if (!generateApiTests && !generateModelTests) { config.additionalProperties().put(CodegenConstants.EXCLUDE_TESTS, true); } if (System.getProperty("debugSwagger") != null) { @@ -190,7 +160,7 @@ private void configureSwaggerInfo() { LOGGER.error("Missing required field info version. Default appVersion set to 1.0.0"); config.additionalProperties().put("appVersion", "1.0.0"); } - + if (StringUtils.isEmpty(info.getDescription())) { // set a default description if none if provided config.additionalProperties().put("appDescription", @@ -228,7 +198,7 @@ private void configureSwaggerInfo() { } } - private void generateModelTests(List files, Map models, String modelName) throws IOException{ + private void generateModelTests(List files, Map models, String modelName) throws IOException { // to generate model test files for (String templateName : config.modelTestTemplateFiles().keySet()) { String suffix = config.modelTestTemplateFiles().get(templateName); @@ -273,15 +243,15 @@ private void generateModels(List files, List allModels) { String modelNames = System.getProperty("models"); Set modelsToGenerate = null; - if(modelNames != null && !modelNames.isEmpty()) { + if (modelNames != null && !modelNames.isEmpty()) { modelsToGenerate = new HashSet(Arrays.asList(modelNames.split(","))); } Set modelKeys = definitions.keySet(); - if(modelsToGenerate != null && !modelsToGenerate.isEmpty()) { + if (modelsToGenerate != null && !modelsToGenerate.isEmpty()) { Set updatedKeys = new HashSet(); - for(String m : modelKeys) { - if(modelsToGenerate.contains(m)) { + for (String m : modelKeys) { + if (modelsToGenerate.contains(m)) { updatedKeys.add(m); } } @@ -289,7 +259,7 @@ private void generateModels(List files, List allModels) { } // store all processed models - Map allProcessedModels = new TreeMap(new Comparator() { + Map allProcessedModels = new TreeMap(new Comparator() { @Override public int compare(String o1, String o2) { Model model1 = definitions.get(o1); @@ -330,7 +300,7 @@ private Model getParent(Model model) { return definitions.get(interf.getSimpleRef()); } } - if(parent != null) { + if (parent != null) { return definitions.get(parent.getReference()); } } @@ -343,7 +313,7 @@ private Model getParent(Model model) { for (String name : modelKeys) { try { //don't generate models that have an import mapping - if(config.importMapping().containsKey(name)) { + if (config.importMapping().containsKey(name)) { LOGGER.info("Model " + name + " not imported due to import mapping"); continue; } @@ -363,11 +333,12 @@ private Model getParent(Model model) { allProcessedModels = config.postProcessAllModels(allProcessedModels); // generate files based on processed models - for (String modelName: allProcessedModels.keySet()) { - Map models = (Map)allProcessedModels.get(modelName); + for (String modelName : allProcessedModels.keySet()) { + Map models = (Map) allProcessedModels.get(modelName); + models.put("modelPackage", config.modelPackage()); try { //don't generate models that have an import mapping - if(config.importMapping().containsKey(modelName)) { + if (config.importMapping().containsKey(modelName)) { continue; } Map modelTemplate = (Map) ((List) models.get("models")).get(0); @@ -389,14 +360,14 @@ private Model getParent(Model model) { continue; } File written = processTemplateToFile(models, templateName, filename); - if(written != null) { + if (written != null) { files.add(written); } } - if(generateModelTests) { + if (generateModelTests) { generateModelTests(files, models, modelName); } - if(generateModelDocumentation) { + if (generateModelDocumentation) { // to generate model documentation files generateModelDocumentation(files, models, modelName); } @@ -418,13 +389,13 @@ private void generateApis(List files, List allOperations, List> paths = processPaths(swagger.getPaths()); Set apisToGenerate = null; String apiNames = System.getProperty("apis"); - if(apiNames != null && !apiNames.isEmpty()) { + if (apiNames != null && !apiNames.isEmpty()) { apisToGenerate = new HashSet(Arrays.asList(apiNames.split(","))); } - if(apisToGenerate != null && !apisToGenerate.isEmpty()) { + if (apisToGenerate != null && !apisToGenerate.isEmpty()) { Map> updatedPaths = new TreeMap>(); - for(String m : paths.keySet()) { - if(apisToGenerate.contains(m)) { + for (String m : paths.keySet()) { + if (apisToGenerate.contains(m)) { updatedPaths.put(m, paths.get(m)); } } @@ -445,6 +416,7 @@ public int compare(CodegenOperation one, CodegenOperation another) { operation.put("basePathWithoutHost", basePathWithoutHost); operation.put("contextPath", contextPath); operation.put("baseName", tag); + operation.put("apiPackage", config.apiPackage()); operation.put("modelPackage", config.modelPackage()); operation.putAll(config.additionalProperties()); operation.put("classname", config.toApiName(tag)); @@ -452,7 +424,7 @@ public int compare(CodegenOperation one, CodegenOperation another) { operation.put("importPath", config.toApiImport(tag)); operation.put("classFilename", config.toApiFilename(tag)); - if(!config.vendorExtensions().isEmpty()) { + if (!config.vendorExtensions().isEmpty()) { operation.put("vendorExtensions", config.vendorExtensions()); } @@ -482,12 +454,12 @@ public int compare(CodegenOperation one, CodegenOperation another) { } File written = processTemplateToFile(operation, templateName, filename); - if(written != null) { + if (written != null) { files.add(written); } } - if(generateApiTests) { + if (generateApiTests) { // to generate api test files for (String templateName : config.apiTestTemplateFiles().keySet()) { String filename = config.apiTestFilename(templateName, tag); @@ -505,7 +477,7 @@ public int compare(CodegenOperation one, CodegenOperation another) { } - if(generateApiDocumentation) { + if (generateApiDocumentation) { // to generate api documentation files for (String templateName : config.apiDocTemplateFiles().keySet()) { String filename = config.apiDocFilename(templateName, tag); @@ -538,7 +510,7 @@ private void generateSupportingFiles(List files, Map bundl } Set supportingFilesToGenerate = null; String supportingFiles = System.getProperty("supportingFiles"); - if(supportingFiles!= null && !supportingFiles.isEmpty()) { + if (supportingFiles != null && !supportingFiles.isEmpty()) { supportingFilesToGenerate = new HashSet(Arrays.asList(supportingFiles.split(","))); } @@ -558,20 +530,20 @@ private void generateSupportingFiles(List files, Map bundl continue; } String templateFile; - if( support instanceof GlobalSupportingFile) { - templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile; + if (support instanceof GlobalSupportingFile) { + templateFile = config.getCommonTemplateDir() + File.separator + support.templateFile; } else { templateFile = getFullTemplateFile(config, support.templateFile); } boolean shouldGenerate = true; - if(supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { + if (supportingFilesToGenerate != null && !supportingFilesToGenerate.isEmpty()) { shouldGenerate = supportingFilesToGenerate.contains(support.destinationFilename); } - if (!shouldGenerate){ + if (!shouldGenerate) { continue; } - if(ignoreProcessor.allowsFile(new File(outputFilename))) { + if (ignoreProcessor.allowsFile(new File(outputFilename))) { if (templateFile.endsWith("mustache")) { String template = readTemplate(templateFile); Mustache.Compiler compiler = Mustache.compiler(); @@ -623,8 +595,8 @@ public Reader getTemplate(String name) { final String swaggerCodegenIgnore = ".swagger-codegen-ignore"; String ignoreFileNameTarget = config.outputFolder() + File.separator + swaggerCodegenIgnore; File ignoreFile = new File(ignoreFileNameTarget); - if(!ignoreFile.exists()) { - String ignoreFileNameSource = File.separator + config.getCommonTemplateDir() + File.separator + swaggerCodegenIgnore; + if (!ignoreFile.exists()) { + String ignoreFileNameSource = File.separator + config.getCommonTemplateDir() + File.separator + swaggerCodegenIgnore; String ignoreFileContents = readResourceContents(ignoreFileNameSource); try { writeToFile(ignoreFileNameTarget, ignoreFileContents); @@ -678,7 +650,7 @@ private Map buildSupportFileBundle(List allOperations, L bundle.put("swagger", this.swagger); bundle.put("basePath", basePath); - bundle.put("basePathWithoutHost",basePathWithoutHost); + bundle.put("basePathWithoutHost", basePathWithoutHost); bundle.put("scheme", getScheme()); bundle.put("contextPath", contextPath); bundle.put("apiInfo", apis); @@ -738,7 +710,7 @@ public List generate() { private File processTemplateToFile(Map templateData, String templateName, String outputFilename) throws IOException { String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); - if(ignoreProcessor.allowsFile(new File(adjustedOutputFilename))) { + if (ignoreProcessor.allowsFile(new File(adjustedOutputFilename))) { String templateFile = getFullTemplateFile(config, templateName); String template = readTemplate(templateFile); Mustache.Compiler compiler = Mustache.compiler(); @@ -762,7 +734,7 @@ public Reader getTemplate(String name) { } private static void processMimeTypes(List mimeTypeList, Map operation, String source) { - if (mimeTypeList == null || mimeTypeList.isEmpty()){ + if (mimeTypeList == null || mimeTypeList.isEmpty()) { return; } List> c = new ArrayList>(); @@ -876,7 +848,7 @@ private void processOperation(String resourcePath, String httpMethod, Operation continue; } Map authMethods = new HashMap(); - for (Map> security: securities) { + for (Map> security : securities) { for (String securityName : security.keySet()) { SecuritySchemeDefinition securityDefinition = swagger.getSecurityDefinitions().get(securityName); if (securityDefinition == null) { @@ -905,8 +877,7 @@ private void processOperation(String resourcePath, String httpMethod, Operation codegenOperation.authMethods = config.fromSecurity(authMethods); codegenOperation.hasAuthMethods = true; } - } - catch (Exception ex) { + } catch (Exception ex) { String msg = "Could not process operation:\n" // + " Tag: " + tag + "\n"// + " Operation: " + operation.getOperationId() + "\n" // @@ -1017,7 +988,7 @@ private Map processModels(CodegenConfig config, Map> imports = new ArrayList>(); - for(String s: importSet) { + for (String s : importSet) { Map item = new HashMap(); item.put("import", s); imports.add(item); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java index 73914ea5376..125b688858f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java @@ -1,26 +1,16 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenType; -import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; -import io.swagger.codegen.CliOption; - -import org.apache.commons.lang3.StringUtils; import java.io.File; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; public class CsharpDotNet2ClientCodegen extends AbstractCSharpCodegen { public static final String CLIENT_PACKAGE = "clientPackage"; protected String clientPackage = "IO.Swagger.Client"; - protected String apiDocPath = "docs/"; + protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; public CsharpDotNet2ClientCodegen() { @@ -33,8 +23,9 @@ public CsharpDotNet2ClientCodegen() { modelTemplateFiles.put("model.mustache", ".cs"); apiTemplateFiles.put("api.mustache", ".cs"); - setApiPackage("IO.Swagger.Api"); - setModelPackage("IO.Swagger.Model"); + setApiPackage(packageName + ".Api"); + setModelPackage(packageName + ".Model"); + setClientPackage(packageName + ".Client"); setSourceFolder("src" + File.separator + "main" + File.separator + this.getName()); modelDocTemplateFiles.put("model_doc.mustache", ".md"); @@ -57,7 +48,7 @@ public void processOpts() { super.processOpts(); if (additionalProperties.containsKey(CLIENT_PACKAGE)) { - this.setClientPackage((String) additionalProperties.get(CLIENT_PACKAGE)); + setClientPackage((String) additionalProperties.get(CLIENT_PACKAGE)); } else { additionalProperties.put(CLIENT_PACKAGE, getClientPackage()); } @@ -90,8 +81,8 @@ public String modelPackage() { return packageName + ".Model"; } - public String getClientPackage(){ - return packageName + ".Client"; + public String getClientPackage() { + return clientPackage; } public void setClientPackage(String clientPackage) { diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache index 5bd93d066a1..4c8d13c5a99 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache @@ -11,7 +11,7 @@ using Newtonsoft.Json; using RestSharp; using RestSharp.Extensions; -namespace {{packageName}}.Client +namespace {{clientPackage}} { /// /// API client is mainly responible for making the HTTP call to the API backend. diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache index dd618e0a99c..1bc6d7c5a6f 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache @@ -1,6 +1,6 @@ using System; -namespace {{packageName}}.Client { +namespace {{clientPackage}} { /// /// API Exception /// diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache index 56f4e617556..a175367ab74 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache @@ -5,7 +5,7 @@ using System.IO; using System.Linq; using System.Text; -namespace {{packageName}}.Client +namespace {{clientPackage}} { /// /// Represents a set of configuration settings diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache index 89ed69c1df8..89fa3938d97 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache @@ -41,9 +41,9 @@ Run the following command to generate the DLL Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: ```csharp -using {{packageName}}.{{apiPackage}}; -using {{packageName}}.Client; -using {{packageName}}.{{modelPackage}}; +using {{apiPackage}}; +using {{clientPackage}}; +using {{modelPackage}}; ``` ## Getting Started @@ -52,7 +52,7 @@ using {{packageName}}.{{modelPackage}}; using System; using System.Diagnostics; using {{apiPackage}}; -using {{packageName}}.Client; +using {{clientPackage}}; using {{modelPackage}}; namespace Example diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache index fc7583b182c..4a7ccbbe378 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using RestSharp; -using {{packageName}}.Client; -{{#hasImport}}using {{packageName}}.Model; +using {{clientPackage}}; +{{#hasImport}}using {{modelPackage}}; {{/hasImport}} -namespace {{packageName}}.Api +namespace {{apiPackage}} { {{#operations}} /// diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache index c8b447c3a44..d8a074e11f3 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache @@ -1,4 +1,4 @@ -# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +# {{apiPackage}}.{{classname}}{{#description}} {{description}}{{/description}} All URIs are relative to *{{{basePath}}}* @@ -22,8 +22,8 @@ Method | HTTP request | Description ```csharp using System; using System.Diagnostics; -using {{packageName}}.Api; -using {{packageName}}.Client; +using {{apiPackage}}; +using {{clientPackage}}; using {{modelPackage}}; namespace Example diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache index 3e6e32320e7..61dbfe63909 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache @@ -7,7 +7,7 @@ using Newtonsoft.Json; {{#models}} {{#model}} -namespace {{packageName}}.Model { +namespace {{modelPackage}} { /// /// {{description}} diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache index aff3e7e0d1e..e7c3ed75934 100644 --- a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache @@ -1,6 +1,6 @@ {{#models}} {{#model}} -# {{{packageName}}}.Model.{{{classname}}} +# {{{modelPackage}}}.{{{classname}}} ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md index acdc92a185e..a9d7285c925 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md @@ -28,9 +28,9 @@ Run the following command to generate the DLL Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: ```csharp -using IO.Swagger.IO.Swagger.Api; +using IO.Swagger.Api; using IO.Swagger.Client; -using IO.Swagger.IO.Swagger.Model; +using IO.Swagger.Model; ``` ## Getting Started diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md index 2487b1e5fdd..e67561a8b0e 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md @@ -1,4 +1,4 @@ -# IO.Swagger..PetApi +# IO.Swagger.Api.PetApi All URIs are relative to *http://petstore.swagger.io/v2* diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md index 256e46f5f15..24d03a779c5 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md @@ -1,4 +1,4 @@ -# IO.Swagger..StoreApi +# IO.Swagger.Api.StoreApi All URIs are relative to *http://petstore.swagger.io/v2* diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md index 6b14a5a4373..e016a7a5e30 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md @@ -1,4 +1,4 @@ -# IO.Swagger..UserApi +# IO.Swagger.Api.UserApi All URIs are relative to *http://petstore.swagger.io/v2* From f62b81fdd0a3a2edfa572a33609223ba2c2fb131 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 3 Oct 2017 20:34:19 +0800 Subject: [PATCH 103/197] add link to ntt presentation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 854954774a5..c6c18c05530 100644 --- a/README.md +++ b/README.md @@ -895,6 +895,7 @@ Presentations/Videos/Tutorials/Books - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) +- 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) # Swagger Codegen Core Team From 5175281f32409ada8298740213f87b85f28f4c56 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 3 Oct 2017 23:46:56 +0800 Subject: [PATCH 104/197] rename silex-PHP to php-silex (#6612) --- ...petstore-server.sh => php-silex-petstore-server.sh} | 2 +- bin/windows/php-silex-petstore.bat | 10 ++++++++++ .../swagger/codegen/languages/SilexServerCodegen.java | 8 ++++---- .../src/main/resources/{silex => php-silex}/.htaccess | 0 .../resources/{silex => php-silex}/README.mustache | 0 .../main/resources/{silex => php-silex}/composer.json | 0 .../main/resources/{silex => php-silex}/index.mustache | 0 .../{silex => php-silex}/.swagger-codegen-ignore | 0 .../server/petstore/php-silex/.swagger-codegen/VERSION | 1 + .../{silex => php-silex}/SwaggerServer/.htaccess | 0 .../{silex => php-silex}/SwaggerServer/README.md | 0 .../{silex => php-silex}/SwaggerServer/composer.json | 0 .../{silex => php-silex}/SwaggerServer/index.php | 0 samples/server/petstore/silex/.swagger-codegen/VERSION | 1 - 14 files changed, 16 insertions(+), 6 deletions(-) rename bin/{silex-petstore-server.sh => php-silex-petstore-server.sh} (78%) create mode 100644 bin/windows/php-silex-petstore.bat rename modules/swagger-codegen/src/main/resources/{silex => php-silex}/.htaccess (100%) rename modules/swagger-codegen/src/main/resources/{silex => php-silex}/README.mustache (100%) rename modules/swagger-codegen/src/main/resources/{silex => php-silex}/composer.json (100%) rename modules/swagger-codegen/src/main/resources/{silex => php-silex}/index.mustache (100%) rename samples/server/petstore/{silex => php-silex}/.swagger-codegen-ignore (100%) create mode 100644 samples/server/petstore/php-silex/.swagger-codegen/VERSION rename samples/server/petstore/{silex => php-silex}/SwaggerServer/.htaccess (100%) rename samples/server/petstore/{silex => php-silex}/SwaggerServer/README.md (100%) rename samples/server/petstore/{silex => php-silex}/SwaggerServer/composer.json (100%) rename samples/server/petstore/{silex => php-silex}/SwaggerServer/index.php (100%) delete mode 100644 samples/server/petstore/silex/.swagger-codegen/VERSION diff --git a/bin/silex-petstore-server.sh b/bin/php-silex-petstore-server.sh similarity index 78% rename from bin/silex-petstore-server.sh rename to bin/php-silex-petstore-server.sh index c273102828b..85b412517ee 100755 --- a/bin/silex-petstore-server.sh +++ b/bin/php-silex-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 -t modules/swagger-codegen/src/main/resources/silex -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l silex-PHP -o samples/server/petstore/silex" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/php-silex -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l php-silex -o samples/server/petstore/php-silex" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/php-silex-petstore.bat b/bin/windows/php-silex-petstore.bat new file mode 100644 index 00000000000..7e5ae1d8de1 --- /dev/null +++ b/bin/windows/php-silex-petstore.bat @@ -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 -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l php-silex -o samples\server\petstore\php-silex + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java index 088d4bc5b03..dec7c06489d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SilexServerCodegen.java @@ -34,13 +34,13 @@ public SilexServerCodegen() { modelPackage = packagePath + "/lib/models"; apiPackage = packagePath + "/lib"; - outputFolder = "generated-code/silex"; + outputFolder = "generated-code/php-silex"; // no model, api files modelTemplateFiles.clear(); apiTemplateFiles.clear(); - embeddedTemplateDir = templateDir = "silex"; + embeddedTemplateDir = templateDir = "php-silex"; setReservedWordsLowerCase( Arrays.asList( @@ -103,12 +103,12 @@ public CodegenType getTag() { @Override public String getName() { - return "silex-PHP"; + return "php-silex"; } @Override public String getHelp() { - return "Generates a Silex server library."; + return "Generates a PHP Silex server library."; } @Override diff --git a/modules/swagger-codegen/src/main/resources/silex/.htaccess b/modules/swagger-codegen/src/main/resources/php-silex/.htaccess similarity index 100% rename from modules/swagger-codegen/src/main/resources/silex/.htaccess rename to modules/swagger-codegen/src/main/resources/php-silex/.htaccess diff --git a/modules/swagger-codegen/src/main/resources/silex/README.mustache b/modules/swagger-codegen/src/main/resources/php-silex/README.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/silex/README.mustache rename to modules/swagger-codegen/src/main/resources/php-silex/README.mustache diff --git a/modules/swagger-codegen/src/main/resources/silex/composer.json b/modules/swagger-codegen/src/main/resources/php-silex/composer.json similarity index 100% rename from modules/swagger-codegen/src/main/resources/silex/composer.json rename to modules/swagger-codegen/src/main/resources/php-silex/composer.json diff --git a/modules/swagger-codegen/src/main/resources/silex/index.mustache b/modules/swagger-codegen/src/main/resources/php-silex/index.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/silex/index.mustache rename to modules/swagger-codegen/src/main/resources/php-silex/index.mustache diff --git a/samples/server/petstore/silex/.swagger-codegen-ignore b/samples/server/petstore/php-silex/.swagger-codegen-ignore similarity index 100% rename from samples/server/petstore/silex/.swagger-codegen-ignore rename to samples/server/petstore/php-silex/.swagger-codegen-ignore diff --git a/samples/server/petstore/php-silex/.swagger-codegen/VERSION b/samples/server/petstore/php-silex/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/server/petstore/php-silex/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/silex/SwaggerServer/.htaccess b/samples/server/petstore/php-silex/SwaggerServer/.htaccess similarity index 100% rename from samples/server/petstore/silex/SwaggerServer/.htaccess rename to samples/server/petstore/php-silex/SwaggerServer/.htaccess diff --git a/samples/server/petstore/silex/SwaggerServer/README.md b/samples/server/petstore/php-silex/SwaggerServer/README.md similarity index 100% rename from samples/server/petstore/silex/SwaggerServer/README.md rename to samples/server/petstore/php-silex/SwaggerServer/README.md diff --git a/samples/server/petstore/silex/SwaggerServer/composer.json b/samples/server/petstore/php-silex/SwaggerServer/composer.json similarity index 100% rename from samples/server/petstore/silex/SwaggerServer/composer.json rename to samples/server/petstore/php-silex/SwaggerServer/composer.json diff --git a/samples/server/petstore/silex/SwaggerServer/index.php b/samples/server/petstore/php-silex/SwaggerServer/index.php similarity index 100% rename from samples/server/petstore/silex/SwaggerServer/index.php rename to samples/server/petstore/php-silex/SwaggerServer/index.php diff --git a/samples/server/petstore/silex/.swagger-codegen/VERSION b/samples/server/petstore/silex/.swagger-codegen/VERSION deleted file mode 100644 index 7fea99011a6..00000000000 --- a/samples/server/petstore/silex/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.3-SNAPSHOT \ No newline at end of file From bf74e33c52cdb125bcd30e7742d116352f8f9ded Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 4 Oct 2017 00:03:35 +0800 Subject: [PATCH 105/197] rename CsharpDotNet2 to csharp-dotnet2 (#6611) --- bin/csharp-dotnet2-petstore.sh | 2 +- bin/windows/csharp-dotnet2-petstore.bat | 2 +- .../swagger/codegen/languages/CsharpDotNet2ClientCodegen.java | 4 ++-- .../{CsharpDotNet2 => csharp-dotnet2}/ApiClient.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/ApiException.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/Configuration.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/README.mustache | 0 .../resources/{CsharpDotNet2 => csharp-dotnet2}/api.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/api_doc.mustache | 0 .../compile-mono.sh.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/model.mustache | 0 .../{CsharpDotNet2 => csharp-dotnet2}/model_doc.mustache | 0 .../packages.config.mustache | 0 13 files changed, 4 insertions(+), 4 deletions(-) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/ApiClient.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/ApiException.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/Configuration.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/README.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/api.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/api_doc.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/compile-mono.sh.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/model.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/model_doc.mustache (100%) rename modules/swagger-codegen/src/main/resources/{CsharpDotNet2 => csharp-dotnet2}/packages.config.mustache (100%) diff --git a/bin/csharp-dotnet2-petstore.sh b/bin/csharp-dotnet2-petstore.sh index eb4a95c76e1..9199f1ae278 100755 --- a/bin/csharp-dotnet2-petstore.sh +++ b/bin/csharp-dotnet2-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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l CsharpDotNet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/csharp-dotnet2-petstore.bat b/bin/windows/csharp-dotnet2-petstore.bat index b321637d386..90f5ddf7910 100755 --- a/bin/windows/csharp-dotnet2-petstore.bat +++ b/bin/windows/csharp-dotnet2-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l CsharpDotNet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true +set ags=generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java index 125b688858f..fe71ba3006b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java @@ -26,7 +26,7 @@ public CsharpDotNet2ClientCodegen() { setApiPackage(packageName + ".Api"); setModelPackage(packageName + ".Model"); setClientPackage(packageName + ".Client"); - setSourceFolder("src" + File.separator + "main" + File.separator + this.getName()); + setSourceFolder("src" + File.separator + "main" + File.separator + "CsharpDotNet2"); modelDocTemplateFiles.put("model_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); @@ -96,7 +96,7 @@ public CodegenType getTag() { @Override public String getName() { - return "CsharpDotNet2"; + return "csharp-dotnet2"; } @Override diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/ApiClient.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiClient.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/ApiClient.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/ApiException.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/ApiException.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/ApiException.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/Configuration.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/README.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/README.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/README.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/api.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/api.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/api.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/api_doc.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/api_doc.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/api_doc.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/compile-mono.sh.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/compile-mono.sh.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/model.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/model.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/model.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/model_doc.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/model_doc.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/model_doc.mustache diff --git a/modules/swagger-codegen/src/main/resources/CsharpDotNet2/packages.config.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/packages.config.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/CsharpDotNet2/packages.config.mustache rename to modules/swagger-codegen/src/main/resources/csharp-dotnet2/packages.config.mustache From f7bd2c519e6bde8d640d6a9cd25918e53fa60d7b Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 4 Oct 2017 11:49:40 +0800 Subject: [PATCH 106/197] add new language "ada" --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c6c18c05530..a86fbe493d4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ## Overview 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**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) +- **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **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**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) @@ -950,6 +950,7 @@ Swagger Codegen core team members are contributors who have been making signific ## Template Creator Here is a list of template creators: * API Clients: + * Ada: @stcarrez * Akka-Scala: @cchafer * Apex: @asnelling * Bash: @bkryza From 90010da61db4c05d6fca6fdbda3bcd3474ae26b3 Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Wed, 4 Oct 2017 05:51:04 +0200 Subject: [PATCH 107/197] [Ada] Adding Ada support for client code generator (#6602) * Ada language support (generic generator) Implement the AbstractAdaCodegen class with the Ada keywords and global behavior for Ada language * Ada language support (main generator) Implement the AdaCodegen class for the Ada client and server code generator Initial implementation based on a mix from CppRestClientCodegen, NodeJSServerCodegen * Ada language support: register the AdaCodegen generator class * Ada language license template * Ada language model templates (spec and body) * Ada language client spec and body templates * Ada language server spec and body templates * Fix escaping Ada keywords for parameter name * Generate GNAT project and update type mappings - Use 'p_' as escape prefix for parameter names because identifiers are not allowed to start with '_' - Add GNAT project file generation - Update the type mappings to use the Swagger package types * Fix generation of operations with no parameters * Fix instantiation of Ada.Containers.Vectors package in generated model files * New template for the GNAT project file generation * Fix datatype generation for Ada language - Override the getTypeDeclaration function to specify the datatype - Fix definition of language predefined types * Add a Serialize procedure declaration for the Ada model generation * Add a Serialize procedure for the Ada template model generation * Fix operation name and parameter name for Ada - Declare and implement toAdaIdentifier function to verify and turn some identifier to Ada identifier following Ada style - Override toOperationId and use toAdaIdentifier for generation of operation name - Update toParamName to use toAdaIdentifier * Media type support for Ada code generator - Implement postProcessMediaTypes function to add a 'adaMediaType' member to each media type and map it to some Ada enumeration - Post process the 'produces' and 'consumes' media type of an operation * Use x-has-notes extension to avoid emitting notes when they are empty * First generation for Ada client operation body * Add a x-has-uniq-produces and x-has-uniq-consumes to media types to indicate that the list contains only one item, this is necessary for Ada generator for generation of arrays with one item only * Add a postProcessParameter for Ada code generator to emit a x-is-model-type attribute * Update Ada client body template for the serialization of data * Fix postProcessParameter in Ada code generator to take into account file parameters * Update the Ada client body to support form parameters * Fix type name used for mapped types in the Ada generator * Declare a Deserialize procedure for the Ada generated model * Override the fromOperation for Ada client code generator - Emit a x-codegen-response extension with the response description type - Emit a x-id-model-type extension for each type property * Update the Ada client package spec template to declare the result type * Add support to extract response and return result in Ada client code * Fix Ada postProcessModels to handle container properties and emit a correct x-is-model-type attribute * Add support for Deserialize procedure in the Ada model generator * Fix indentation of generated Ada client body package * Add projectName option to configure the GNAT project name * Update the GNAT project name for the Ada code generator * Cleanup implementation and remove unused code * Cleanup implementation and remove unused code * Fix javadoc errors * Use 'ada' for the language name to follow swagger-codegen convention Add (beta) to the help description Fix a NPE that occurs with incomplete yaml descriptions --- .../codegen/languages/AbstractAdaCodegen.java | 163 ++++++++ .../swagger/codegen/languages/AdaCodegen.java | 362 ++++++++++++++++++ .../main/resources/Ada/client-body.mustache | 50 +++ .../main/resources/Ada/client-spec.mustache | 25 ++ .../main/resources/Ada/gnat-project.mustache | 23 ++ .../main/resources/Ada/licenseInfo.mustache | 9 + .../main/resources/Ada/model-body.mustache | 62 +++ .../main/resources/Ada/model-spec.mustache | 43 +++ .../main/resources/Ada/server-body.mustache | 19 + .../main/resources/Ada/server-spec.mustache | 20 + .../services/io.swagger.codegen.CodegenConfig | 1 + 11 files changed, 777 insertions(+) create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractAdaCodegen.java create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AdaCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/Ada/client-body.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/client-spec.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/gnat-project.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/licenseInfo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/model-body.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/model-spec.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/server-body.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Ada/server-spec.mustache diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractAdaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractAdaCodegen.java new file mode 100644 index 00000000000..eb6e0263ac9 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractAdaCodegen.java @@ -0,0 +1,163 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.CodegenConfig; +import io.swagger.codegen.CodegenProperty; +import io.swagger.codegen.DefaultCodegen; +import io.swagger.models.properties.Property; + +import java.util.Arrays; + +abstract public class AbstractAdaCodegen extends DefaultCodegen implements CodegenConfig { + + public AbstractAdaCodegen() { + super(); + + /* + * Reserved words. Override this with reserved words specific to your language + */ + setReservedWordsLowerCase( + Arrays.asList( + "abort", + "abs", + "abstract", + "accept", + "access", + "aliased", + "all", + "and", + "array", + "at", + "begin", + "body", + "case", + "constant", + "declare", + "delay", + "digits", + "do", + "else", + "elsif", + "end", + "entry", + "exception", + "exit", + "for", + "function", + "generic", + "goto", + "if", + "in", + "interface", + "is", + "limited", + "loop", + "mod", + "new", + "not", + "null", + "of", + "or", + "others", + "out", + "overriding", + "package", + "pragma", + "private", + "procedure", + "protected", + "raise", + "range", + "record", + "rem", + "renames", + "requeue", + "return", + "reverse", + "select", + "separate", + "some", + "subtype", + "synchronized", + "tagged", + "task", + "terminate", + "then", + "type", + "until", + "use", + "when", + "while", + "with", + "xor") + ); + } + + /** + * Turn a parameter name, operation name into an Ada identifier. + * + * Ada programming standard avoid the camelcase syntax and prefer the underscore + * notation. We also have to make sure the identifier is not a reserved keyword. + * When this happens, we add the configurable prefix. The function translates: + * + * body - P_Body + * petId - Pet_Id + * updatePetWithForm - Update_Pet_With_Form + * + * @param name the parameter name. + * @param prefix the optional prefix in case the parameter name is a reserved keyword. + * @return the Ada identifier to be used. + */ + protected String toAdaIdentifier(String name, String prefix) { + // We cannot use reserved keywords for identifiers + if (isReservedWord(name)) { + LOGGER.warn("Identifier '" + name + "' is a reserved word, renamed to " + prefix + name); + name = prefix + name; + } + StringBuilder result = new StringBuilder(); + boolean needUpperCase = true; + for (int i = 0; i < name.length(); i++) { + char c = name.charAt(i); + if (needUpperCase) { + needUpperCase = false; + result.append(Character.toUpperCase(c)); + + } else if (Character.isUpperCase((c))) { + if (!needUpperCase) { + result.append('_'); + } + result.append(c); + needUpperCase = false; + } else { + result.append(c); + if (c == '_') { + needUpperCase = true; + } + } + } + return result.toString(); + } + + @Override + public String toOperationId(String operationId) { + return toAdaIdentifier(sanitizeName(operationId), "Call_"); + } + + @Override + public String toVarName(String name) { + return toAdaIdentifier(sanitizeName(name), "P_"); + } + + @Override + public String toParamName(String name) { + return toAdaIdentifier(super.toParamName(name), "P_"); + } + + @Override + public CodegenProperty fromProperty(String name, Property p) { + CodegenProperty property = super.fromProperty(name, p); + String nameInCamelCase = property.nameInCamelCase; + nameInCamelCase = sanitizeName(nameInCamelCase); + property.nameInCamelCase = nameInCamelCase; + return property; + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AdaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AdaCodegen.java new file mode 100644 index 00000000000..309f9a2bada --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AdaCodegen.java @@ -0,0 +1,362 @@ +package io.swagger.codegen.languages; + +import java.io.File; +import java.util.*; + +import io.swagger.codegen.*; +import io.swagger.models.Model; +import io.swagger.models.Operation; +import io.swagger.models.Response; +import io.swagger.models.Swagger; +import io.swagger.models.properties.*; + +public class AdaCodegen extends AbstractAdaCodegen implements CodegenConfig { + protected String packageName = "swagger"; + protected String projectName = "Swagger"; + protected List> orderedModels; + protected Map> modelDepends; + + public AdaCodegen() { + super(); + + modelNameSuffix = "_Type"; + orderedModels = new ArrayList>(); + modelDepends = new HashMap>(); + embeddedTemplateDir = templateDir = "Ada"; + + // CLI options + addOption(CodegenConstants.PROJECT_NAME, "GNAT project name", + this.projectName); + addOption(CodegenConstants.PACKAGE_NAME, "Ada package name (convention: name.space.model).", + this.modelPackage); + addOption(CodegenConstants.MODEL_PACKAGE, "Ada package for models (convention: name.space.model).", + this.modelPackage); + addOption(CodegenConstants.API_PACKAGE, "Ada package for apis (convention: name.space.api).", + this.apiPackage); + + languageSpecificPrimitives = new HashSet( + Arrays.asList("integer", "boolean", "Integer", "Character", "Boolean", "long", "float", "double", "int32_t", "int64_t")); + + typeMapping = new HashMap(); + typeMapping.put("date", "Swagger.Date"); + typeMapping.put("DateTime", "Swagger.Datetime"); + typeMapping.put("string", "Swagger.UString"); + typeMapping.put("integer", "Integer"); + typeMapping.put("long", "Swagger.Long"); + typeMapping.put("boolean", "Boolean"); + typeMapping.put("array", "Swagger.Vector"); + typeMapping.put("map", "Swagger.Map"); + typeMapping.put("object", "Swagger.Object"); + typeMapping.put("number", "Swagger.Number"); + typeMapping.put("UUID", "Swagger.UString"); + typeMapping.put("file", "Swagger.Http_Content_Type"); + typeMapping.put("binary", "Swagger.Binary"); + + super.importMapping = new HashMap(); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "ada"; + } + + @Override + public String getHelp() { + return "Generates an Ada client implementation (beta)."; + } + + protected void addOption(String key, String description, String defaultValue) { + CliOption option = new CliOption(key, description); + if (defaultValue != null) + option.defaultValue(defaultValue); + cliOptions.add(option); + } + + public String toFilename(String name) { + return name.replace(".", "-").toLowerCase(); + } + + @Override + public void processOpts() { + super.processOpts(); + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + packageName = (String) additionalProperties.get(CodegenConstants.PACKAGE_NAME); + } + String serverPrefix = "src" + File.separator + "server" + File.separator + toFilename(modelPackage); + String clientPrefix = "src" + File.separator + "client" + File.separator + toFilename(modelPackage); + supportingFiles.add(new SupportingFile("model-spec.mustache", null, clientPrefix + "-models.ads")); + supportingFiles.add(new SupportingFile("model-body.mustache", null, clientPrefix + "-models.adb")); + supportingFiles.add(new SupportingFile("model-spec.mustache", null, serverPrefix + "-models.ads")); + supportingFiles.add(new SupportingFile("model-body.mustache", null, serverPrefix + "-models.adb")); + supportingFiles.add(new SupportingFile("client-spec.mustache", null, clientPrefix + "-clients.ads")); + supportingFiles.add(new SupportingFile("client-body.mustache", null, clientPrefix + "-clients.adb")); + supportingFiles.add(new SupportingFile("server-spec.mustache", null, serverPrefix + "-servers.ads")); + supportingFiles.add(new SupportingFile("server-body.mustache", null, serverPrefix + "-servers.adb")); + + // String title = swagger.getInfo().getTitle(); + supportingFiles.add(new SupportingFile("gnat-project.mustache", "", "project.gpr")); + + if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { + projectName = (String) additionalProperties.get(CodegenConstants.PROJECT_NAME); + } else { + // default: set project based on package name + // e.g. petstore.api (package name) => petstore_api (project name) + projectName = packageName.replaceAll("\\.", "_"); + } + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("package", this.modelPackage); + additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); + } + + @Override + public String apiFileFolder() { + return outputFolder + "/" + apiPackage().replace('.', File.separatorChar); + } + + @Override + public String modelFileFolder() { + return outputFolder + "/model/" + modelPackage().replace('.', File.separatorChar); + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle + * escaping those terms here. This logic is only called if a variable + * matches the reserved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + return "p_" + name; // add an underscore to the name + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + /** + * 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) { + String swaggerType = getSwaggerType(p); + + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return getTypeDeclaration(inner) + "_Vectors.Vector"; + } + if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return "Swagger." + getTypeDeclaration(inner) + "_Map"; + } + if (typeMapping.containsKey(swaggerType)) { + return typeMapping.get(swaggerType); + } + // LOGGER.info("Swagger type " + swaggerType); + if (languageSpecificPrimitives.contains(swaggerType)) { + return swaggerType; + } + String modelType = toModelName(swaggerType); + if (p instanceof StringProperty || p instanceof DateProperty + || p instanceof DateTimeProperty || p instanceof FileProperty + || languageSpecificPrimitives.contains(modelType)) { + return modelType; + } + + return modelPackage + ".Models." + modelType; + } + + /** + * Overrides postProcessParameter to add a vendor extension "x-is-model-type". + * This boolean indicates that the parameter comes from the model package. + * + * @param parameter CodegenParameter object to be processed. + */ + @Override + public void postProcessParameter(CodegenParameter parameter){ + // Give the base class a chance to process + super.postProcessParameter(parameter); + + boolean isModel = parameter.dataType.startsWith(modelPackage); + if (!isModel && !parameter.isPrimitiveType && !parameter.isDate + && !parameter.isString && !parameter.isContainer && !parameter.isFile) { + isModel = true; + } + parameter.vendorExtensions.put("x-is-model-type", isModel); + } + + /** + * Post process the media types (produces and consumes) for Ada code generator. + * + * For each media type, add a adaMediaType member that gives the Ada enum constant + * for the corresponding type. + * + * @param types the list of media types. + * @return the number of media types. + */ + protected int postProcessMediaTypes(List> types) { + int count = 0; + if (types != null) { + for (Map media : types) { + String mt = media.get("mediaType"); + if (mt != null) { + mt = mt.replace('/', '_'); + media.put("adaMediaType", mt.toUpperCase()); + count++; + } + } + } + return count; + } + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, + Map definitions, Swagger swagger) { + CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, swagger); + + if (operation.getResponses() != null && !operation.getResponses().isEmpty()) { + Response methodResponse = findMethodResponse(operation.getResponses()); + + if (methodResponse != null) { + if (methodResponse.getSchema() != null) { + CodegenProperty cm = fromProperty("response", methodResponse.getSchema()); + op.vendorExtensions.put("x-codegen-response", cm); + if(cm.datatype == "HttpContent") { + op.vendorExtensions.put("x-codegen-response-ishttpcontent", true); + } + } + } + } + return op; + } + + @SuppressWarnings("unchecked") + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + + for (CodegenOperation op1 : operationList) { + op1.vendorExtensions.put("x-has-uniq-produces", postProcessMediaTypes(op1.produces) == 1); + op1.vendorExtensions.put("x-has-uniq-consumes", postProcessMediaTypes(op1.consumes) == 1); + op1.vendorExtensions.put("x-has-notes", op1.notes.length() > 0); + } + return objs; + } + + @Override + public Map postProcessModels(Map objs) { + // Collect the model dependencies. + List> models = (List>) objs.get("models"); + for (Map model : models) { + Object v = model.get("model"); + if (v instanceof CodegenModel) { + CodegenModel m = (CodegenModel) v; + List d = new ArrayList(); + for (CodegenProperty p : m.allVars) { + boolean isModel = false; + CodegenProperty item = p; + if (p.isContainer) { + item = p.items; + } + if (item != null && !item.isString && !item.isPrimitiveType && !item.isContainer && !item.isInteger) { + if (!d.contains(item.datatype)) { + // LOGGER.info("Model " + m.name + " uses " + p.datatype); + d.add(item.datatype); + isModel = true; + } + } + p.vendorExtensions.put("x-is-model-type", isModel); + } + modelDepends.put(m.name, d); + orderedModels.add(model); + } + } + + // Sort the models according to dependencies so that model that depend + // on others appear at end of the list. + final Map> deps = modelDepends; + Collections.sort(orderedModels, new Comparator>() { + @Override + public int compare(Map lhs, Map rhs) { + Object v = lhs.get("model"); + String lhsName = ((CodegenModel) v).name; + v = rhs.get("model"); + String rhsName = ((CodegenModel) v).name; + List lhsList = deps.get(lhsName); + List rhsList = deps.get(rhsName); + if (lhsList == rhsList) { + // LOGGER.info("First compare " + lhsName + "<" + rhsName); + return lhsName.compareTo(rhsName); + } + // Put models without dependencies first. + if (lhsList == null) { + // LOGGER.info(" Empty " + lhsName + ", no check " + rhsName); + return -1; + } + if (rhsList == null) { + // LOGGER.info(" No check " + lhsName + ", empty " + rhsName); + return 1; + } + // Put models that depend on another after. + if (lhsList.contains(rhsName)) { + // LOGGER.info(" LSH " + lhsName + " uses " + rhsName); + return 1; + } + if (rhsList.contains(lhsName)) { + // LOGGER.info(" RHS " + rhsName + " uses " + lhsName); + return -1; + } + // Put models with less dependencies first. + if (lhsList.size() < rhsList.size()) { + // LOGGER.info(" LSH size " + lhsName + " < RHS size " + rhsName); + return -1; + } + if (lhsList.size() > rhsList.size()) { + // LOGGER.info(" LSH size " + lhsName + " > RHS size " + rhsName); + return 1; + } + // Sort models on their name. + // LOGGER.info("Compare " + lhsName + "<" + rhsName); + return lhsName.compareTo(rhsName); + } + }); + /* for (Map model : orderedModels) { + Object v = model.get("model"); + if (v instanceof CodegenModel) { + CodegenModel m = (CodegenModel) v; + LOGGER.info("Order: " + m.name); + } + }*/ + return postProcessModelsEnum(objs); + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + objs.put("orderedModels", orderedModels); + return super.postProcessSupportingFileData(objs); + } +} diff --git a/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache b/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache new file mode 100644 index 00000000000..0aa184749af --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache @@ -0,0 +1,50 @@ +{{>licenseInfo}} +with Swagger.Streams; +package body {{package}}.Clients is +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + + -- {{summary}}{{#vendorExtensions.x-has-notes}} + -- {{unescapedNotes}}{{/vendorExtensions.x-has-notes}} + procedure {{operationId}} + (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} + {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}}; + Result : out {{returnType}}{{/returnType}}) is + URI : Swagger.Clients.URI_Type;{{#hasBodyParam}} + Req : Swagger.Clients.Request_Type;{{/hasBodyParam}}{{#hasFormParams}} + Req : Swagger.Clients.Request_Type;{{/hasFormParams}} + {{#returnType}} + Reply : Swagger.Value_Type; + {{/returnType}} + begin + Client.Set_Accept (({{#hasProduces}}{{#produces}}{{#vendorExtensions.x-has-uniq-produces}}1 => {{/vendorExtensions.x-has-uniq-produces}}Swagger.Clients.{{adaMediaType}}{{#hasMore}}, + {{/hasMore}}{{/produces}}{{/hasProduces}}));{{#hasBodyParam}} + Client.Initialize (Req, ({{#hasConsumes}}{{#consumes}}{{#vendorExtensions.x-has-uniq-consumes}}1 -> {{/vendorExtensions.x-has-uniq-consumes}}Swagger.Clients.{{adaMediaType}}{{#hasMore}}, + {{/hasMore}}{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}1 => Swagger.Clients.APPLICATION_JSON{{/hasConsumes}}));{{#bodyParams}}{{#vendorExtensions.x-is-model-type}} + {{package}}.Models.Serialize (Req.Stream, "{{baseName}}", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}} + -- TODO: Serialize (Req.Stream, "{{basename}}", {{paramName}});{{/isFile}}{{^isFile}}{{^isLong}} + Req.Stream.Write_Entity ("{{baseName}}", {{paramName}});{{/isLong}}{{#isLong}} + Serialize (Req.Stream, "{{baseName}}", {{paramName}});{{/isLong}}{{/isFile}}{{/vendorExtensions.x-is-model-type}}{{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}} + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_FORM));{{#formParams}}{{#vendorExtensions.x-is-model-type}} + {{package}}.Models.Serialize (Req.Stream, "{{baseName}}", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}} + Req.Stream.Write_Entity ("{{baseName}}", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{/formParams}}{{/hasFormParams}} +{{#queryParams}}{{#isQueryParam}}{{^isPrimitiveType}}{{^isString}}{{^isContainer}}{{^isDateTime}} + URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isContainer}}{{/isString}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{^isLong}} + URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{/isPrimitiveType}}{{#isLong}} + URI.Add_Param ("{{baseName}}", {{paramName}});{{/isLong}}{{#isContainer}} + URI.Add_Param ("{{baseName}}", {{paramName}});{{/isContainer}}{{#isDateTime}} + URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isQueryParam}}{{/queryParams}} + URI.Set_Path ("{{path}}");{{#pathParams}} + URI.Set_Path_Param ("{{baseName}}", {{^isString}}Swagger.To_String ({{/isString}}{{paramName}}{{^isString}}){{/isString}});{{/pathParams}} + Client.Call (Swagger.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#returnType}}, Reply{{/returnType}});{{#returnType}}{{#vendorExtensions.x-codegen-response.isString}} + Swagger.Streams.Deserialize (Reply, "", Result);{{/vendorExtensions.x-codegen-response.isString}}{{^vendorExtensions.x-codegen-response.isString}}{{#returnTypeIsPrimitive}} + Swagger.Streams.Deserialize (Reply, "", Result);{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}} + {{package}}.Models.Deserialize (Reply, "", Result);{{/returnTypeIsPrimitive}}{{/vendorExtensions.x-codegen-response.isString}}{{/returnType}} + end {{operationId}}; +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +end {{package}}.Clients; diff --git a/modules/swagger-codegen/src/main/resources/Ada/client-spec.mustache b/modules/swagger-codegen/src/main/resources/Ada/client-spec.mustache new file mode 100644 index 00000000000..67ca7d08c22 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/client-spec.mustache @@ -0,0 +1,25 @@ +{{>licenseInfo}} +{{#imports}}with {{import}}; +{{/imports}} +with {{package}}.Models; +with Swagger.Clients; +package {{package}}.Clients is + + type Client_Type is new Swagger.Clients.Client_Type with null record; + +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + -- {{summary}}{{#vendorExtensions.x-has-notes}} + -- {{unescapedNotes}}{{/vendorExtensions.x-has-notes}} + procedure {{operationId}} + (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} + {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}}; + Result : out {{returnType}}{{/returnType}}); + +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +end {{package}}.Clients; diff --git a/modules/swagger-codegen/src/main/resources/Ada/gnat-project.mustache b/modules/swagger-codegen/src/main/resources/Ada/gnat-project.mustache new file mode 100644 index 00000000000..f07f3006cc8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/gnat-project.mustache @@ -0,0 +1,23 @@ +-- {{{appName}}} +-- {{{appDescription}}} +-- OpenAPI spec version: 1.0.0 +-- +-- https://github.com/swagger-api/swagger-codegen.git +-- + -- NOTE: Auto generated by the swagger code generator program. +with "config"; +with "util"; +with "asf"; +project {{{projectName}}} is + + Mains := ("{{{appName}}}-server.adb"); + for Main use Mains; + for Source_Dirs use ("src", "src/client", "src/server"); + for Object_Dir use "./" & Config'Exec_Dir & "/bin"; + + package Binder renames Config.Binder; + package Builder renames Config.Builder; + package Compiler renames Config.Compiler; + package Linker renames Config.Linker; + +end {{{projectName}}}; diff --git a/modules/swagger-codegen/src/main/resources/Ada/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/Ada/licenseInfo.mustache new file mode 100644 index 00000000000..6c6c4b246e5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/licenseInfo.mustache @@ -0,0 +1,9 @@ +-- {{{appName}}} +-- {{{appDescription}}} +-- +-- {{#version}}OpenAPI spec version: {{{version}}}{{/version}} +-- {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +-- +-- NOTE: This package is auto generated by the swagger code generator {{{generatorVersion}}}. +-- 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/Ada/model-body.mustache b/modules/swagger-codegen/src/main/resources/Ada/model-body.mustache new file mode 100644 index 00000000000..120de7b25cd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/model-body.mustache @@ -0,0 +1,62 @@ +{{>licenseInfo}} + +package body {{package}}.Models is + + use Swagger.Streams; + +{{#orderedModels}} +{{#model}} + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in {{classname}}) is + begin + Into.Start_Entity (Name);{{#vars}}{{^isPrimitiveType}}{{^isString}}{{^isContainer}}{{^isDateTime}} + Serialize (Into, "{{baseName}}", Value.{{name}});{{/isDateTime}}{{/isContainer}}{{/isString}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{^isLong}} + Into.Write_Entity ("{{baseName}}", Value.{{name}});{{/isLong}}{{/isPrimitiveType}}{{#isLong}} + Serialize (Into, "{{baseName}}", Value.{{name}});{{/isLong}}{{#isString}} + Into.Write_Entity ("{{baseName}}", Value.{{name}});{{/isString}}{{#isContainer}} + Serialize (Into, "{{baseName}}", Value.{{name}});{{/isContainer}}{{#isDateTime}} + Into.Write_Entity ("{{baseName}}", Value.{{name}});{{/isDateTime}}{{/vars}} + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in {{classname}}_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out {{classname}}) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object);{{#vars}}{{#vendorExtensions.x-is-model-type}} + Deserialize (Object, "{{baseName}}", Value.{{name}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}} + Swagger.Streams.Deserialize (Object, "{{baseName}}", Value.{{name}});{{/vendorExtensions.x-is-model-type}}{{/vars}} + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out {{classname}}_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : {{classname}}; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + +{{/model}} +{{/orderedModels}} + +end {{package}}.Models; diff --git a/modules/swagger-codegen/src/main/resources/Ada/model-spec.mustache b/modules/swagger-codegen/src/main/resources/Ada/model-spec.mustache new file mode 100644 index 00000000000..bed1aa4207d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/model-spec.mustache @@ -0,0 +1,43 @@ +{{>licenseInfo}} +{{#imports}}with {{import}}; +{{/imports}} +with Swagger.Streams; +with Ada.Containers.Vectors; +package {{package}}.Models is + +{{#orderedModels}}{{#model}} + -- ------------------------------ + -- {{title}} + -- {{description}} + -- ------------------------------ + type {{classname}} is + record + {{#vars}} + {{name}} : {{datatype}}; + {{/vars}} + end record; + + package {{classname}}_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => {{classname}}); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in {{classname}}); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in {{classname}}_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out {{classname}}); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out {{classname}}_Vectors.Vector); + +{{/model}} +{{/orderedModels}} + +end {{package}}.Models; diff --git a/modules/swagger-codegen/src/main/resources/Ada/server-body.mustache b/modules/swagger-codegen/src/main/resources/Ada/server-body.mustache new file mode 100644 index 00000000000..dc1ac8c7528 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/server-body.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +package body {{package}}.Servers is +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + + -- {{summary}} + -- {{notes}} + procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}}; + {{/hasMore}}{{/allParams}}) is + begin + null; + end {{operationId}}; +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +end {{package}}.Servers; diff --git a/modules/swagger-codegen/src/main/resources/Ada/server-spec.mustache b/modules/swagger-codegen/src/main/resources/Ada/server-spec.mustache new file mode 100644 index 00000000000..0d887b15d36 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Ada/server-spec.mustache @@ -0,0 +1,20 @@ +{{>licenseInfo}} +{{#imports}}with {{import}}; +{{/imports}} +with {{package}}.Models; +package {{package}}.Servers is +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + + -- {{summary}} + -- {{notes}} + procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}}; + {{/hasMore}}{{/allParams}}); + +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +end {{package}}.Servers; 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 6a3706d3d5a..a584a5cd5b3 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 @@ -1,3 +1,4 @@ +io.swagger.codegen.languages.AdaCodegen io.swagger.codegen.languages.AkkaScalaClientCodegen io.swagger.codegen.languages.AndroidClientCodegen io.swagger.codegen.languages.Apache2ConfigCodegen From e49e7a056b1a4aa07f98e3cbb56ac1880b239a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Grard?= Date: Wed, 4 Oct 2017 16:46:06 +0200 Subject: [PATCH 108/197] Typo error fix (#6620) --- .../io/swagger/codegen/languages/CSharpClientCodegen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 294a095c260..69bee7bd9c9 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -225,8 +225,8 @@ public void processOpts() { setTargetFrameworkNuget("uwp"); setSupportsAsync(Boolean.TRUE); setSupportsUWP(Boolean.TRUE); - additionalProperties.put("supportsAsync", this.supportsUWP); - additionalProperties.put("supportsUWP", this.supportsAsync); + additionalProperties.put("supportsAsync", this.supportsAsync); + additionalProperties.put("supportsUWP", this.supportsUWP); } else { setTargetFrameworkNuget("net45"); From 61b910fb82bb6397980dc9563798330e6ad1ace6 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 4 Oct 2017 10:07:06 -0700 Subject: [PATCH 109/197] [R] Added ApiClient and fixed other issues (#6571) * Added namespace mustache to be generated * Fixed syntax issues with package generation * Added Response and Element mustache templates * Added ApiClient * Fix: Only required parameters needed for api operations * Added documentation generated code * Regenerated petstore samples * Fixed url paths for operations * Fixed based on comments in issues #6520 * Regenerated petstore samples --- .../codegen/languages/RClientCodegen.java | 3 + .../src/main/resources/r/api.mustache | 121 ++++--- .../src/main/resources/r/api_client.mustache | 64 ++++ .../src/main/resources/r/element.mustache | 24 ++ .../src/main/resources/r/model.mustache | 97 +++--- .../src/main/resources/r/response.mustache | 15 + samples/client/petstore/r_test/R/ApiClient.r | 71 +++++ .../client/petstore/r_test/R/ApiResponse.r | 83 +++-- samples/client/petstore/r_test/R/Category.r | 74 ++--- samples/client/petstore/r_test/R/Element.r | 24 ++ samples/client/petstore/r_test/R/Order.r | 110 ++++--- samples/client/petstore/r_test/R/Pet.r | 124 ++++---- samples/client/petstore/r_test/R/PetApi.r | 294 +++++++++++++----- samples/client/petstore/r_test/R/Response.r | 15 + samples/client/petstore/r_test/R/StoreApi.r | 150 ++++++--- samples/client/petstore/r_test/R/Tag.r | 74 ++--- samples/client/petstore/r_test/R/User.r | 128 +++++--- samples/client/petstore/r_test/R/UserApi.r | 269 ++++++++++++---- samples/client/petstore/r_test/README.md | 18 +- 19 files changed, 1207 insertions(+), 551 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/r/api_client.mustache create mode 100644 modules/swagger-codegen/src/main/resources/r/element.mustache create mode 100644 modules/swagger-codegen/src/main/resources/r/response.mustache create mode 100644 samples/client/petstore/r_test/R/ApiClient.r create mode 100644 samples/client/petstore/r_test/R/Element.r create mode 100644 samples/client/petstore/r_test/R/Response.r diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RClientCodegen.java index 087b4d0c8fd..5ccb632629d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RClientCodegen.java @@ -143,6 +143,9 @@ public void processOpts() { supportingFiles.add(new SupportingFile("description.mustache", "", "DESCRIPTION")); supportingFiles.add(new SupportingFile("Rbuildignore.mustache", "", ".Rbuildignore")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("response.mustache", "/R", "Response.r")); + supportingFiles.add(new SupportingFile("element.mustache", "/R", "Element.r")); + supportingFiles.add(new SupportingFile("api_client.mustache", "/R", "ApiClient.r")); } @Override diff --git a/modules/swagger-codegen/src/main/resources/r/api.mustache b/modules/swagger-codegen/src/main/resources/r/api.mustache index 74d07116c1f..eb64e29cdb2 100644 --- a/modules/swagger-codegen/src/main/resources/r/api.mustache +++ b/modules/swagger-codegen/src/main/resources/r/api.mustache @@ -1,56 +1,105 @@ {{>partial_header}} {{#operations}} +#' @title {{baseName}} operations +#' @description {{importPath}} +#' +#' @field path Stores url path of the request. +#' @field apiClient Handles the client-server communication. +#' @field userAgent Set the user agent of the request. +#' +#' @importFrom R6 R6Class +#' +#' @section Methods: +#' \describe{ +{{#operation}} +#' +#' {{operationId}} {{summary}} +#' +{{/operation}} +#' } +#' +#' @export {{classname}} <- R6::R6Class( '{{classname}}', public = list( userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/r{{/httpUserAgent}}", - basePath = "{{{basePath}}}", - initialize = function(basePath){ - if (!missing(basePath)) { - stopifnot(is.character(basePath), length(basePath) == 1) - self$basePath <- basePath + apiClient = NULL, + initialize = function(apiClient){ + if (!missing(apiClient)) { + self$apiClient <- apiClient + } + else { + self$apiClient <- ApiClient$new() } }, - {{#operation}} - {{operationId}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){ - resp <- httr::{{httpMethod}}(paste0(self$basePath{{#pathParams}}, {{paramName}}{{/pathParams}}), - httr::add_headers("User-Agent" = self$userAgent{{#hasConsumes}}, "accept" = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}"{{/hasConsumes}}{{#hasProduces}}, "content-type" = "{{#produces}}{{#-first}}{{{mediaType}}}{{/-first}}{{/produces}}"{{/hasProduces}}{{#headerParams}}, "{{baseName}}" = {{paramName}}{{/headerParams}}) - {{#hasFormParams}} - ,body = list( - {{#formParams}} - {{^isFile}} - "{{baseName}}" = {{paramName}}{{#hasMore}},{{/hasMore}} - {{/isFile}} - {{#isFile}} - "{{baseName}}" = httr::upload_file({{paramName}}){{#hasMore}},{{/hasMore}} - {{/isFile}} - {{/formParams}} - ) - {{/hasFormParams}} - {{#bodyParams}} - ,body = {{paramName}}$toJSON() - {{/bodyParams}} - {{#hasQueryParams}} - ,query = list( - {{#queryParams}} - "{{baseName}}" = {{paramName}}{{#hasMore}},{{/hasMore}} - {{/queryParams}} - ) - {{/hasQueryParams}} - ) + {{operationId}} = function({{#allParams}}{{paramName}}, {{/allParams}}...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + {{#hasHeaderParams}} + {{#headerParams}} + if (!missing(`{{paramName}}`)) { + headerParams['{{baseName}}'] <- `{{paramName}}` + } + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasQueryParams}} + {{#queryParams}} + if (!missing(`{{paramName}}`)) { + queryParams['{{baseName}}'] <- {{paramName}} + } + {{/queryParams}} + {{/hasQueryParams}} + {{#hasFormParams}} + body <- list( + {{#formParams}} + {{^isFile}} + "{{baseName}}" = {{paramName}}{{#hasMore}},{{/hasMore}} + {{/isFile}} + {{#isFile}} + "{{baseName}}" = httr::upload_file({{paramName}}){{#hasMore}},{{/hasMore}} + {{/isFile}} + {{/formParams}} + ) + {{/hasFormParams}} + {{#hasBodyParam}} + {{#bodyParams}} + if (!missing(`{{paramName}}`)) { + body <- `{{paramName}}`$toJSON() + } + {{/bodyParams}} + {{/hasBodyParam}} + + urlPath <- "{{path}}" + {{#hasPathParams}} + {{#pathParams}} + if (!missing(`{{paramName}}`)) { + urlPath <- gsub(paste0("\\{", "{{baseName}}", "\\}"), `{{paramName}}`, urlPath) + } + {{/pathParams}} + {{/hasPathParams}} + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "{{httpMethod}}", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { {{#returnType}} - result <- {{returnType}}$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) + returnObject <- {{returnType}}$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) {{/returnType}} {{^returnType}} # void response, no need to return anything {{/returnType}} - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } diff --git a/modules/swagger-codegen/src/main/resources/r/api_client.mustache b/modules/swagger-codegen/src/main/resources/r/api_client.mustache new file mode 100644 index 00000000000..49e22e1c5c0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/r/api_client.mustache @@ -0,0 +1,64 @@ +{{>partial_header}} + +#' ApiClient Class +#' +#' Generic API client for Swagger client library builds. +#' Swagger generic API client. This client handles the client- +#' server communication, and is invariant across implementations. Specifics of +#' the methods and models for each application are generated from the Swagger +#' templates. +#' +#' NOTE: This class is auto generated by the swagger code generator program. +#' Ref: https://github.com/swagger-api/swagger-codegen +#' Do not edit the class manually. +#' +#' @export +ApiClient <- R6::R6Class( + 'ApiClient', + public = list( + basePath = "{{{basePath}}}", + configuration = NULL, + userAgent = NULL, + defaultHeaders = NULL, + initialize = function(basePath, configuration, defaultHeaders){ + if (!missing(basePath)) { + self$basePath <- basePath + } + + if (!missing(configuration)) { + self$configuration <- configuration + } + + if (!missing(defaultHeaders)) { + self$defaultHeaders <- defaultHeaders + } + + self$`userAgent` <- '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/r{{/httpUserAgent}}' + }, + callApi = function(url, method, queryParams, headerParams, body, ...){ + headers <- httr::add_headers(headerParams) + + if (method == "GET") { + httr::GET(url, queryParams, headers, ...) + } + else if (method == "POST") { + httr::POST(url, queryParams, headers, body = body, ...) + } + else if (method == "PUT") { + httr::PUT(url, queryParams, headers, body = body, ...) + } + else if (method == "PATCH") { + httr::PATCH(url, queryParams, headers, body = body, ...) + } + else if (method == "HEAD") { + httr::HEAD(url, queryParams, headers, ...) + } + else if (method == "DELETE") { + httr::DELETE(url, queryParams, headers, ...) + } + else { + stop("http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`.") + } + } + ) +) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/r/element.mustache b/modules/swagger-codegen/src/main/resources/r/element.mustache new file mode 100644 index 00000000000..c8b6632f72c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/r/element.mustache @@ -0,0 +1,24 @@ +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/r/model.mustache b/modules/swagger-codegen/src/main/resources/r/model.mustache index bcdbf152b5e..9181c8e51e2 100644 --- a/modules/swagger-codegen/src/main/resources/r/model.mustache +++ b/modules/swagger-codegen/src/main/resources/r/model.mustache @@ -2,8 +2,14 @@ {{#model}} {{>partial_header}} - #' {{classname}} Class +#' +{{#vars}} +#' @field {{baseName}} {{title}} +{{/vars}} +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export {{classname}} <- R6::R6Class( '{{classname}}', @@ -37,8 +43,7 @@ stopifnot(is.character(`{{baseName}}`), length(`{{baseName}}`) == 1) {{/isDateTime}} {{^isPrimitiveType}} - stopifnot(is.list(tags), length(tags) != 0) - lapply(`{{baseName}}`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + stopifnot(R6::is.R6(`{{baseName}}`)) {{/isPrimitiveType}} {{/isListContainer}} {{#isListContainer}} @@ -47,8 +52,8 @@ lapply(`{{baseName}}`, function(x) stopifnot(is.character(x))) {{/isPrimitiveType}} {{^isPrimitiveType}} - stopifnot(is.list(tags), length(tags) != 0) - lapply(`{{baseName}}`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + stopifnot(is.list(`{{baseName}}`), length(`{{baseName}}`) != 0) + lapply(`{{baseName}}`, function(x) stopifnot(R6::is.R6(x))) {{/isPrimitiveType}} {{/isListContainer}} self$`{{baseName}}` <- `{{baseName}}` @@ -56,6 +61,40 @@ {{/vars}} }, toJSON = function() { + {{classname}}Object <- list() + {{#vars}} + if (!is.null(self$`{{baseName}}`)) { + {{classname}}Object[['{{baseName}}']] <- {{#isListContainer}}{{#isPrimitiveType}}self$`{{baseName}}`{{/isPrimitiveType}}{{^isPrimitiveType}}lapply(self$`{{baseName}}`, function(x) x$toJSON()){{/isPrimitiveType}}{{/isListContainer}}{{^isListContainer}}self$`{{baseName}}`{{^isPrimitiveType}}$toJSON(){{/isPrimitiveType}}{{/isListContainer}} + } + {{/vars}} + + {{classname}}Object + }, + fromJSON = function({{classname}}Json) { + {{classname}}Object <- jsonlite::fromJSON({{classname}}Json) + {{#vars}} + if (!is.null({{classname}}Object$`{{baseName}}`)) { + {{#isPrimitiveType}} + self$`{{baseName}}` <- {{classname}}Object$`{{baseName}}` + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isListContainer}} + self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) { + {{baseName}}Object <- {{datatype}}$new() + {{baseName}}Object$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)) + {{baseName}}Object + }) + {{/isListContainer}} + {{^isListContainer}} + {{baseName}}Object <- {{datatype}}$new() + {{baseName}}Object$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName}}, auto_unbox = TRUE)) + self$`{{baseName}}` <- {{baseName}}Object + {{/isListContainer}} + {{/isPrimitiveType}} + } + {{/vars}} + }, + toJSONString = function() { sprintf( '{ {{#vars}} @@ -77,7 +116,7 @@ {{/vars}} ) }, - fromJSON = function({{classname}}Json) { + fromJSONString = function({{classname}}Json) { {{classname}}Object <- jsonlite::fromJSON({{classname}}Json) {{#vars}} {{#isPrimitiveType}} @@ -85,56 +124,16 @@ {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isListContainer}} - self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) {{datatype}}$new()$fromJSON(jsonlite::toJSON(x))) + self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) {{datatype}}$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))) {{/isListContainer}} {{^isListContainer}} - self$`{{baseName}}` <- {{datatype}}$new()$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName}})) + {{datatype}}Object -> {{datatype}}$new() + self$`{{baseName}}` <- {{datatype}}Object$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName}}, auto_unbox = TRUE)) {{/isListContainer}} {{/isPrimitiveType}} {{/vars}} } ) ) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response - } - ) -) {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/r/response.mustache b/modules/swagger-codegen/src/main/resources/r/response.mustache new file mode 100644 index 00000000000..42873beb4e6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/r/response.mustache @@ -0,0 +1,15 @@ +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) \ No newline at end of file diff --git a/samples/client/petstore/r_test/R/ApiClient.r b/samples/client/petstore/r_test/R/ApiClient.r new file mode 100644 index 00000000000..70c09f6f782 --- /dev/null +++ b/samples/client/petstore/r_test/R/ApiClient.r @@ -0,0 +1,71 @@ +# 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 +# Generated by: https://github.com/swagger-api/swagger-codegen.git + + +#' ApiClient Class +#' +#' Generic API client for Swagger client library builds. +#' Swagger generic API client. This client handles the client- +#' server communication, and is invariant across implementations. Specifics of +#' the methods and models for each application are generated from the Swagger +#' templates. +#' +#' NOTE: This class is auto generated by the swagger code generator program. +#' Ref: https://github.com/swagger-api/swagger-codegen +#' Do not edit the class manually. +#' +#' @export +ApiClient <- R6::R6Class( + 'ApiClient', + public = list( + basePath = "http://petstore.swagger.io/v2", + configuration = NULL, + userAgent = NULL, + defaultHeaders = NULL, + initialize = function(basePath, configuration, defaultHeaders){ + if (!missing(basePath)) { + self$basePath <- basePath + } + + if (!missing(configuration)) { + self$configuration <- configuration + } + + if (!missing(defaultHeaders)) { + self$defaultHeaders <- defaultHeaders + } + + self$`userAgent` <- 'Swagger-Codegen/1.0.0/r' + }, + callApi = function(url, method, queryParams, headerParams, body, ...){ + headers <- httr::add_headers(headerParams) + + if (method == "GET") { + httr::GET(url, queryParams, headers, ...) + } + else if (method == "POST") { + httr::POST(url, queryParams, headers, body = body, ...) + } + else if (method == "PUT") { + httr::PUT(url, queryParams, headers, body = body, ...) + } + else if (method == "PATCH") { + httr::PATCH(url, queryParams, headers, body = body, ...) + } + else if (method == "HEAD") { + httr::HEAD(url, queryParams, headers, ...) + } + else if (method == "DELETE") { + httr::DELETE(url, queryParams, headers, ...) + } + else { + stop("http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`.") + } + } + ) +) \ No newline at end of file diff --git a/samples/client/petstore/r_test/R/ApiResponse.r b/samples/client/petstore/r_test/R/ApiResponse.r index 1b6c3d578e9..161a765c0a5 100644 --- a/samples/client/petstore/r_test/R/ApiResponse.r +++ b/samples/client/petstore/r_test/R/ApiResponse.r @@ -7,8 +7,14 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' ApiResponse Class +#' +#' @field code +#' @field type +#' @field message +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export ApiResponse <- R6::R6Class( 'ApiResponse', @@ -31,6 +37,32 @@ ApiResponse <- R6::R6Class( } }, toJSON = function() { + ApiResponseObject <- list() + if (!is.null(self$`code`)) { + ApiResponseObject[['code']] <- self$`code` + } + if (!is.null(self$`type`)) { + ApiResponseObject[['type']] <- self$`type` + } + if (!is.null(self$`message`)) { + ApiResponseObject[['message']] <- self$`message` + } + + ApiResponseObject + }, + fromJSON = function(ApiResponseJson) { + ApiResponseObject <- jsonlite::fromJSON(ApiResponseJson) + if (!is.null(ApiResponseObject$`code`)) { + self$`code` <- ApiResponseObject$`code` + } + if (!is.null(ApiResponseObject$`type`)) { + self$`type` <- ApiResponseObject$`type` + } + if (!is.null(ApiResponseObject$`message`)) { + self$`message` <- ApiResponseObject$`message` + } + }, + toJSONString = function() { sprintf( '{ "code": "%s", @@ -42,52 +74,11 @@ ApiResponse <- R6::R6Class( self$`message` ) }, - fromJSON = function(ApiResponseJson) { + fromJSONString = function(ApiResponseJson) { ApiResponseObject <- jsonlite::fromJSON(ApiResponseJson) - self$`code` <- ApiResponseObject`$code` - self$`type` <- ApiResponseObject`$type` - self$`message` <- ApiResponseObject`$message` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`code` <- ApiResponseObject$`code` + self$`type` <- ApiResponseObject$`type` + self$`message` <- ApiResponseObject$`message` } ) ) diff --git a/samples/client/petstore/r_test/R/Category.r b/samples/client/petstore/r_test/R/Category.r index 61884d89ec6..826b6410a88 100644 --- a/samples/client/petstore/r_test/R/Category.r +++ b/samples/client/petstore/r_test/R/Category.r @@ -7,8 +7,13 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' Category Class +#' +#' @field id +#' @field name +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export Category <- R6::R6Class( 'Category', @@ -26,6 +31,26 @@ Category <- R6::R6Class( } }, toJSON = function() { + CategoryObject <- list() + if (!is.null(self$`id`)) { + CategoryObject[['id']] <- self$`id` + } + if (!is.null(self$`name`)) { + CategoryObject[['name']] <- self$`name` + } + + CategoryObject + }, + fromJSON = function(CategoryJson) { + CategoryObject <- jsonlite::fromJSON(CategoryJson) + if (!is.null(CategoryObject$`id`)) { + self$`id` <- CategoryObject$`id` + } + if (!is.null(CategoryObject$`name`)) { + self$`name` <- CategoryObject$`name` + } + }, + toJSONString = function() { sprintf( '{ "id": %d, @@ -35,51 +60,10 @@ Category <- R6::R6Class( self$`name` ) }, - fromJSON = function(CategoryJson) { + fromJSONString = function(CategoryJson) { CategoryObject <- jsonlite::fromJSON(CategoryJson) - self$`id` <- CategoryObject`$id` - self$`name` <- CategoryObject`$name` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`id` <- CategoryObject$`id` + self$`name` <- CategoryObject$`name` } ) ) diff --git a/samples/client/petstore/r_test/R/Element.r b/samples/client/petstore/r_test/R/Element.r new file mode 100644 index 00000000000..c8b6632f72c --- /dev/null +++ b/samples/client/petstore/r_test/R/Element.r @@ -0,0 +1,24 @@ +#' Element Class +#' +#' Element Class +#' @export +Element <- R6::R6Class( + 'Element', + public = list( + id = NULL, + name = NULL, + initialize = function(id,name){ + if (!missing(id)) { + stopifnot(is.numeric(id), length(id) == 1) + self$id <- id + } + if (!missing(name)) { + stopifnot(is.character(name), length(name) == 1) + self$name <- name + } + }, + toJSON = function() { + sprintf('{"id":%d,"name":"%s"}', self$id, self$name) + } + ) +) \ No newline at end of file diff --git a/samples/client/petstore/r_test/R/Order.r b/samples/client/petstore/r_test/R/Order.r index 4a5fc9ac699..73fedcb5f86 100644 --- a/samples/client/petstore/r_test/R/Order.r +++ b/samples/client/petstore/r_test/R/Order.r @@ -7,8 +7,17 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' Order Class +#' +#' @field id +#' @field petId +#' @field quantity +#' @field shipDate +#' @field status +#' @field complete +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export Order <- R6::R6Class( 'Order', @@ -45,6 +54,50 @@ Order <- R6::R6Class( } }, toJSON = function() { + OrderObject <- list() + if (!is.null(self$`id`)) { + OrderObject[['id']] <- self$`id` + } + if (!is.null(self$`petId`)) { + OrderObject[['petId']] <- self$`petId` + } + if (!is.null(self$`quantity`)) { + OrderObject[['quantity']] <- self$`quantity` + } + if (!is.null(self$`shipDate`)) { + OrderObject[['shipDate']] <- self$`shipDate` + } + if (!is.null(self$`status`)) { + OrderObject[['status']] <- self$`status` + } + if (!is.null(self$`complete`)) { + OrderObject[['complete']] <- self$`complete` + } + + OrderObject + }, + fromJSON = function(OrderJson) { + OrderObject <- jsonlite::fromJSON(OrderJson) + if (!is.null(OrderObject$`id`)) { + self$`id` <- OrderObject$`id` + } + if (!is.null(OrderObject$`petId`)) { + self$`petId` <- OrderObject$`petId` + } + if (!is.null(OrderObject$`quantity`)) { + self$`quantity` <- OrderObject$`quantity` + } + if (!is.null(OrderObject$`shipDate`)) { + self$`shipDate` <- OrderObject$`shipDate` + } + if (!is.null(OrderObject$`status`)) { + self$`status` <- OrderObject$`status` + } + if (!is.null(OrderObject$`complete`)) { + self$`complete` <- OrderObject$`complete` + } + }, + toJSONString = function() { sprintf( '{ "id": %d, @@ -62,55 +115,14 @@ Order <- R6::R6Class( self$`complete` ) }, - fromJSON = function(OrderJson) { + fromJSONString = function(OrderJson) { OrderObject <- jsonlite::fromJSON(OrderJson) - self$`id` <- OrderObject`$id` - self$`petId` <- OrderObject`$petId` - self$`quantity` <- OrderObject`$quantity` - self$`shipDate` <- OrderObject`$shipDate` - self$`status` <- OrderObject`$status` - self$`complete` <- OrderObject`$complete` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`id` <- OrderObject$`id` + self$`petId` <- OrderObject$`petId` + self$`quantity` <- OrderObject$`quantity` + self$`shipDate` <- OrderObject$`shipDate` + self$`status` <- OrderObject$`status` + self$`complete` <- OrderObject$`complete` } ) ) diff --git a/samples/client/petstore/r_test/R/Pet.r b/samples/client/petstore/r_test/R/Pet.r index 45ed0edca97..98ba5d747e5 100644 --- a/samples/client/petstore/r_test/R/Pet.r +++ b/samples/client/petstore/r_test/R/Pet.r @@ -7,8 +7,17 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' Pet Class +#' +#' @field id +#' @field category +#' @field name +#' @field photoUrls +#' @field tags +#' @field status +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export Pet <- R6::R6Class( 'Pet', @@ -25,8 +34,7 @@ Pet <- R6::R6Class( self$`id` <- `id` } if (!missing(`category`)) { - stopifnot(is.list(tags), length(tags) != 0) - lapply(`category`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + stopifnot(R6::is.R6(`category`)) self$`category` <- `category` } if (!missing(`name`)) { @@ -39,8 +47,8 @@ Pet <- R6::R6Class( self$`photoUrls` <- `photoUrls` } if (!missing(`tags`)) { - stopifnot(is.list(tags), length(tags) != 0) - lapply(`tags`, function(x) stopifnot("Element" %in% class(x), !is.list(x))) + stopifnot(is.list(`tags`), length(`tags`) != 0) + lapply(`tags`, function(x) stopifnot(R6::is.R6(x))) self$`tags` <- `tags` } if (!missing(`status`)) { @@ -49,6 +57,56 @@ Pet <- R6::R6Class( } }, toJSON = function() { + PetObject <- list() + if (!is.null(self$`id`)) { + PetObject[['id']] <- self$`id` + } + if (!is.null(self$`category`)) { + PetObject[['category']] <- self$`category`$toJSON() + } + if (!is.null(self$`name`)) { + PetObject[['name']] <- self$`name` + } + if (!is.null(self$`photoUrls`)) { + PetObject[['photoUrls']] <- self$`photoUrls` + } + if (!is.null(self$`tags`)) { + PetObject[['tags']] <- lapply(self$`tags`, function(x) x$toJSON()) + } + if (!is.null(self$`status`)) { + PetObject[['status']] <- self$`status` + } + + PetObject + }, + fromJSON = function(PetJson) { + PetObject <- jsonlite::fromJSON(PetJson) + if (!is.null(PetObject$`id`)) { + self$`id` <- PetObject$`id` + } + if (!is.null(PetObject$`category`)) { + categoryObject <- Category$new() + categoryObject$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE)) + self$`category` <- categoryObject + } + if (!is.null(PetObject$`name`)) { + self$`name` <- PetObject$`name` + } + if (!is.null(PetObject$`photoUrls`)) { + self$`photoUrls` <- PetObject$`photoUrls` + } + if (!is.null(PetObject$`tags`)) { + self$`tags` <- lapply(PetObject$`tags`, function(x) { + tagsObject <- Tag$new() + tagsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)) + tagsObject + }) + } + if (!is.null(PetObject$`status`)) { + self$`status` <- PetObject$`status` + } + }, + toJSONString = function() { sprintf( '{ "id": %d, @@ -66,55 +124,15 @@ Pet <- R6::R6Class( self$`status` ) }, - fromJSON = function(PetJson) { + fromJSONString = function(PetJson) { PetObject <- jsonlite::fromJSON(PetJson) - self$`id` <- PetObject`$id` - self$`category` <- Category$new()$fromJSON(jsonlite::toJSON(PetObject${{baseName})) - self$`name` <- PetObject`$name` - self$`photoUrls` <- PetObject`$photoUrls` - self$`tags` <- lapply(PetObject$`tags`, function(x) Tag$new()$fromJSON(jsonlite::toJSON(x)) - self$`status` <- PetObject`$status` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`id` <- PetObject$`id` + CategoryObject -> Category$new() + self$`category` <- CategoryObject$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE)) + self$`name` <- PetObject$`name` + self$`photoUrls` <- PetObject$`photoUrls` + self$`tags` <- lapply(PetObject$`tags`, function(x) Tag$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))) + self$`status` <- PetObject$`status` } ) ) diff --git a/samples/client/petstore/r_test/R/PetApi.r b/samples/client/petstore/r_test/R/PetApi.r index 8fa18a7efc6..6fa5c30cfb4 100644 --- a/samples/client/petstore/r_test/R/PetApi.r +++ b/samples/client/petstore/r_test/R/PetApi.r @@ -6,144 +6,288 @@ # Contact: apiteam@swagger.io # Generated by: https://github.com/swagger-api/swagger-codegen.git +#' @title Pet operations +#' @description petstore.Pet +#' +#' @field path Stores url path of the request. +#' @field apiClient Handles the client-server communication. +#' @field userAgent Set the user agent of the request. +#' +#' @importFrom R6 R6Class +#' +#' @section Methods: +#' \describe{ +#' +#' add_pet Add a new pet to the store +#' +#' +#' delete_pet Deletes a pet +#' +#' +#' find_pets_by_status Finds Pets by status +#' +#' +#' find_pets_by_tags Finds Pets by tags +#' +#' +#' get_pet_by_id Find pet by ID +#' +#' +#' update_pet Update an existing pet +#' +#' +#' update_pet_with_form Updates a pet in the store with form data +#' +#' +#' upload_file uploads an image +#' +#' } +#' +#' @export PetApi <- R6::R6Class( 'PetApi', public = list( userAgent = "Swagger-Codegen/1.0.0/r", - basePath = "http://petstore.swagger.io/v2", - initialize = function(basePath){ - if (!missing(basePath)) { - stopifnot(is.character(basePath), length(basePath) == 1) - self$basePath <- basePath + apiClient = NULL, + initialize = function(apiClient){ + if (!missing(apiClient)) { + self$apiClient <- apiClient + } + else { + self$apiClient <- ApiClient$new() } }, + add_pet = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } - add_pet = function(body){ - resp <- httr::POST(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/json", "content-type" = "application/xml") - ,body = body$toJSON() - ) + urlPath <- "/pet" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - delete_pet = function(pet_id, api_key){ - resp <- httr::DELETE(paste0(self$basePath, pet_id), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml", "api_key" = api_key) - ) + delete_pet = function(pet_id, api_key, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`api_key`)) { + headerParams['api_key'] <- `api_key` + } + + urlPath <- "/pet/{petId}" + if (!missing(`pet_id`)) { + urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet_id`, urlPath) + } + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "DELETE", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - find_pets_by_status = function(status){ - resp <- httr::GET(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,query = list( - "status" = status - ) + find_pets_by_status = function(status, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`status`)) { + queryParams['status'] <- status + } + + urlPath <- "/pet/findByStatus" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Pet$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - find_pets_by_tags = function(tags){ - resp <- httr::GET(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,query = list( - "tags" = tags - ) + find_pets_by_tags = function(tags, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`tags`)) { + queryParams['tags'] <- tags + } + + urlPath <- "/pet/findByTags" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Pet$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - get_pet_by_id = function(pet_id){ - resp <- httr::GET(paste0(self$basePath, pet_id), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + get_pet_by_id = function(pet_id, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + urlPath <- "/pet/{petId}" + if (!missing(`pet_id`)) { + urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet_id`, urlPath) + } + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Pet$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Pet$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - update_pet = function(body){ - resp <- httr::PUT(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/json", "content-type" = "application/xml") - ,body = body$toJSON() - ) + update_pet = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } + + urlPath <- "/pet" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "PUT", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - update_pet_with_form = function(pet_id, name, status){ - resp <- httr::POST(paste0(self$basePath, pet_id), - httr::add_headers("User-Agent" = self$userAgent, "accept" = "application/x-www-form-urlencoded", "content-type" = "application/xml") - ,body = list( - "name" = name, - "status" = status - ) - ) + update_pet_with_form = function(pet_id, name, status, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + body <- list( + "name" = name, + "status" = status + ) + urlPath <- "/pet/{petId}" + if (!missing(`pet_id`)) { + urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet_id`, urlPath) + } + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - upload_file = function(pet_id, additional_metadata, file){ - resp <- httr::POST(paste0(self$basePath, pet_id), - httr::add_headers("User-Agent" = self$userAgent, "accept" = "multipart/form-data", "content-type" = "application/json") - ,body = list( - "additionalMetadata" = additional_metadata, - "file" = httr::upload_file(file) - ) - ) + upload_file = function(pet_id, additional_metadata, file, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + body <- list( + "additionalMetadata" = additional_metadata, + "file" = httr::upload_file(file) + ) + + urlPath <- "/pet/{petId}/uploadImage" + if (!missing(`pet_id`)) { + urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet_id`, urlPath) + } + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- ApiResponse$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- ApiResponse$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } diff --git a/samples/client/petstore/r_test/R/Response.r b/samples/client/petstore/r_test/R/Response.r new file mode 100644 index 00000000000..42873beb4e6 --- /dev/null +++ b/samples/client/petstore/r_test/R/Response.r @@ -0,0 +1,15 @@ +#' Response Class +#' +#' Response Class +#' @export +Response <- R6::R6Class( + 'Response', + public = list( + content = NULL, + response = NULL, + initialize = function(content, response){ + self$content <- content + self$response <- response + } + ) +) \ No newline at end of file diff --git a/samples/client/petstore/r_test/R/StoreApi.r b/samples/client/petstore/r_test/R/StoreApi.r index 944efdf6602..b03a50e9ae8 100644 --- a/samples/client/petstore/r_test/R/StoreApi.r +++ b/samples/client/petstore/r_test/R/StoreApi.r @@ -6,74 +6,152 @@ # Contact: apiteam@swagger.io # Generated by: https://github.com/swagger-api/swagger-codegen.git +#' @title Store operations +#' @description petstore.Store +#' +#' @field path Stores url path of the request. +#' @field apiClient Handles the client-server communication. +#' @field userAgent Set the user agent of the request. +#' +#' @importFrom R6 R6Class +#' +#' @section Methods: +#' \describe{ +#' +#' delete_order Delete purchase order by ID +#' +#' +#' get_inventory Returns pet inventories by status +#' +#' +#' get_order_by_id Find purchase order by ID +#' +#' +#' place_order Place an order for a pet +#' +#' } +#' +#' @export StoreApi <- R6::R6Class( 'StoreApi', public = list( userAgent = "Swagger-Codegen/1.0.0/r", - basePath = "http://petstore.swagger.io/v2", - initialize = function(basePath){ - if (!missing(basePath)) { - stopifnot(is.character(basePath), length(basePath) == 1) - self$basePath <- basePath + apiClient = NULL, + initialize = function(apiClient){ + if (!missing(apiClient)) { + self$apiClient <- apiClient + } + else { + self$apiClient <- ApiClient$new() } }, + delete_order = function(order_id, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() - delete_order = function(order_id){ - resp <- httr::DELETE(paste0(self$basePath, order_id), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + urlPath <- "/store/order/{orderId}" + if (!missing(`order_id`)) { + urlPath <- gsub(paste0("\\{", "orderId", "\\}"), `order_id`, urlPath) + } + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "DELETE", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - get_inventory = function(){ - resp <- httr::GET(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/json") - ) + get_inventory = function(...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + urlPath <- "/store/inventory" + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Integer$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Integer$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - get_order_by_id = function(order_id){ - resp <- httr::GET(paste0(self$basePath, order_id), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + get_order_by_id = function(order_id, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + urlPath <- "/store/order/{orderId}" + if (!missing(`order_id`)) { + urlPath <- gsub(paste0("\\{", "orderId", "\\}"), `order_id`, urlPath) + } + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Order$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Order$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - place_order = function(body){ - resp <- httr::POST(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,body = body$toJSON() - ) + place_order = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } + + urlPath <- "/store/order" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Order$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Order$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } diff --git a/samples/client/petstore/r_test/R/Tag.r b/samples/client/petstore/r_test/R/Tag.r index b874ac65b44..13501d24f1b 100644 --- a/samples/client/petstore/r_test/R/Tag.r +++ b/samples/client/petstore/r_test/R/Tag.r @@ -7,8 +7,13 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' Tag Class +#' +#' @field id +#' @field name +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export Tag <- R6::R6Class( 'Tag', @@ -26,6 +31,26 @@ Tag <- R6::R6Class( } }, toJSON = function() { + TagObject <- list() + if (!is.null(self$`id`)) { + TagObject[['id']] <- self$`id` + } + if (!is.null(self$`name`)) { + TagObject[['name']] <- self$`name` + } + + TagObject + }, + fromJSON = function(TagJson) { + TagObject <- jsonlite::fromJSON(TagJson) + if (!is.null(TagObject$`id`)) { + self$`id` <- TagObject$`id` + } + if (!is.null(TagObject$`name`)) { + self$`name` <- TagObject$`name` + } + }, + toJSONString = function() { sprintf( '{ "id": %d, @@ -35,51 +60,10 @@ Tag <- R6::R6Class( self$`name` ) }, - fromJSON = function(TagJson) { + fromJSONString = function(TagJson) { TagObject <- jsonlite::fromJSON(TagJson) - self$`id` <- TagObject`$id` - self$`name` <- TagObject`$name` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`id` <- TagObject$`id` + self$`name` <- TagObject$`name` } ) ) diff --git a/samples/client/petstore/r_test/R/User.r b/samples/client/petstore/r_test/R/User.r index 07f46ed860e..4c45fb8c00e 100644 --- a/samples/client/petstore/r_test/R/User.r +++ b/samples/client/petstore/r_test/R/User.r @@ -7,8 +7,19 @@ # Generated by: https://github.com/swagger-api/swagger-codegen.git - #' User Class +#' +#' @field id +#' @field username +#' @field firstName +#' @field lastName +#' @field email +#' @field password +#' @field phone +#' @field userStatus +#' +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON #' @export User <- R6::R6Class( 'User', @@ -56,6 +67,62 @@ User <- R6::R6Class( } }, toJSON = function() { + UserObject <- list() + if (!is.null(self$`id`)) { + UserObject[['id']] <- self$`id` + } + if (!is.null(self$`username`)) { + UserObject[['username']] <- self$`username` + } + if (!is.null(self$`firstName`)) { + UserObject[['firstName']] <- self$`firstName` + } + if (!is.null(self$`lastName`)) { + UserObject[['lastName']] <- self$`lastName` + } + if (!is.null(self$`email`)) { + UserObject[['email']] <- self$`email` + } + if (!is.null(self$`password`)) { + UserObject[['password']] <- self$`password` + } + if (!is.null(self$`phone`)) { + UserObject[['phone']] <- self$`phone` + } + if (!is.null(self$`userStatus`)) { + UserObject[['userStatus']] <- self$`userStatus` + } + + UserObject + }, + fromJSON = function(UserJson) { + UserObject <- jsonlite::fromJSON(UserJson) + if (!is.null(UserObject$`id`)) { + self$`id` <- UserObject$`id` + } + if (!is.null(UserObject$`username`)) { + self$`username` <- UserObject$`username` + } + if (!is.null(UserObject$`firstName`)) { + self$`firstName` <- UserObject$`firstName` + } + if (!is.null(UserObject$`lastName`)) { + self$`lastName` <- UserObject$`lastName` + } + if (!is.null(UserObject$`email`)) { + self$`email` <- UserObject$`email` + } + if (!is.null(UserObject$`password`)) { + self$`password` <- UserObject$`password` + } + if (!is.null(UserObject$`phone`)) { + self$`phone` <- UserObject$`phone` + } + if (!is.null(UserObject$`userStatus`)) { + self$`userStatus` <- UserObject$`userStatus` + } + }, + toJSONString = function() { sprintf( '{ "id": %d, @@ -77,57 +144,16 @@ User <- R6::R6Class( self$`userStatus` ) }, - fromJSON = function(UserJson) { + fromJSONString = function(UserJson) { UserObject <- jsonlite::fromJSON(UserJson) - self$`id` <- UserObject`$id` - self$`username` <- UserObject`$username` - self$`firstName` <- UserObject`$firstName` - self$`lastName` <- UserObject`$lastName` - self$`email` <- UserObject`$email` - self$`password` <- UserObject`$password` - self$`phone` <- UserObject`$phone` - self$`userStatus` <- UserObject`$userStatus` - } - ) -) - -#' Element Class -#' -#' Element Class -#' @export -Element <- R6::R6Class( - 'Element', - public = list( - id = NULL, - name = NULL, - initialize = function(id,name){ - if (!missing(id)) { - stopifnot(is.numeric(id), length(id) == 1) - self$id <- id - } - if (!missing(name)) { - stopifnot(is.character(name), length(name) == 1) - self$name <- name - } - }, - toJSON = function() { - sprintf('{"id":%d,"name":"%s"}', self$id, self$name) - } - ) -) - -#' Response Class -#' -#' Response Class -#' @export -Response <- R6::R6Class( - 'Response', - public = list( - content = NULL, - response = NULL, - initialize = function(content, response){ - self$content <- content - self$response <- response + self$`id` <- UserObject$`id` + self$`username` <- UserObject$`username` + self$`firstName` <- UserObject$`firstName` + self$`lastName` <- UserObject$`lastName` + self$`email` <- UserObject$`email` + self$`password` <- UserObject$`password` + self$`phone` <- UserObject$`phone` + self$`userStatus` <- UserObject$`userStatus` } ) ) diff --git a/samples/client/petstore/r_test/R/UserApi.r b/samples/client/petstore/r_test/R/UserApi.r index a9a8f15be6f..1ed17ab286f 100644 --- a/samples/client/petstore/r_test/R/UserApi.r +++ b/samples/client/petstore/r_test/R/UserApi.r @@ -6,135 +6,276 @@ # Contact: apiteam@swagger.io # Generated by: https://github.com/swagger-api/swagger-codegen.git +#' @title User operations +#' @description petstore.User +#' +#' @field path Stores url path of the request. +#' @field apiClient Handles the client-server communication. +#' @field userAgent Set the user agent of the request. +#' +#' @importFrom R6 R6Class +#' +#' @section Methods: +#' \describe{ +#' +#' create_user Create user +#' +#' +#' create_users_with_array_input Creates list of users with given input array +#' +#' +#' create_users_with_list_input Creates list of users with given input array +#' +#' +#' delete_user Delete user +#' +#' +#' get_user_by_name Get user by user name +#' +#' +#' login_user Logs user into the system +#' +#' +#' logout_user Logs out current logged in user session +#' +#' +#' update_user Updated user +#' +#' } +#' +#' @export UserApi <- R6::R6Class( 'UserApi', public = list( userAgent = "Swagger-Codegen/1.0.0/r", - basePath = "http://petstore.swagger.io/v2", - initialize = function(basePath){ - if (!missing(basePath)) { - stopifnot(is.character(basePath), length(basePath) == 1) - self$basePath <- basePath + apiClient = NULL, + initialize = function(apiClient){ + if (!missing(apiClient)) { + self$apiClient <- apiClient + } + else { + self$apiClient <- ApiClient$new() } }, + create_user = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } - create_user = function(body){ - resp <- httr::POST(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,body = body$toJSON() - ) + urlPath <- "/user" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - create_users_with_array_input = function(body){ - resp <- httr::POST(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,body = body$toJSON() - ) + create_users_with_array_input = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } + urlPath <- "/user/createWithArray" + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - create_users_with_list_input = function(body){ - resp <- httr::POST(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,body = body$toJSON() - ) + create_users_with_list_input = function(body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } + urlPath <- "/user/createWithList" + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "POST", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - delete_user = function(username){ - resp <- httr::DELETE(paste0(self$basePath, username), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + delete_user = function(username, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + + urlPath <- "/user/{username}" + if (!missing(`username`)) { + urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath) + } + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "DELETE", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - get_user_by_name = function(username){ - resp <- httr::GET(paste0(self$basePath, username), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + get_user_by_name = function(username, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + urlPath <- "/user/{username}" + if (!missing(`username`)) { + urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath) + } + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- User$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- User$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - login_user = function(username, password){ - resp <- httr::GET(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,query = list( - "username" = username, - "password" = password - ) + login_user = function(username, password, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`username`)) { + queryParams['username'] <- username + } + if (!missing(`password`)) { + queryParams['password'] <- password + } + + urlPath <- "/user/login" + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { - result <- Character$new()$fromJSON(httr::content(resp, "text", encoding = "UTF-8"), simplifyVector = FALSE) - Response$new(result, resp) - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + returnObject <- Character$new() + result <- returnObject$fromJSON(httr::content(resp, "text", encoding = "UTF-8")) + Response$new(returnObject, resp) + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - logout_user = function(){ - resp <- httr::GET(paste0(self$basePath), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ) + logout_user = function(...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + urlPath <- "/user/logout" + + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "GET", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } }, - update_user = function(username, body){ - resp <- httr::PUT(paste0(self$basePath, username), - httr::add_headers("User-Agent" = self$userAgent, "content-type" = "application/xml") - ,body = body$toJSON() - ) + update_user = function(username, body, ...){ + args <- list(...) + body <- NULL + queryParams <- list() + headerParams <- character() + if (!missing(`body`)) { + body <- `body`$toJSON() + } + + urlPath <- "/user/{username}" + if (!missing(`username`)) { + urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath) + } + resp <- self$apiClient$callApi(url = paste0(self$apiClient$basePath, urlPath), + method = "PUT", + queryParams = queryParams, + headerParams = headerParams, + body = body, + ...) + if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { # void response, no need to return anything - } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499){ + } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { Response$new("API client error", resp) - } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599){ + } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { Response$new("API server error", resp) } diff --git a/samples/client/petstore/r_test/README.md b/samples/client/petstore/r_test/README.md index 88b32f0758f..c4b8e4bf0e7 100644 --- a/samples/client/petstore/r_test/README.md +++ b/samples/client/petstore/r_test/README.md @@ -10,8 +10,22 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge - Build package: io.swagger.codegen.languages.RClientCodegen ## Installation - -TODO +You'll need the `devtools` package in order to build the API. +Make sure you have a proper CRAN repository from which you can download packages. + +### Prerequisites +Install the `devtools` package with the following command. +```R +if(!require(devtools)) { install.packages("devtools") } +``` + +### Installation of the API package +Make sure you set the working directory to where the API code is located. +Then execute +```R +library(devtools) +install(".") +``` ## Author From 2e5289c4d74eafd48e3a324ccdd9e39323b5fb06 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 5 Oct 2017 23:07:53 +0800 Subject: [PATCH 110/197] add link to MS machine learning server --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a86fbe493d4..681250fd0e7 100644 --- a/README.md +++ b/README.md @@ -896,6 +896,7 @@ Presentations/Videos/Tutorials/Books - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) +- 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) # Swagger Codegen Core Team From 2644adb7a3b25ba68794b4862107733eb4f92b99 Mon Sep 17 00:00:00 2001 From: Gareth T Date: Thu, 5 Oct 2017 21:10:31 -0400 Subject: [PATCH 111/197] Note precisely which clients and servers can be used with Haskell. (#6625) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 681250fd0e7..65b75e632b6 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ ## Overview 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, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **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**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) +- **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **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), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** From 86803c0c2404a6a8c8ea9aef97e271c3ab02ebc8 Mon Sep 17 00:00:00 2001 From: niku Date: Fri, 6 Oct 2017 10:16:27 +0900 Subject: [PATCH 112/197] [Elixir] Improve Elixir Client about primitive type spec (#6623) Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.Float':t/0 :0: Unknown type 'Elixir.Integer':t/0 ``` --- .../languages/ElixirClientCodegen.java | 23 ++++++++++++++++--- .../elixir/lib/swagger_petstore/api/fake.ex | 2 +- .../elixir/lib/swagger_petstore/api/pet.ex | 8 +++---- .../elixir/lib/swagger_petstore/api/store.ex | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java index 0df169706b7..90677e090fb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java @@ -590,9 +590,26 @@ private void buildTypespec(CodegenParameter param, StringBuilder sb) { buildTypespec(param.items, sb); sb.append("}"); } else if (param.isPrimitiveType) { - // .t - sb.append(param.dataType); - sb.append(".t"); + // () OR .t + + // Primitive types in Elixir + // https://hexdocs.pm/elixir/1.5.2/typespecs.html#types-and-their-syntax + // + // NOTE: List, Tuple and Map are declared as primitive in a variable `languageSpecificPrimitives`. + HashMap map = new HashMap(); + map.put("Integer", "integer()"); + map.put("Float", "float()"); + map.put("Boolean", "boolean()"); + map.put("String", "String.t"); + map.put("List", "list()"); + map.put("Atom", "atom()"); + map.put("Map", "map()"); + map.put("Tuple", "tuple()"); + map.put("PID", "pid()"); + map.put("DateTime", "DateTime.t"); + + String dataType = (String) map.get(param.dataType); + sb.append(dataType); } else if (param.isFile) { sb.append("String.t"); } else { diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index 0f9468166dc..1cc31a0764e 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -177,7 +177,7 @@ defmodule SwaggerPetstore.Api.Fake do {:ok, %{}} on success {:error, info} on failure """ - @spec test_endpoint_parameters(Tesla.Env.client, Float.t, Float.t, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + @spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do optional_params = %{ :"integer" => :form, diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex index 5396ccbc1a1..35024beef37 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex @@ -53,7 +53,7 @@ defmodule SwaggerPetstore.Api.Pet do {:ok, %{}} on success {:error, info} on failure """ - @spec delete_pet(Tesla.Env.client, Integer.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + @spec delete_pet(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def delete_pet(connection, pet_id, opts \\ []) do optional_params = %{ :"api_key" => :headers @@ -134,7 +134,7 @@ defmodule SwaggerPetstore.Api.Pet do {:ok, %SwaggerPetstore.Model.Pet{}} on success {:error, info} on failure """ - @spec get_pet_by_id(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.Pet.t} | {:error, Tesla.Env.t} + @spec get_pet_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, SwaggerPetstore.Model.Pet.t} | {:error, Tesla.Env.t} def get_pet_by_id(connection, pet_id, _opts \\ []) do %{} |> method(:get) @@ -187,7 +187,7 @@ defmodule SwaggerPetstore.Api.Pet do {:ok, %{}} on success {:error, info} on failure """ - @spec update_pet_with_form(Tesla.Env.client, Integer.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + @spec update_pet_with_form(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def update_pet_with_form(connection, pet_id, opts \\ []) do optional_params = %{ :"name" => :form, @@ -219,7 +219,7 @@ defmodule SwaggerPetstore.Api.Pet do {:ok, %SwaggerPetstore.Model.ApiResponse{}} on success {:error, info} on failure """ - @spec upload_file(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} + @spec upload_file(Tesla.Env.client, integer(), keyword()) :: {:ok, SwaggerPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} def upload_file(connection, pet_id, opts \\ []) do optional_params = %{ :"additionalMetadata" => :form, diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex index 2e5f0066e44..4ef2cfd3798 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex @@ -75,7 +75,7 @@ defmodule SwaggerPetstore.Api.Store do {:ok, %SwaggerPetstore.Model.Order{}} on success {:error, info} on failure """ - @spec get_order_by_id(Tesla.Env.client, Integer.t, keyword()) :: {:ok, SwaggerPetstore.Model.Order.t} | {:error, Tesla.Env.t} + @spec get_order_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, SwaggerPetstore.Model.Order.t} | {:error, Tesla.Env.t} def get_order_by_id(connection, order_id, _opts \\ []) do %{} |> method(:get) From 2f98ade6939305db942f593d89d5450300fbd8b8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 6 Oct 2017 11:03:15 +0800 Subject: [PATCH 113/197] fix inconsistent java naming (#6624) --- .../languages/AbstractJavaCodegen.java | 28 +++ .../io/swagger/client/api/AnotherFakeApi.java | 30 +++ .../client/api/AnotherFakeApiTest.java | 40 ++++ .../java/jersey1/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 93 +++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../java/jersey2-java6/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 78 ++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../java/jersey2-java8/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 78 ++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../java/jersey2/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 78 ++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 183 ++++++++++++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../java/okhttp-gson/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 183 ++++++++++++++++++ .../client/api/AnotherFakeApiTest.java | 51 +++++ .../docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 84 ++++++++ .../client/api/AnotherFakeApiTest.java | 50 +++++ .../java/resttemplate/docs/AnotherFakeApi.md | 54 ++++++ .../io/swagger/client/api/AnotherFakeApi.java | 84 ++++++++ .../client/api/AnotherFakeApiTest.java | 50 +++++ .../io/swagger/client/api/AnotherFakeApi.java | 41 ++++ .../client/api/AnotherFakeApiTest.java | 39 ++++ 29 files changed, 1877 insertions(+) create mode 100644 samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index a83acffcb25..e9b6394be00 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -13,6 +13,9 @@ import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.google.common.base.Strings; import io.swagger.codegen.CliOption; @@ -42,6 +45,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig { + static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); public static final String FULL_JAVA_UTIL = "fullJavaUtil"; public static final String DEFAULT_LIBRARY = ""; public static final String DATE_LIBRARY = "dateLibrary"; @@ -492,6 +496,19 @@ public String toApiTestFilename(String name) { return toApiName(name) + "Test"; } + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultApi"; + } + return camelize(name) + "Api"; + } + + @Override + public String toApiFilename(String name) { + return toApiName(name); + } + @Override public String toVarName(String name) { // sanitize name @@ -1239,4 +1256,15 @@ public String toBooleanGetter(String name) { return "is" + getterAndSetterCapitalize(name); } + @Override + public String sanitizeTag(String tag) { + tag = camelize(underscore(sanitizeName(tag))); + + // tag starts with numbers + if (tag.matches("^\\d.*")) { + tag = "Class" + tag; + } + return tag; + } + } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..6cef5dde04d --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,30 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.EncodingUtils; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import feign.*; + + +public interface AnotherFakeApi extends ApiClient.Api { + + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + */ + @RequestLine("PATCH /another-fake/dummy") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + Client testSpecialTags(Client body); +} diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..05d765039a2 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,40 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().buildClient(AnotherFakeApi.class); + } + + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } + + +} diff --git a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..b271ac74462 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,93 @@ +/* + * 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: 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; + +import com.sun.jersey.api.client.GenericType; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.model.*; +import io.swagger.client.Pair; + +import io.swagger.client.model.Client; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testSpecialTags(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..494f81b84d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,78 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + +import javax.ws.rs.core.GenericType; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testSpecialTags(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..494f81b84d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,78 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + +import javax.ws.rs.core.GenericType; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testSpecialTags(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..494f81b84d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,78 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiException; +import io.swagger.client.ApiClient; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; + +import javax.ws.rs.core.GenericType; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testSpecialTags(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..e11d4d1a4d0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,183 @@ +/* + * 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: 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; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.Client; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for testSpecialTags + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + } + + + com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public Client testSpecialTags(Client body) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(body); + return resp.getData(); + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return ApiResponse<Client> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * To test special tags (asynchronously) + * To test special tags + * @param body client model (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..e11d4d1a4d0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,183 @@ +/* + * 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: 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; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.Client; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for testSpecialTags + * @param body client model (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + } + + + com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return Client + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public Client testSpecialTags(Client body) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(body); + return resp.getData(); + } + + /** + * To test special tags + * To test special tags + * @param body client model (required) + * @return ApiResponse<Client> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * To test special tags (asynchronously) + * To test special tags + * @param body client model (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..a5339a392d2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * 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: 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; + +import io.swagger.client.ApiException; +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..6992e1f5f42 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,84 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; + + +@Component("io.swagger.client.api.AnotherFakeApi") +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(new ApiClient()); + } + + @Autowired + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + *

200 - successful operation + * @param body client model + * @return Client + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public Client testSpecialTags(Client body) throws RestClientException { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { + "application/json" + }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { + "application/json" + }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } +} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c09af938647 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,50 @@ +/* + * 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: 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; + +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..7a04619aaba --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.AnotherFakeApi; + + +AnotherFakeApi apiInstance = new AnotherFakeApi(); +Client body = new Client(); // Client | client model +try { + Client result = apiInstance.testSpecialTags(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..6992e1f5f42 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,84 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; + + +@Component("io.swagger.client.api.AnotherFakeApi") +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(new ApiClient()); + } + + @Autowired + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags + *

200 - successful operation + * @param body client model + * @return Client + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public Client testSpecialTags(Client body) throws RestClientException { + Object postBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags"); + } + + String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { + "application/json" + }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { + "application/json" + }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..c09af938647 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,50 @@ +/* + * 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: 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; + +import io.swagger.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..a2c326c62c1 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,41 @@ +package io.swagger.client.api; + +import io.swagger.client.CollectionFormats.*; + +import retrofit.Callback; +import retrofit.http.*; +import retrofit.mime.*; + +import io.swagger.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface AnotherFakeApi { + /** + * To test special tags + * Sync method + * To test special tags + * @param body client model (required) + * @return Client + */ + + @PATCH("/another-fake/dummy") + Client testSpecialTags( + @retrofit.http.Body Client body + ); + + /** + * To test special tags + * Async method + * @param body client model (required) + * @param cb callback method + */ + + @PATCH("/another-fake/dummy") + void testSpecialTags( + @retrofit.http.Body Client body, Callback cb + ); +} diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..97a46dba529 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,39 @@ +package io.swagger.client.api; + +import io.swagger.client.ApiClient; +import io.swagger.client.model.Client; +import org.junit.Before; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private AnotherFakeApi api; + + @Before + public void setup() { + api = new ApiClient().createService(AnotherFakeApi.class); + } + + + /** + * To test special tags + * + * To test special tags + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + // Client response = api.testSpecialTags(body); + + // TODO: test validations + } + +} From 42313af7a1b6921fc49eab1e324cedb6a1f9da21 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Fri, 6 Oct 2017 16:56:13 +0900 Subject: [PATCH 114/197] [PHP] Fix: Type object not handled properly in setParameterExampleValue (#6619) * Add test which reproduce the warning #5338 https://github.com/swagger-api/swagger-codegen/issues/5338#issuecomment-292502895 `[main] WARN io.swagger.codegen.languages.PhpClientCodegen - Type object not handled properly in setParameterExampleValue` * Fix Type object not handled properly in setParameterExampleValue * Update samples - /bin/php-petstore.sh - /bin/security/php-petstore.sh --- .../codegen/languages/PhpClientCodegen.java | 2 ++ .../codegen/php/PhpClientExampleTest.java | 19 +++++++++++++++++++ .../lib/Model/ModelInterface.php | 1 - .../lib/ObjectSerializer.php | 4 +++- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpClientExampleTest.java diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index 98420bb37e1..d0a87381cde 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -627,6 +627,8 @@ public void setParameterExampleValue(CodegenParameter p) { example = "2013-10-20T19:20:30+01:00"; } example = "new \\DateTime(\"" + escapeText(example) + "\")"; + } else if ("object".equals(type)) { + example = "new \\stdClass"; } else if (!languageSpecificPrimitives.contains(type)) { // type is a model class, e.g. User example = "new " + getTypeDeclaration(type) + "()"; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpClientExampleTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpClientExampleTest.java new file mode 100644 index 00000000000..6c45ce29da8 --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/php/PhpClientExampleTest.java @@ -0,0 +1,19 @@ +package io.swagger.codegen.php; + +import io.swagger.codegen.CodegenParameter; +import io.swagger.codegen.languages.PhpClientCodegen; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class PhpClientExampleTest { + @Test(description = "sets example value") + public void exampleValueTest() { + PhpClientCodegen clientCodegen = new PhpClientCodegen(); + CodegenParameter p = new CodegenParameter(); + p.baseType = "object"; + + clientCodegen.setParameterExampleValue(p); + Assert.assertEquals(p.example, "new \\stdClass"); + } +} 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 a74455ea5a9..eaad2cf0a95 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,6 @@ * 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 - * */ /** 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 e7b40fe74bb..99fab6e2059 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 @@ -64,7 +64,9 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && method_exists($swaggerType, 'getAllowableEnumValues') + if ($value !== null + && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($swaggerType, 'getAllowableEnumValues') && !in_array($value, $swaggerType::getAllowableEnumValues())) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); From 567ae3fd12428b122e5bc2c3d522105a00ca8145 Mon Sep 17 00:00:00 2001 From: Gareth T Date: Sat, 7 Oct 2017 00:05:48 -0400 Subject: [PATCH 115/197] [GO CLIENT] Fix issue with generating code for API key (#6630) * [GO CLIENT] Fix Go security query parameter generation by using correct string literal and using the Add method. * Add generated files. --- .../src/main/resources/go/api.mustache | 2 +- .../go/.swagger-codegen/VERSION | 1 + .../petstore-security-test/go/api_client.go | 5 + .../client/petstore/go/go-petstore/README.md | 14 ++- .../go/go-petstore/another_fake_api.go | 93 +++++++++++++++++++ .../petstore/go/go-petstore/api_client.go | 6 +- .../go/go-petstore/docs/AnotherFakeApi.md | 36 +++++++ .../docs/FakeClassnameTags123Api.md | 35 +++++++ .../petstore/go/go-petstore/docs/StoreApi.md | 2 +- .../go-petstore/fake_classname_tags123_api.go | 22 ++++- 10 files changed, 206 insertions(+), 10 deletions(-) create mode 100644 samples/client/petstore-security-test/go/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/go/go-petstore/another_fake_api.go create mode 100644 samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index d02bb0a75e0..57c07808b4e 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -196,7 +196,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C } else { key = auth.Key } - {{#isKeyInHeader}}localVarHeaderParams["{{keyParamName}}"] = key{{/isKeyInHeader}}{{#isKeyInQuery}}localVarQueryParams['{{keyParamName}}'] = key{{/isKeyInQuery}} + {{#isKeyInHeader}}localVarHeaderParams["{{keyParamName}}"] = key{{/isKeyInHeader}}{{#isKeyInQuery}}localVarQueryParams.Add("{{keyParamName}}", key){{/isKeyInQuery}} } } {{/isApiKey}} diff --git a/samples/client/petstore-security-test/go/.swagger-codegen/VERSION b/samples/client/petstore-security-test/go/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/go/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/go/api_client.go b/samples/client/petstore-security-test/go/api_client.go index 98cbc1f1c26..948f60420ea 100644 --- a/samples/client/petstore-security-test/go/api_client.go +++ b/samples/client/petstore-security-test/go/api_client.go @@ -255,6 +255,11 @@ func (c *APIClient) prepareRequest ( } 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) diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index d13ca8c1b41..41a3a1ab7cb 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -21,6 +21,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **Patch** /another-fake/dummy | To test special tags *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | @@ -29,7 +30,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data -*Fake_classname_tags123Api* | [**TestClassname**](docs/Fake_classname_tags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status @@ -97,6 +98,17 @@ Class | Method | HTTP request | Description ## api_key - **Type**: API key +Example +``` + auth := context.WithValue(context.TODO(), 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.TODO(), sw.ContextAPIKey, sw.APIKey{ diff --git a/samples/client/petstore/go/go-petstore/another_fake_api.go b/samples/client/petstore/go/go-petstore/another_fake_api.go new file mode 100644 index 00000000000..7953340a72e --- /dev/null +++ b/samples/client/petstore/go/go-petstore/another_fake_api.go @@ -0,0 +1,93 @@ +/* + * 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: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package petstore + +import ( + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" +) + +// Linger please +var ( + _ context.Context +) + +type AnotherFakeApiService service + + +/* AnotherFakeApiService To test special tags + To test special tags + + @param body client model + @return Client*/ +func (a *AnotherFakeApiService) TestSpecialTags(body Client) (Client, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + 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 06a8add219d..3827a42128d 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -44,8 +44,9 @@ type APIClient struct { common service // Reuse a single struct instead of allocating one for each service on the heap. // API Services + AnotherFakeApi *AnotherFakeApiService FakeApi *FakeApiService - Fake_classname_tags123Api *Fake_classname_tags123ApiService + FakeClassnameTags123Api *FakeClassnameTags123ApiService PetApi *PetApiService StoreApi *StoreApiService UserApi *UserApiService @@ -67,8 +68,9 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) c.FakeApi = (*FakeApiService)(&c.common) - c.Fake_classname_tags123Api = (*Fake_classname_tags123ApiService)(&c.common) + c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) c.PetApi = (*PetApiService)(&c.common) c.StoreApi = (*StoreApiService)(&c.common) c.UserApi = (*UserApiService)(&c.common) diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..771589380bc --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -0,0 +1,36 @@ +# \AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestSpecialTags**](AnotherFakeApi.md#TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags + + +# **TestSpecialTags** +> Client TestSpecialTags(body) +To test special tags + +To test special tags + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..921c76f3df4 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -0,0 +1,35 @@ +# \FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case + + +# **TestClassname** +> Client TestClassname(ctx, body) +To test class name in snake case + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context containing the authentication | nil if no authentication + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index fcc8d674d25..3908de6a544 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -48,7 +48,7 @@ This endpoint does not need any parameter. ### Return type -[**map[string]int32**](map.md) +**map[string]int32** ### Authorization 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 1154155250c..82a24af48b9 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 @@ -23,14 +23,14 @@ var ( _ context.Context ) -type Fake_classname_tags123ApiService service +type FakeClassnameTags123ApiService service -/* Fake_classname_tags123ApiService To test class name in snake case - +/* FakeClassnameTags123ApiService To test class name in snake case + * @param ctx context.Context Authentication Context @param body client model @return Client*/ -func (a *Fake_classname_tags123ApiService) TestClassname(body Client) (Client, *http.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -68,7 +68,19 @@ func (a *Fake_classname_tags123ApiService) TestClassname(body Client) (Client, } // body params localVarPostBody = &body - r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarQueryParams.Add("api_key_query", key) + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return successPayload, nil, err } From 0db4b323848e6008b83f62d232ceb9279bf0ed51 Mon Sep 17 00:00:00 2001 From: Andrea Rossi Date: Sat, 7 Oct 2017 07:44:35 +0200 Subject: [PATCH 116/197] [objc] Let the developer specify the timezone to be used for date serialisation (#6628) * [objc] Update deployment target to 8.0 Updates the test project deployment target to 8.0, as that's the lowest supported by the latest XCode. * [objc] Update petstore tests based on current master Makes sure the tests are based on the latest version of master. * [objc] Allow specifying the serialization timezone Now it's possible to specify the timezone used for serializing dates --- .../objc/DefaultConfiguration-header.mustache | 5 +++++ ...JSONValueTransformer+ISO8601-body.mustache | 6 ++++++ .../resources/objc/Sanitizer-body.mustache | 10 +++++---- .../resources/objc/Sanitizer-header.mustache | 5 +++++ .../objc/.swagger-codegen/VERSION | 1 + .../objc/SwaggerClient/Api/SWGFakeApi.h | 2 +- .../Core/JSONValueTransformer+ISO8601.m | 6 ++++++ .../objc/SwaggerClient/Core/SWGApiClient.h | 21 +++++++++++++++++++ .../SwaggerClient/Core/SWGConfiguration.h | 2 +- .../Core/SWGDefaultConfiguration.h | 5 +++++ .../objc/SwaggerClient/Core/SWGSanitizer.h | 5 +++++ .../objc/SwaggerClient/Core/SWGSanitizer.m | 10 +++++---- .../objc/SwaggerClient/Model/SWGReturn.h | 1 + .../Core/JSONValueTransformer+ISO8601.m | 6 ++++++ .../Core/SWGDefaultConfiguration.h | 5 +++++ .../SwaggerClient/Core/SWGSanitizer.h | 5 +++++ .../SwaggerClient/Core/SWGSanitizer.m | 10 +++++---- .../Core/JSONValueTransformer+ISO8601.m | 6 ++++++ .../Core/SWGDefaultConfiguration.h | 5 +++++ .../default/SwaggerClient/Core/SWGSanitizer.h | 5 +++++ .../default/SwaggerClient/Core/SWGSanitizer.m | 10 +++++---- .../SwaggerClient.xcodeproj/project.pbxproj | 4 ++-- .../Tests/SWGApiClientTest.m | 4 ++-- 23 files changed, 117 insertions(+), 22 deletions(-) create mode 100644 samples/client/petstore-security-test/objc/.swagger-codegen/VERSION diff --git a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache index fc1f88f3865..438ddb5b38c 100644 --- a/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/DefaultConfiguration-header.mustache @@ -74,6 +74,11 @@ */ @property (nonatomic) NSString *sslCaCert; +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + /** * Sets API key * diff --git a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache index b544a1dae58..a43b33a613a 100644 --- a/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/JSONValueTransformer+ISO8601-body.mustache @@ -1,5 +1,6 @@ #import #import "JSONValueTransformer+ISO8601.h" +#import "{{classPrefix}}Sanitizer.h" @implementation JSONValueTransformer (ISO8601) @@ -8,4 +9,9 @@ return [NSDate dateWithISO8601String:string]; } +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [{{classPrefix}}Sanitizer dateToString:date]; +} + @end diff --git a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-body.mustache b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-body.mustache index 465633a902c..e1f758ce6b2 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-body.mustache @@ -1,6 +1,7 @@ #import "{{classPrefix}}Sanitizer.h" #import "{{classPrefix}}Object.h" #import "{{classPrefix}}QueryParamCollection.h" +#import "{{classPrefix}}DefaultConfiguration.h" #import NSString * const k{{classPrefix}}ApplicationJSONType = @"application/json"; @@ -63,7 +64,7 @@ NSString * {{classPrefix}}PercentEscapedStringFromString(NSString *string) { return object; } else if ([object isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:object]; + return [{{classPrefix}}Sanitizer dateToString:object]; } else if ([object isKindOfClass:[NSArray class]]) { NSArray *objectArray = object; @@ -107,7 +108,7 @@ NSString * {{classPrefix}}PercentEscapedStringFromString(NSString *string) { return [param stringValue]; } else if ([param isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:param]; + return [{{classPrefix}}Sanitizer dateToString:param]; } else if ([param isKindOfClass:[NSArray class]]) { NSMutableArray *mutableParam = [NSMutableArray array]; @@ -125,8 +126,9 @@ NSString * {{classPrefix}}PercentEscapedStringFromString(NSString *string) { } } -- (NSString *)dateParameterToString:(id)param { - return [param ISO8601String]; ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [{{classPrefix}}DefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; } #pragma mark - Utility Methods diff --git a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache index b6e77edb3f3..4ad7f10a234 100644 --- a/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/Sanitizer-header.mustache @@ -20,6 +20,11 @@ extern NSString * const k{{classPrefix}}ApplicationJSONType; */ - (NSString *) parameterToString: (id) param; +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + /** * Detects Accept header from accepts NSArray * diff --git a/samples/client/petstore-security-test/objc/.swagger-codegen/VERSION b/samples/client/petstore-security-test/objc/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/objc/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h index bea37df4acb..bb864a4a4cf 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Api/SWGFakeApi.h @@ -29,7 +29,7 @@ extern NSInteger kSWGFakeApiMissingParamErrorCode; /// /// code:400 message:"To test code injection *_/ ' \" =end -- \\r\\n \\n \\r" /// -/// @return +/// @return void -(NSURLSessionTask*) testCodeInjectEndRnNRWithTestCodeInjectEndRnNR: (NSString*) testCodeInjectEndRnNR completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index b544a1dae58..0f458f0af01 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,5 +1,6 @@ #import #import "JSONValueTransformer+ISO8601.h" +#import "SWGSanitizer.h" @implementation JSONValueTransformer (ISO8601) @@ -8,4 +9,9 @@ - (NSDate *) NSDateFromNSString:(NSString *)string return [NSDate dateWithISO8601String:string]; } +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [SWGSanitizer dateToString:date]; +} + @end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h index f4c35e17a52..a828f11dcaf 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGApiClient.h @@ -34,6 +34,27 @@ extern NSString *const SWGResponseObjectErrorKey; @property(nonatomic, strong) id sanitizer; +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + @property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; /** diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h index a22ceb78391..85aed9fc8ff 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGConfiguration.h @@ -86,4 +86,4 @@ static NSString * const kSWGAPIVersion = @"1.0.0"; */ @property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; -@end \ No newline at end of file +@end diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGDefaultConfiguration.h index 21542307ae5..767acf2a1b3 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -85,6 +85,11 @@ */ @property (nonatomic) NSString *sslCaCert; +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + /** * Sets API key * diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h index 1ede89f6035..5a8b57777bc 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.h @@ -31,6 +31,11 @@ extern NSString * const kSWGApplicationJSONType; */ - (NSString *) parameterToString: (id) param; +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + /** * Detects Accept header from accepts NSArray * diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m index 49ff6ed014a..1b3e0e10b0d 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Core/SWGSanitizer.m @@ -1,6 +1,7 @@ #import "SWGSanitizer.h" #import "SWGObject.h" #import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" #import NSString * const kSWGApplicationJSONType = @"application/json"; @@ -63,7 +64,7 @@ - (id) sanitizeForSerialization:(id) object { return object; } else if ([object isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:object]; + return [SWGSanitizer dateToString:object]; } else if ([object isKindOfClass:[NSArray class]]) { NSArray *objectArray = object; @@ -107,7 +108,7 @@ - (NSString *) parameterToString:(id)param { return [param stringValue]; } else if ([param isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:param]; + return [SWGSanitizer dateToString:param]; } else if ([param isKindOfClass:[NSArray class]]) { NSMutableArray *mutableParam = [NSMutableArray array]; @@ -125,8 +126,9 @@ - (NSString *) parameterToString:(id)param { } } -- (NSString *)dateParameterToString:(id)param { - return [param ISO8601String]; ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; } #pragma mark - Utility Methods diff --git a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h index ee9a261859e..ced5718bf0b 100644 --- a/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h +++ b/samples/client/petstore-security-test/objc/SwaggerClient/Model/SWGReturn.h @@ -16,6 +16,7 @@ + @protocol SWGReturn @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index b544a1dae58..0f458f0af01 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,5 +1,6 @@ #import #import "JSONValueTransformer+ISO8601.h" +#import "SWGSanitizer.h" @implementation JSONValueTransformer (ISO8601) @@ -8,4 +9,9 @@ - (NSDate *) NSDateFromNSString:(NSString *)string return [NSDate dateWithISO8601String:string]; } +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [SWGSanitizer dateToString:date]; +} + @end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index d3e02965656..bd56b94f4e6 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -85,6 +85,11 @@ */ @property (nonatomic) NSString *sslCaCert; +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + /** * Sets API key * diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h index 28e84d83714..a896caea209 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -31,6 +31,11 @@ extern NSString * const kSWGApplicationJSONType; */ - (NSString *) parameterToString: (id) param; +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + /** * Detects Accept header from accepts NSArray * diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m index 49ff6ed014a..1b3e0e10b0d 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m @@ -1,6 +1,7 @@ #import "SWGSanitizer.h" #import "SWGObject.h" #import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" #import NSString * const kSWGApplicationJSONType = @"application/json"; @@ -63,7 +64,7 @@ - (id) sanitizeForSerialization:(id) object { return object; } else if ([object isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:object]; + return [SWGSanitizer dateToString:object]; } else if ([object isKindOfClass:[NSArray class]]) { NSArray *objectArray = object; @@ -107,7 +108,7 @@ - (NSString *) parameterToString:(id)param { return [param stringValue]; } else if ([param isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:param]; + return [SWGSanitizer dateToString:param]; } else if ([param isKindOfClass:[NSArray class]]) { NSMutableArray *mutableParam = [NSMutableArray array]; @@ -125,8 +126,9 @@ - (NSString *) parameterToString:(id)param { } } -- (NSString *)dateParameterToString:(id)param { - return [param ISO8601String]; ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; } #pragma mark - Utility Methods diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m index b544a1dae58..0f458f0af01 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -1,5 +1,6 @@ #import #import "JSONValueTransformer+ISO8601.h" +#import "SWGSanitizer.h" @implementation JSONValueTransformer (ISO8601) @@ -8,4 +9,9 @@ - (NSDate *) NSDateFromNSString:(NSString *)string return [NSDate dateWithISO8601String:string]; } +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [SWGSanitizer dateToString:date]; +} + @end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index d3e02965656..bd56b94f4e6 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -85,6 +85,11 @@ */ @property (nonatomic) NSString *sslCaCert; +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + /** * Sets API key * diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h index 28e84d83714..a896caea209 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -31,6 +31,11 @@ extern NSString * const kSWGApplicationJSONType; */ - (NSString *) parameterToString: (id) param; +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + /** * Detects Accept header from accepts NSArray * diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m index 49ff6ed014a..1b3e0e10b0d 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m @@ -1,6 +1,7 @@ #import "SWGSanitizer.h" #import "SWGObject.h" #import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" #import NSString * const kSWGApplicationJSONType = @"application/json"; @@ -63,7 +64,7 @@ - (id) sanitizeForSerialization:(id) object { return object; } else if ([object isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:object]; + return [SWGSanitizer dateToString:object]; } else if ([object isKindOfClass:[NSArray class]]) { NSArray *objectArray = object; @@ -107,7 +108,7 @@ - (NSString *) parameterToString:(id)param { return [param stringValue]; } else if ([param isKindOfClass:[NSDate class]]) { - return [self dateParameterToString:param]; + return [SWGSanitizer dateToString:param]; } else if ([param isKindOfClass:[NSArray class]]) { NSMutableArray *mutableParam = [NSMutableArray array]; @@ -125,8 +126,9 @@ - (NSString *) parameterToString:(id)param { } } -- (NSString *)dateParameterToString:(id)param { - return [param ISO8601String]; ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; } #pragma mark - Utility Methods diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj index a7eb97a8bcb..c2b960038e1 100644 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -534,7 +534,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -567,7 +567,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m index 7e78cae4840..b6bee5a719a 100644 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m @@ -154,11 +154,11 @@ - (void)testSanitizeForSerialization { // NSDate data = [NSDate dateWithISO8601String:@"1997-07-16T19:20:30.45+01:00"]; result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, [data ISO8601String]); + XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); data = [NSDate dateWithISO8601String:@"1997-07-16"]; result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, [data ISO8601String]); + XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); // model NSDictionary *petDict = @{@"id": @1, @"name": @"monkey", From 5b32e886f474f4cb80bc70911fdb3776d3ef5cc4 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Sat, 7 Oct 2017 04:12:48 -0500 Subject: [PATCH 117/197] [haskell-http-client] add support for auth methods (#6622) * add support for auth methods * use newtypes for required params * fix duplicate operationId issues * prevent aliasing of vendorextension references in fromOperation * add --fast to stack ci build --- .../languages/HaskellHttpClientCodegen.java | 148 +- .../haskell-http-client/API.mustache | 107 +- .../haskell-http-client/Client.mustache | 23 +- .../haskell-http-client/Model.mustache | 12 +- .../haskell-http-client/README.mustache | 51 +- .../haskell-http-client.cabal.mustache | 1 + .../tests/Instances.mustache | 34 +- .../haskell-http-client/tests/Test.mustache | 9 +- .../petstore/haskell-http-client/Makefile | 10 +- .../petstore/haskell-http-client/README.md | 51 +- .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-Client.html | 2 +- .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 6 +- .../docs/doc-index-95.html | 2 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.html | 2 +- .../haskell-http-client/docs/doc-index-B.html | 4 + .../haskell-http-client/docs/doc-index-C.html | 2 +- .../haskell-http-client/docs/doc-index-E.html | 4 + .../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-R.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 +- .../docs/mini_SwaggerPetstore-API.html | 2 +- .../docs/mini_SwaggerPetstore-Client.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 8 +- .../docs/src/SwaggerPetstore.API.html | 2500 +++++++------- .../docs/src/SwaggerPetstore.Client.html | 549 ++-- .../docs/src/SwaggerPetstore.Lens.html | 1094 +++---- .../docs/src/SwaggerPetstore.Logging.html | 206 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 427 +-- .../docs/src/SwaggerPetstore.Model.html | 2880 +++++++++-------- .../docs/src/SwaggerPetstore.html | 46 +- .../haskell-http-client/example-app/Main.hs | 45 +- .../lib/SwaggerPetstore/API.hs | 378 ++- .../lib/SwaggerPetstore/Client.hs | 23 +- .../lib/SwaggerPetstore/Model.hs | 185 +- .../petstore/haskell-http-client/pom.xml | 2 + .../swagger-petstore.cabal | 1 + .../petstore/haskell-http-client/swagger.json | 16 +- .../tests-integration/tests/Test.hs | 47 +- .../haskell-http-client/tests/Instances.hs | 34 +- .../haskell-http-client/tests/Test.hs | 79 +- 47 files changed, 4919 insertions(+), 4093 deletions(-) create mode 100644 samples/client/petstore/haskell-http-client/docs/doc-index-B.html create mode 100644 samples/client/petstore/haskell-http-client/docs/doc-index-E.html 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 157c4adfa1d..08b009815e2 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 @@ -5,15 +5,14 @@ import io.swagger.models.ModelImpl; import io.swagger.models.Operation; import io.swagger.models.Swagger; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; +import io.swagger.models.properties.*; import java.util.*; import java.util.regex.Pattern; import org.apache.commons.io.FileUtils; +import io.swagger.models.auth.SecuritySchemeDefinition; import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenModel; @@ -26,6 +25,7 @@ import java.io.File; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.text.WordUtils; import java.util.regex.Matcher; @@ -65,8 +65,8 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static final String MEDIA_IS_JSON = "x-mediaIsJson"; - protected Map uniqueOptionalParamsByName = new HashMap(); - protected Map modelNames = new HashMap(); + protected Map uniqueParamsByName = new HashMap(); + protected Set typeNames = new HashSet(); protected Map> allMimeTypes = new HashMap>(); protected Map knownMimeDataTypes = new HashMap(); protected Map> modelMimeTypes = new HashMap>(); @@ -466,42 +466,49 @@ public String toInstantiationType(Property p) { public CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map definitions, Swagger swagger) { CodegenOperation op = super.fromOperation(resourcePath, httpMethod, operation, definitions, swagger); - op.vendorExtensions.put("x-baseOperationId", op.operationId); + // prevent aliasing/sharing of operation.vendorExtensions reference + op.vendorExtensions = new LinkedHashMap(); + + String operationType = toTypeName("Op", op.operationId); + op.vendorExtensions.put("x-operationType", operationType); + typeNames.add(operationType); + op.vendorExtensions.put("x-haddockPath", String.format("%s %s", op.httpMethod, op.path.replace("/", "\\/"))); - op.operationId = toVarName(op.operationId); - op.vendorExtensions.put("x-operationType", toTypeName("Op", op.operationId)); op.vendorExtensions.put("x-hasBodyOrFormParam", op.getHasBodyParam() || op.getHasFormParams()); for (CodegenParameter param : op.allParams) { - param.vendorExtensions.put("x-operationType", WordUtils.capitalize(op.operationId)); + param.vendorExtensions = new LinkedHashMap(); // prevent aliasing/sharing + param.vendorExtensions.put("x-operationType", operationType); param.vendorExtensions.put("x-isBodyOrFormParam", param.isBodyParam || param.isFormParam); if (!StringUtils.isBlank(param.collectionFormat)) { param.vendorExtensions.put("x-collectionFormat", mapCollectionFormat(param.collectionFormat)); } - if (!param.required) { + if(!param.required) { op.vendorExtensions.put("x-hasOptionalParams", true); - + } + if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) { String paramNameType = toTypeName("Param", param.paramName); - if (uniqueOptionalParamsByName.containsKey(paramNameType)) { - CodegenParameter lastParam = this.uniqueOptionalParamsByName.get(paramNameType); + if (uniqueParamsByName.containsKey(paramNameType)) { + CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType); if (lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) { param.vendorExtensions.put("x-duplicate", true); } else { paramNameType = paramNameType + param.dataType; - while (modelNames.containsKey(paramNameType)) { + while (typeNames.contains(paramNameType)) { paramNameType = generateNextName(paramNameType); } + uniqueParamsByName.put(paramNameType, param); } } else { - while (modelNames.containsKey(paramNameType)) { + while (typeNames.contains(paramNameType)) { paramNameType = generateNextName(paramNameType); } - uniqueOptionalParamsByName.put(paramNameType, param); + uniqueParamsByName.put(paramNameType, param); } param.vendorExtensions.put("x-paramNameType", paramNameType); - op.vendorExtensions.put("x-hasBodyOrFormParam", op.getHasBodyParam() || op.getHasFormParams()); + typeNames.add(paramNameType); } } if (op.getHasPathParams()) { @@ -572,7 +579,18 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op return op; } - + + public List fromSecurity(Map schemes) { + List secs = super.fromSecurity(schemes); + for(CodegenSecurity sec : secs) { + String prefix = ""; + if(sec.isBasic) prefix = "AuthBasic"; + if(sec.isApiKey) prefix = "AuthApiKey"; + if(sec.isOAuth) prefix = "AuthOAuth"; + sec.name = prefix + toTypeName("",sec.name); + } + return secs; + } @Override public Map postProcessOperations(Map objs) { @@ -586,6 +604,7 @@ public Map postProcessOperations(Map objs) { additionalProperties.put("x-hasUnknownMimeTypes", !unknownMimeTypes.isEmpty()); additionalProperties.put("x-unknownMimeTypes", unknownMimeTypes); + additionalProperties.put("x-allUniqueParams", uniqueParamsByName.values()); return ret; } @@ -619,12 +638,13 @@ public Map postProcessOperationsWithModels(Map o public CodegenModel fromModel(String name, Model mod, Map allDefinitions) { CodegenModel model = super.fromModel(name, mod, allDefinitions); - while (uniqueOptionalParamsByName.containsKey(model.classname)) { + while (typeNames.contains(model.classname)) { model.classname = generateNextName(model.classname); } + typeNames.add(model.classname); // From the model name, compute the prefix for the fields. - String prefix = WordUtils.uncapitalize(model.classname); + String prefix = StringUtils.uncapitalize(model.classname); for (CodegenProperty prop : model.vars) { prop.name = toVarName(prefix, prop.name); } @@ -635,7 +655,6 @@ public CodegenModel fromModel(String name, Model mod, Map allDefi return model; } - modelNames.put(model.classname, model); return model; } @@ -674,6 +693,7 @@ private void processMediaType(CodegenOperation op, Map m) { if(StringUtils.isBlank(mediaType)) return; String mimeType = getMimeDataType(mediaType); + typeNames.add(mimeType); m.put(MEDIA_DATA_TYPE, mimeType); if (isJsonMimeType(mediaType)) { m.put(MEDIA_IS_JSON, "true"); @@ -761,6 +781,7 @@ private static boolean isMultipartOperation(List> consumes) } return false; } + @Override public String toVarName(String name) { return toVarName("", name); @@ -794,8 +815,28 @@ public String toModelFilename(String name) { return toTypeName("Model", name); } public String toTypeName(String prefix, String name) { - name = camelize(underscore(sanitizeName(name))); - + name = escapeIdentifier(prefix, camelize(sanitizeName(name))); + return name; + } + @Override + public String toOperationId(String operationId) { + if (StringUtils.isEmpty(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; + } + public String escapeIdentifier(String prefix, String name) { if(StringUtils.isBlank(prefix)) return name; if (isReservedWord(name)) { @@ -815,4 +856,65 @@ public String toTypeName(String prefix, String name) { static boolean isJsonMimeType(String mime) { return mime != null && JSON_MIME_PATTERN.matcher(mime).matches(); } + + @Override + public String toDefaultValue(Property p) { + if (p instanceof StringProperty) { + StringProperty dp = (StringProperty) p; + if (dp.getDefault() != null) { + return "\"" + escapeText(dp.getDefault()) + "\""; + } + } else if (p instanceof BooleanProperty) { + BooleanProperty dp = (BooleanProperty) p; + if (dp.getDefault() != null) { + if (dp.getDefault().toString().equalsIgnoreCase("false")) + return "False"; + else + return "True"; + } + } else if (p instanceof DoubleProperty) { + DoubleProperty dp = (DoubleProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof FloatProperty) { + FloatProperty dp = (FloatProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof IntegerProperty) { + IntegerProperty dp = (IntegerProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof LongProperty) { + LongProperty dp = (LongProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } + + return null; + } + + // override with any special text escaping logic + @SuppressWarnings("static-method") + public String escapeText(String input) { + if (input == null) { + return input; + } + + // remove \t, \n, \r + // replace \ with \\ + // replace " with \" + // outter unescape to retain the original multi-byte characters + // finally escalate characters avoiding code injection + return escapeUnsafeCharacters( + StringEscapeUtils.unescapeJava( + StringEscapeUtils.escapeJava(input) + .replace("\\/", "/")) + .replaceAll("[\\t\\n\\r]"," ") + .replace("\\", "\\\\") + .replace("\"", "\\\"")); + } } 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 06cad2f8d0c..e9208e5cc52 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 @@ -3,16 +3,17 @@ Module : {{title}}.API -} -{-# LANGUAGE RecordWildCards #-} - -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module {{title}}.API where @@ -31,6 +32,7 @@ import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Base64 as B64 import qualified Network.HTTP.Client.MultipartFormData as NH import qualified Network.HTTP.Media as ME @@ -40,7 +42,7 @@ import qualified Web.HttpApiData as WH import qualified Web.FormUrlEncoded as WH import qualified Data.CaseInsensitive as CI -import qualified Data.Data as P (Typeable) +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.Set as Set @@ -76,30 +78,31 @@ import qualified Prelude as P -- {{/summary}}{{#notes}} -- {{{.}}} -- {{/notes}}{{#hasAuthMethods}} --- AuthMethod: {{#authMethods}}{{{name}}}{{#hasMore}}, {{/hasMore}}{{/authMethods}} +-- AuthMethod: {{#authMethods}}'{{{name}}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}} -- {{/hasAuthMethods}}{{#vendorExtensions.x-hasUnknownReturn}} -- Note: Has 'Produces' instances, but no response schema -- {{/vendorExtensions.x-hasUnknownReturn}} {{operationId}} - :: {{#vendorExtensions.x-hasBodyOrFormParam}}(Consumes {{{vendorExtensions.x-operationType}}} contentType{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender contentType {{dataType}}{{/required}}{{/isBodyParam}}{{/allParams}}) + :: {{#vendorExtensions.x-hasBodyOrFormParam}}(Consumes {{{vendorExtensions.x-operationType}}} contentType{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender contentType {{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}}{{/required}}{{/isBodyParam}}{{/allParams}}) => contentType -- ^ request content-type ('MimeType') - -> {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{dataType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}} + -> {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}} -> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-hasBodyOrFormParam}}contentType{{/vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-hasBodyOrFormParam}}MimeNoContent{{/vendorExtensions.x-hasBodyOrFormParam}} {{vendorExtensions.x-returnType}} -{{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}_ {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{{paramName}}} {{/required}}{{/allParams}}= +{{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}_ {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-paramNameType}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= _mkRequest "{{httpMethod}}" [{{#pathParams}}{{#vendorExtensions.x-pathPrefix}}"{{.}}",{{/vendorExtensions.x-pathPrefix}}toPath {{{paramName}}}{{#hasMore}},{{/hasMore}}{{/pathParams}}{{#vendorExtensions.x-pathSuffix}}{{#vendorExtensions.x-hasPathParams}},{{/vendorExtensions.x-hasPathParams}}"{{.}}"{{/vendorExtensions.x-pathSuffix}}]{{#allParams}}{{#required}} - {{#isHeaderParam}}`setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}}`_setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}}`_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}}`_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}}`_addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}}`setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#isDeprecated}} + {{#isHeaderParam}}`setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}}`setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}}`_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}}`_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}}`addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}}`setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#authMethods}} + `_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#isDeprecated}} {-# DEPRECATED {{operationId}} "" #-}{{/isDeprecated}} data {{{vendorExtensions.x-operationType}}} {{#allParams}}{{#isBodyParam}}{{#description}} -- | /Body Param/ "{{{baseName}}}" - {{{description}}}{{/description}} -instance HasBodyParam {{{vendorExtensions.x-operationType}}} {{{dataType}}}{{/isBodyParam}}{{/allParams}} {{#vendorExtensions.x-hasOptionalParams}}{{#allParams}}{{^isBodyParam}}{{^required}}{{#description}} +instance HasBodyParam {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}}{{/isBodyParam}}{{/allParams}} {{#vendorExtensions.x-hasOptionalParams}}{{#allParams}}{{^isBodyParam}}{{^required}}{{#description}} -- | /Optional Param/ "{{{baseName}}}" - {{{description}}}{{/description}} instance HasOptionalParam {{{vendorExtensions.x-operationType}}} {{{vendorExtensions.x-paramNameType}}} where 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}} + {{#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}}} @@ -135,11 +138,12 @@ class HasOptionalParam req param where infixl 2 -&- --- * Optional Request Parameter Types +-- * Request Parameter Types -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#vendorExtensions.x-hasOptionalParams}}{{#allParams}}{{^required}}{{^vendorExtensions.x-duplicate}} -newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show) -{{/vendorExtensions.x-duplicate}}{{/required}}{{/allParams}}{{/vendorExtensions.x-hasOptionalParams}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{#x-allUniqueParams}} +-- | {{{vendorExtensions.x-paramNameType}}} +newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}}) +{{/x-allUniqueParams}} -- * {{requestType}} @@ -148,6 +152,7 @@ data {{requestType}} req contentType res = {{requestType}} { rMethod :: NH.Method -- ^ Method of {{requestType}} , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of {{requestType}} , rParams :: Params -- ^ params of {{requestType}} + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods } deriving (P.Show) @@ -166,6 +171,11 @@ rParamsL :: Lens_' ({{requestType}} req contentType res) Params rParamsL f {{requestType}}{..} = (\rParams -> {{requestType}} { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} +-- | 'rParams' Lens +rAuthTypesL :: Lens_' ({{requestType}} req contentType res) [P.TypeRep] +rAuthTypesL f {{requestType}}{..} = (\rAuthTypes -> {{requestType}} { rAuthTypes, ..} ) <$> f rAuthTypes +{-# INLINE rAuthTypesL #-} + -- | Request Params data Params = Params { paramsQuery :: NH.Query @@ -203,7 +213,7 @@ data ParamBody _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint -> {{requestType}} req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = {{requestType}} m u _mkParams +_mkRequest m u = {{requestType}} m u _mkParams [] _mkParams :: Params _mkParams = Params [] [] ParamBodyNone @@ -235,8 +245,8 @@ _setAcceptHeader req accept = Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["accept"] -_setQuery :: {{requestType}} req contentType res -> [NH.QueryItem] -> {{requestType}} req contentType res -_setQuery req query = +setQuery :: {{requestType}} req contentType res -> [NH.QueryItem] -> {{requestType}} req contentType res +setQuery req query = req & L.over (rParamsL . paramsQueryL) @@ -244,8 +254,8 @@ _setQuery req query = where cifst = CI.mk . P.fst -_addForm :: {{requestType}} req contentType res -> WH.Form -> {{requestType}} req contentType res -_addForm req newform = +addForm :: {{requestType}} req contentType res -> WH.Form -> {{requestType}} req contentType res +addForm req newform = let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty @@ -266,6 +276,9 @@ _setBodyLBS :: {{requestType}} req contentType res -> BL.ByteString -> {{request _setBodyLBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_hasAuthType :: AuthMethod authMethod => {{requestType}} req contentType res -> P.Proxy authMethod -> {{requestType}} req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) -- ** Params Utils @@ -330,3 +343,49 @@ _toCollA' c encode one xs = case c of {-# INLINE expandList #-} {-# INLINE combine #-} +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => AuthMethod a where + applyAuthMethod :: {{requestType}} req contentType res -> a -> {{requestType}} req contentType res + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a + +{{#authMethods}}{{#isBasic}}-- ** {{name}} +data {{name}} = + {{name}} B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod {{name}} where + applyAuthMethod req a@({{name}} user pw) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + 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 req a@({{name}} secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req {{#isKeyInHeader}}`setHeader` toHeader ("{{keyParamName}}", secret){{/isKeyInHeader}}{{^isKeyInHeader}}`setQuery` toQuery ("{{keyParamName}}", Just secret){{/isKeyInHeader}} + else req + +{{/isApiKey}}{{#isOAuth}}-- ** {{name}} +data {{name}} = + {{name}} Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod {{name}} where + applyAuthMethod req a@({{name}} secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + else req + +{{/isOAuth}}{{/authMethods}} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index c2e6655e790..5e787e7c4a1 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -59,6 +59,7 @@ data {{configType}} = {{configType}} , configUserAgent :: Text -- ^ user-agent supplied in the Request , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods } -- | display the config @@ -87,13 +88,21 @@ newConfig = do , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt + , configAuthMethods = [] } +-- | updates config use AuthMethod on matching requests +addAuthMethod :: AuthMethod auth => {{configType}} -> auth -> {{configType}} +addAuthMethod config@{{configType}} {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} + +-- | updates the config to use stdout logging withStdoutLogging :: {{configType}} -> IO {{configType}} withStdoutLogging p = do logCxt <- stdoutLoggingContext (configLogContext p) return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } +-- | updates the config to use stderr logging withStderrLogging :: {{configType}} -> IO {{configType}} withStderrLogging p = do logCxt <- stderrLoggingContext (configLogContext p) @@ -226,7 +235,9 @@ _toInitRequest -> IO (InitRequest req contentType res accept) -- ^ initialized request _toInitRequest config req0 accept = do parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + let req1 = _applyAuthMethods req0 config + & _setContentTypeHeader + & flip _setAcceptHeader accept reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) pReq = parsedReq { NH.method = (rMethod req1) @@ -242,6 +253,16 @@ _toInitRequest config req0 accept = do pure (InitRequest outReq) +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: {{requestType}} req contentType res + -> {{configType}} + -> {{requestType}} req contentType res +_applyAuthMethods req {{configType}} {configAuthMethods = as} = + foldl go req as + where + go r (AnyAuthMethod a) = r `applyAuthMethod` a + -- | 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) 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 3cf877fd2ce..ff7cf6a575e 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 @@ -56,7 +56,7 @@ import qualified Prelude as P {{#model}} -- ** {{classname}} --- |{{#title}} +-- | {{classname}}{{#title}} -- {{{.}}} -- {{/title}}{{#description}} -- {{{.}}}{{/description}} @@ -65,12 +65,15 @@ data {{classname}} = {{classname}} , {{/hasMore}}{{/vars}} } deriving (P.Show,P.Eq,P.Typeable{{#modelDeriving}},{{modelDeriving}}{{/modelDeriving}}) + +-- | FromJSON {{classname}} instance A.FromJSON {{classname}} where parseJSON = A.withObject "{{classname}}" $ \o -> {{^hasVars}}pure {{/hasVars}}{{classname}} {{#hasVars}}<$>{{/hasVars}}{{#vars}} (o {{#required}}.: {{/required}}{{^required}}{{^allowFromJsonNulls}}.:!{{/allowFromJsonNulls}}{{#allowFromJsonNulls}}.:?{{/allowFromJsonNulls}}{{/required}} "{{baseName}}"){{#hasMore}} <*>{{/hasMore}}{{/vars}} +-- | ToJSON {{classname}} instance A.ToJSON {{classname}} where toJSON {{classname}} {{#hasVars}}{..}{{/hasVars}} = {{^allowToJsonNulls}}_omitNulls{{/allowToJsonNulls}}{{#allowToJsonNulls}}A.object{{/allowToJsonNulls}} @@ -79,12 +82,14 @@ instance A.ToJSON {{classname}} where ] {{#vendorExtensions.x-hasMimeFormUrlEncoded}} +-- | FromForm {{classname}} instance WH.FromForm {{classname}} where fromForm f = {{^hasVars}}pure {{/hasVars}}{{classname}} {{#hasVars}}<$>{{/hasVars}}{{#vars}} ({{#required}}WH.parseUnique {{/required}}{{^required}}WH.parseMaybe {{/required}}"{{baseName}}" f){{#hasMore}} <*>{{/hasMore}}{{/vars}} +-- | ToForm {{classname}} instance WH.ToForm {{classname}} where toForm {{classname}} {{#hasVars}}{..}{{/hasVars}} = WH.Form $ HM.fromList $ P.catMaybes $ @@ -111,21 +116,23 @@ mk{{classname}} {{#requiredVars}}{{name}} {{/requiredVars}}= -- * 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 where 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 +-- | Collapse (Just "") to Nothing _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing _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 @@ -158,6 +165,7 @@ _showDateTime = {{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} {-# INLINE _showDateTime #-} +-- | parse an ISO8601 date-time string _parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _parseISO8601 t = P.asum $ 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 1b1db613a2d..938a16c1ae5 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 @@ -46,10 +46,6 @@ haskell-http-client ### Unsupported Swagger Features -* Auth Methods (https://swagger.io/docs/specification/2-0/authentication/) - - - use `setHeader` to add any required headers to requests - * Model Inheritance * Default Parameter Values @@ -92,6 +88,7 @@ View the full list of Codegen "config option" parameters with the command: java -jar swagger-codegen-cli.jar config-help -l haskell-http-client ``` +## Usage Notes ### Example SwaggerPetstore Haddock documentation @@ -103,12 +100,12 @@ An example of the generated haddock documentation targeting the server http://pe An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app - -### Usage Notes +[3]: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/haskell-http-client/example-app This library is intended to be imported qualified. +### Modules + | MODULE | NOTES | | ------------------- | --------------------------------------------------- | | {{title}}.Client | use the "dispatch" functions to send requests | @@ -118,6 +115,9 @@ This library is intended to be imported qualified. | {{title}}.Lens | lenses for model fields | | {{title}}.Logging | logging functions and utils | + +### MimeTypes + This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). @@ -151,16 +151,6 @@ this would indicate that: * the _addFoo_ operation can set it's body param of _FooModel_ via `setBodyParam` * the _addFoo_ operation can set 2 different optional parameters via `applyOptionalParam` -putting this together: - -```haskell -let addFooRequest = addFoo MimeJSON foomodel requiredparam1 requiredparam2 - `applyOptionalParam` FooId 1 - `applyOptionalParam` FooName "name" - `setHeader` [("api_key","xxyy")] -addFooResult <- dispatchMime mgr config addFooRequest MimeXML -``` - If the swagger spec doesn't declare it can accept or produce a certain MIME type for a given Operation, you should either add a Produces or Consumes instance for the desired MIME types (assuming the server @@ -174,4 +164,29 @@ x-www-form-urlencoded instances (FromFrom, ToForm) will also be generated if the model fields are primitive types, and there are Operations using x-www-form-urlencoded which use those models. -See the example app and the haddocks for details. +### Authentication + +A haskell data type will be generated for each swagger authentication type. + +If for example the AuthMethod `AuthOAuthFoo` is generated for OAuth operations, then +`addAuthMethod` should be used to add the AuthMethod config. + +When a request is dispatched, if a matching auth method is found in +the config, it will be applied to the request. + +### Example + +```haskell +mgr <- newManager defaultManagerSettings +config0 <- withStdoutLogging =<< newConfig +let config = config0 + `addAuthMethod` AuthOAuthFoo "secret-key" + +let addFooRequest = addFoo MimeJSON foomodel requiredparam1 requiredparam2 + `applyOptionalParam` FooId 1 + `applyOptionalParam` FooName "name" + `setHeader` [("qux_header","xxyy")] +addFooResult <- dispatchMime mgr config addFooRequest MimeXML +``` + +See the example app and the haddocks for details. \ 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 97638e2afa8..1a347068d2b 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 @@ -94,6 +94,7 @@ test-suite tests , time , iso8601-time , aeson + , vector , semigroups , QuickCheck other-modules: diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache index bf3e087d3cd..c1752cc1644 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -2,20 +2,23 @@ module Instances where -import Data.Text (Text, pack) +import Control.Monad import Data.Char (isSpace) import Data.List (sort) -import qualified Data.Time as TI import Test.QuickCheck +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL import qualified Data.HashMap.Strict as HM import qualified Data.Set as Set -import qualified Data.ByteString.Lazy as BL +import qualified Data.Text as T +import qualified Data.Time as TI +import qualified Data.Vector as V import ApproxEq import {{title}}.Model -instance Arbitrary Text where - arbitrary = pack <$> arbitrary +instance Arbitrary T.Text where + arbitrary = T.pack <$> arbitrary instance Arbitrary TI.Day where arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary @@ -45,6 +48,27 @@ instance Arbitrary Date where arbitrary = Date <$> arbitrary shrink (Date xs) = Date <$> shrink xs +-- | A naive Arbitrary instance for A.Value: +instance Arbitrary A.Value where + arbitrary = frequency [(3, simpleTypes), (1, arrayTypes), (1, objectTypes)] + where + simpleTypes :: Gen A.Value + simpleTypes = + frequency + [ (1, return A.Null) + , (2, liftM A.Bool (arbitrary :: Gen Bool)) + , (2, liftM (A.Number . fromIntegral) (arbitrary :: Gen Int)) + , (2, liftM (A.String . T.pack) (arbitrary :: Gen String)) + ] + mapF (k, v) = (T.pack k, v) + simpleAndArrays = frequency [(1, sized sizedArray), (4, simpleTypes)] + arrayTypes = sized sizedArray + objectTypes = sized sizedObject + sizedArray n = liftM (A.Array . V.fromList) $ replicateM n simpleTypes + sizedObject n = + liftM (A.object . map mapF) $ + replicateM n $ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays + -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups :: (Ord a) 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 e829e013040..bc82ad90638 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,8 @@ import {{title}}.MimeTypes main :: IO () main = - hspec $ modifyMaxSize (const 10) $ - do describe "JSON instances" $ - do {{#models}}{{#model}}propMimeEq MimeJSON (Proxy :: Proxy {{classname}}) - {{/model}}{{/models}} + hspec $ modifyMaxSize (const 10) $ do + describe "JSON instances" $ do + pure () + {{#models}}{{#model}}propMimeEq MimeJSON (Proxy :: Proxy {{classname}}) + {{/model}}{{/models}} diff --git a/samples/client/petstore/haskell-http-client/Makefile b/samples/client/petstore/haskell-http-client/Makefile index 7d74a839ec9..f8057641942 100644 --- a/samples/client/petstore/haskell-http-client/Makefile +++ b/samples/client/petstore/haskell-http-client/Makefile @@ -2,9 +2,9 @@ STACKCMD := stack --install-ghc .PHONY: all clean build test test-integration build-example build-integration all: clean build test build-example build-integration clean: ; (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); -build: ; ($(STACKCMD) haddock); -test: ; ($(STACKCMD) test); -build-example: build ; (cd ./example-app; $(STACKCMD) build); +build: ; ($(STACKCMD) haddock --fast); +test: ; ($(STACKCMD) test --fast); +build-example: build ; (cd ./example-app; $(STACKCMD) build --fast); # a test-only project may exit with ExitFailure, despite building successfully -build-integration: build ; (cd ./tests-integration; $(STACKCMD) build --no-run-tests); -test-integration: build-integration ; (cd ./tests-integration; $(STACKCMD) test); +build-integration: build ; (cd ./tests-integration; $(STACKCMD) build --no-run-tests --fast); +test-integration: build-integration ; (cd ./tests-integration; $(STACKCMD) test --fast); diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index cfbe72747d8..6bad5f06412 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -46,10 +46,6 @@ haskell-http-client ### Unsupported Swagger Features -* Auth Methods (https://swagger.io/docs/specification/2-0/authentication/) - - - use `setHeader` to add any required headers to requests - * Model Inheritance * Default Parameter Values @@ -92,6 +88,7 @@ View the full list of Codegen "config option" parameters with the command: java -jar swagger-codegen-cli.jar config-help -l haskell-http-client ``` +## Usage Notes ### Example SwaggerPetstore Haddock documentation @@ -103,12 +100,12 @@ An example of the generated haddock documentation targeting the server http://pe An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/swagger-api/swagger-codegen/tree/c7d145a4ba3c0627e04ece9eb97e354ac91be821/samples/client/petstore/haskell-http-client/example-app - -### Usage Notes +[3]: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/haskell-http-client/example-app This library is intended to be imported qualified. +### Modules + | MODULE | NOTES | | ------------------- | --------------------------------------------------- | | SwaggerPetstore.Client | use the "dispatch" functions to send requests | @@ -118,6 +115,9 @@ This library is intended to be imported qualified. | SwaggerPetstore.Lens | lenses for model fields | | SwaggerPetstore.Logging | logging functions and utils | + +### MimeTypes + This library adds type safety around what swagger specifies as Produces and Consumes for each Operation (e.g. the list of MIME types an Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers). @@ -151,16 +151,6 @@ this would indicate that: * the _addFoo_ operation can set it's body param of _FooModel_ via `setBodyParam` * the _addFoo_ operation can set 2 different optional parameters via `applyOptionalParam` -putting this together: - -```haskell -let addFooRequest = addFoo MimeJSON foomodel requiredparam1 requiredparam2 - `applyOptionalParam` FooId 1 - `applyOptionalParam` FooName "name" - `setHeader` [("api_key","xxyy")] -addFooResult <- dispatchMime mgr config addFooRequest MimeXML -``` - If the swagger spec doesn't declare it can accept or produce a certain MIME type for a given Operation, you should either add a Produces or Consumes instance for the desired MIME types (assuming the server @@ -174,4 +164,29 @@ x-www-form-urlencoded instances (FromFrom, ToForm) will also be generated if the model fields are primitive types, and there are Operations using x-www-form-urlencoded which use those models. -See the example app and the haddocks for details. +### Authentication + +A haskell data type will be generated for each swagger authentication type. + +If for example the AuthMethod `AuthOAuthFoo` is generated for OAuth operations, then +`addAuthMethod` should be used to add the AuthMethod config. + +When a request is dispatched, if a matching auth method is found in +the config, it will be applied to the request. + +### Example + +```haskell +mgr <- newManager defaultManagerSettings +config0 <- withStdoutLogging =<< newConfig +let config = config0 + `addAuthMethod` AuthOAuthFoo "secret-key" + +let addFooRequest = addFoo MimeJSON foomodel requiredparam1 requiredparam2 + `applyOptionalParam` FooId 1 + `applyOptionalParam` FooName "name" + `setHeader` [("qux_header","xxyy")] +addFooResult <- dispatchMime mgr config addFooRequest MimeXML +``` + +See the example app and the haddocks for details. \ 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 a12cfceb1ae..4fe2d43c872 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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Double

"number" - None

-> Double

"double" - None

-> Text

"patternWithoutDelimiter" - None

-> ByteArray

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
POST /fake

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

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

AuthMethod: http_basic_test

Note: Has Produces instances, but no response schema

data TestEndpointParameters Source #

Instances

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

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - 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 ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> contentType

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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 EnumQueryDouble Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumQueryString Source #

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

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

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

HasOptionalParam TestEnumParameters EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Text

"param" - field1

-> Text

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
PATCH /fake_classname_test

To test class name in snake case

AuthMethod: api_key_query

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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
POST /pet

Add a new pet to the store

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: Integer

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: [Text]

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: petstore_auth

findPetsByTags

findPetsByTags Source #

Arguments

:: [Text]

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

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

AuthMethod: petstore_auth

getPetById

getPetById Source #

Arguments

:: Integer

"petId" - ID of pet to return

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

Find pet by ID

Returns a single pet

AuthMethod: api_key

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
PUT /pet

Update an existing pet

AuthMethod: petstore_auth

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> Integer

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

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

Updates a pet in the store with form data

AuthMethod: petstore_auth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> Integer

"petId" - ID of pet to update

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

uploads an image

AuthMethod: petstore_auth

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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: Text

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: api_key

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Integer

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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 [User]) 
=> contentType

request content-type (MimeType)

-> [User]

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Text

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Text

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Text

"username" - The user name for login

-> Text

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Text

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Status 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 # 
HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumQueryString Source #

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

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

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

HasOptionalParam TestEnumParameters EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - 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 ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

Optional Request Parameter Types

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 #

newtype Name2 Source #

Constructors

Name2 

Fields

newtype Status Source #

Constructors

Status 

Fields

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #

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

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

_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res 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 #

\ No newline at end of file +

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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Consumes TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Consumes TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> contentType

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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 EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

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 EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: PetId

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Status

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

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

:: PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet 
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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> PetId

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

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

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse 
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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: OrderIdText

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

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

:: OrderId

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Username

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res 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 -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam DeletePet ApiKey Source # 
HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

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 EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Request Parameter Types

newtype Number Source #

Number

Constructors

Number 

Fields

Instances

newtype Body Source #

Body

Constructors

Body 

Fields

newtype Tags Source #

Tags

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 Name2 Source #

Name2

Constructors

Name2 

Fields

newtype Status Source #

Status

Constructors

Status 

Fields

Instances

newtype Param2 Source #

Param2

Constructors

Param2 

Fields

Instances

newtype PetId Source #

PetId

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 OrderId Source #

OrderId

Constructors

OrderId 

Fields

newtype Username Source #

Username

Constructors

Username 

Fields

newtype Byte Source #

Byte

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 Param Source #

Param

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 File Source #

File

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

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

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

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

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

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res 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 :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index 41f6eb8830f..62e7ba42c1e 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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"

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res Source #

apply all matching AuthMethods in config to request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ 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 cd7a997db83..1dce441abd5 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

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
MimeType MimeXmlCharsetutf8 Source #
application/xml; 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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
MimeType MimeXmlCharsetutf8 Source #
application/xml; 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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
\ 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 37d0e07c5a8..be752dc3ae4 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,4 +1,8 @@ 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

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

mkClassModel :: ClassModel Source #

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

Client

data Client Source #

Constructors

Client 

Fields

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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

mkMapTest :: MapTest Source #

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

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 #

Model for testing model name same as property name

Constructors

Name 

Fields

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 #

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 # 
FromJSON Order 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

Pet

data Pet Source #

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 # 
FromJSON Pet 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 #

Constructors

Tag 

Fields

mkTag :: Tag Source #

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

User

data User Source #

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 # 
FromJSON User Source # 
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

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

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

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

HasBodyParam CreateUsersWithListInput [User] Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput [User] Source #

Body Param "body" - List of user object

mkUser :: User Source #

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

Cat

data Cat Source #

Constructors

Cat 

Fields

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

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

Dog

data Dog Source #

Constructors

Dog 

Fields

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

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

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 #

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

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 # 
\ 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

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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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)

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 # 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index 5dce1ac0d01..efe12d41b7a 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.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 - _

_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - _

_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ 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 24126d08079..438715137ec 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

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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - A

addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 4623a6e6494..eb371e0fefc 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.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterBoolean 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterComposite 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
BodyOuterString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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
ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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
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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unBodyOuterBooleanSwaggerPetstore.API, SwaggerPetstore
unBodyOuterCompositeSwaggerPetstore.API, SwaggerPetstore
unBodyOuterStringSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addFormSwaggerPetstore.API, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_setQuerySwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, SwaggerPetstore
addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, 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 new file mode 100644 index 00000000000..9404d98a715 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-B.html @@ -0,0 +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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.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-C.html b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html index 8c002a7b450..c3a7f8aa949 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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 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 new file mode 100644 index 00000000000..344278e3fb8 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-E.html @@ -0,0 +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

EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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 d65496e48f7..30a4f2a7fb4 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, 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 56e802e81ea..f38ecee8517 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.Lens, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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 64db7b5535a..fbc4848afee 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

ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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
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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.Lens, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 0f437964190..9c10460372e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

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

Index - R

ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - R

rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, 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 3976204b67d..e184aed000c 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.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, SwaggerPetstore
Status 
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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
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 - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 45dbcad9af9..9690d5db236 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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 78746152051..686bdf75d50 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unBodyOuterBooleanSwaggerPetstore.API, SwaggerPetstore
unBodyOuterCompositeSwaggerPetstore.API, SwaggerPetstore
unBodyOuterStringSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ 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 index 3717a4943a5..4a91bbe2842 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Optional Request Parameter Types

data Body

data Int32

data Int64

data ApiKey

data Name2

data Status

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

\ No newline at end of file +

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Request Parameter Types

data ApiKey

data Number

data Int32

data Body

data Tags

data Name2

data Status

data Param2

data PetId

data OrderId

data Int64

data Byte

data Param

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

AuthMethods

class AuthMethod a

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ 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 index fc5f19bb9ee..a6a810c6a5f 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

SwaggerPetstore.Client

\ No newline at end of file +

SwaggerPetstore.Client

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 51b2f6462e0..ce8b707ee40 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 5e01f7d2025..5aa98e37703 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 @@ -1,1254 +1,1360 @@ -
{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore.API
 -}
-
-{-# LANGUAGE RecordWildCards #-}
-
-{-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE ConstraintKinds #-}
-{-# LANGUAGE InstanceSigs #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
-
-module SwaggerPetstore.API where
-
-
-import SwaggerPetstore.Model as M
-import SwaggerPetstore.MimeTypes
-import SwaggerPetstore.Lens
-
-import qualified Data.Aeson as A
-
-import qualified Data.Time as TI
+
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE InstanceSigs #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
 
-import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Builder as BB
-import qualified Data.ByteString.Char8 as BC
-import qualified Data.ByteString.Lazy.Char8 as BCL
-
-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.HttpApiData as WH
-import qualified Web.FormUrlEncoded as WH
-
-import qualified Data.CaseInsensitive as CI
-import qualified Data.Data as P (Typeable)
-import qualified Data.Foldable as P
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Maybe as P
-import qualified Data.Proxy as P (Proxy(..))
-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 GHC.Base as P (Alternative)
-import qualified Control.Arrow as P (left)
-
-import qualified Lens.Micro as L
-
-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
+module SwaggerPetstore.API where
+
+
+import SwaggerPetstore.Model as M
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Lens
+
+import qualified Data.Aeson as A
+
+import qualified Data.Time as TI
+
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Builder as BB
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy.Char8 as BCL
+import qualified Data.ByteString.Base64 as B64
+
+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.HttpApiData as WH
+import qualified Web.FormUrlEncoded as WH
+
+import qualified Data.CaseInsensitive as CI
+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.Set as Set
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+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 GHC.Base as P (Alternative)
+import qualified Control.Arrow as P (left)
 
-
--- ** AnotherFake
-
--- *** testSpecialTags
-
--- | @PATCH \/another-fake\/dummy@
--- 
--- To test special tags
--- 
--- To test special tags
--- 
-testSpecialTags 
-  :: (Consumes TestSpecialTags contentType, MimeRender contentType Client)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Client -- ^ "body" -  client model
-  -> SwaggerPetstoreRequest TestSpecialTags contentType Client
-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
-
+import qualified Lens.Micro as L
+
+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 -- ^ request content-type ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestSpecialTags contentType Client
+testSpecialTags _ body =
+  _mkRequest "PATCH" ["/another-fake/dummy"]
+    `setBodyParam` body
 
--- ** Fake
+data TestSpecialTags 
 
--- *** fakeOuterBooleanSerialize
-
--- | @POST \/fake\/outer\/boolean@
--- 
--- Test serialization of outer boolean types
--- 
-fakeOuterBooleanSerialize 
-  :: (Consumes FakeOuterBooleanSerialize contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean
-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 -- ^ request content-type ('MimeType')
-  -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite
-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 -- ^ request content-type ('MimeType')
-  -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber
-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 -- ^ request content-type ('MimeType')
-  -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString
-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 -- ^ request content-type ('MimeType')
-  -> Client -- ^ "body" -  client model
-  -> SwaggerPetstoreRequest TestClientModel contentType Client
-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
-
+-- | /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 -- ^ request content-type ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean
+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 -- ^ request content-type ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite
+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 -- ^ request content-type ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber
+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 -- ^ request content-type ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString
+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 -- ^ request content-type ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestClientModel contentType Client
+testClientModel _ body =
+  _mkRequest "PATCH" ["/fake"]
+    `setBodyParam` body
 
--- *** testEndpointParameters
+data TestClientModel 
 
--- | @POST \/fake@
--- 
--- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
--- 
--- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
--- 
--- AuthMethod: http_basic_test
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-testEndpointParameters 
-  :: (Consumes TestEndpointParameters contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Double -- ^ "number" -  None
-  -> Double -- ^ "double" -  None
-  -> Text -- ^ "patternWithoutDelimiter" -  None
-  -> ByteArray -- ^ "byte" -  None
-  -> SwaggerPetstoreRequest TestEndpointParameters contentType res
-testEndpointParameters _ number double patternWithoutDelimiter byte =
-  _mkRequest "POST" ["/fake"]
-    `_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
+-- | /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 -- ^ request content-type ('MimeType')
+  -> Number -- ^ "number" -  None
+  -> ParamDouble -- ^ "double" -  None
+  -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" -  None
+  -> Byte -- ^ "byte" -  None
+  -> SwaggerPetstoreRequest TestEndpointParameters contentType res
+testEndpointParameters _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
+  _mkRequest "POST" ["/fake"]
+    `addForm` toForm ("number", number)
+    `addForm` toForm ("double", double)
+    `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter)
+    `addForm` toForm ("byte", byte)
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
+
+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)
 
--- | @GET \/fake@
--- 
--- To test enum parameters
--- 
--- To test enum parameters
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-testEnumParameters 
-  :: (Consumes TestEnumParameters contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> SwaggerPetstoreRequest TestEnumParameters contentType res
-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
+-- | @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 -- ^ request content-type ('MimeType')
+  -> SwaggerPetstoreRequest TestEnumParameters contentType res
+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)
 
--- | @*/*@
-instance Produces TestEnumParameters MimeAny
-
-
--- *** testJsonFormData
-
--- | @GET \/fake\/jsonFormData@
--- 
--- test json serialization of form data
--- 
--- 
--- 
-testJsonFormData 
-  :: (Consumes TestJsonFormData contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Text -- ^ "param" -  field1
-  -> Text -- ^ "param2" -  field2
-  -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent
-testJsonFormData _ param 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: api_key_query
--- 
-testClassname 
-  :: (Consumes TestClassname contentType, MimeRender contentType Client)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Client -- ^ "body" -  client model
-  -> SwaggerPetstoreRequest TestClassname contentType Client
-testClassname _ body =
-  _mkRequest "PATCH" ["/fake_classname_test"]
-    `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
+-- | /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
+
+
+-- *** testJsonFormData
+
+-- | @GET \/fake\/jsonFormData@
+-- 
+-- test json serialization of form data
+-- 
+-- 
+-- 
+testJsonFormData 
+  :: (Consumes TestJsonFormData contentType)
+  => contentType -- ^ request content-type ('MimeType')
+  -> Param -- ^ "param" -  field1
+  -> Param2 -- ^ "param2" -  field2
+  -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent
+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 -- ^ request content-type ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestClassname contentType Client
+testClassname _ body =
+  _mkRequest "PATCH" ["/fake_classname_test"]
+    `setBodyParam` body
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery)
 
--- *** addPet
+data TestClassname 
 
--- | @POST \/pet@
--- 
--- Add a new pet to the store
--- 
--- 
--- 
--- AuthMethod: petstore_auth
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-addPet 
-  :: (Consumes AddPet contentType, MimeRender contentType Pet)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
-  -> SwaggerPetstoreRequest AddPet contentType res
-addPet _ body =
-  _mkRequest "POST" ["/pet"]
-    `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
+-- | /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 -- ^ request content-type ('MimeType')
+  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
+  -> SwaggerPetstoreRequest AddPet contentType res
+addPet _ body =
+  _mkRequest "POST" ["/pet"]
+    `setBodyParam` body
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
 
-
--- *** deletePet
-
--- | @DELETE \/pet\/{petId}@
--- 
--- Deletes a pet
--- 
--- 
--- 
--- AuthMethod: petstore_auth
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-deletePet 
-  :: Integer -- ^ "petId" -  Pet id to delete
-  -> SwaggerPetstoreRequest DeletePet MimeNoContent res
-deletePet petId =
-  _mkRequest "DELETE" ["/pet/",toPath petId]
-    
-
-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: petstore_auth
--- 
-findPetsByStatus 
-  :: [Text] -- ^ "status" -  Status values that need to be considered for filter
-  -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet]
-findPetsByStatus status =
-  _mkRequest "GET" ["/pet/findByStatus"]
-    `_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: petstore_auth
--- 
-findPetsByTags 
-  :: [Text] -- ^ "tags" -  Tags to filter by
-  -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet]
-findPetsByTags tags =
-  _mkRequest "GET" ["/pet/findByTags"]
-    `_setQuery` toQueryColl CommaSeparated ("tags", Just tags)
+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 
+  :: PetId -- ^ "petId" -  Pet id to delete
+  -> SwaggerPetstoreRequest DeletePet MimeNoContent res
+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 
+  :: Status -- ^ "status" -  Status values that need to be considered for filter
+  -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet]
+findPetsByStatus (Status status) =
+  _mkRequest "GET" ["/pet/findByStatus"]
+    `setQuery` toQueryColl CommaSeparated ("status", Just status)
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+data FindPetsByStatus  
+-- | @application/xml@
+instance Produces FindPetsByStatus MimeXML
+-- | @application/json@
+instance Produces FindPetsByStatus MimeJSON
+
 
-{-# DEPRECATED findPetsByTags "" #-}
+-- *** 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: api_key
--- 
-getPetById 
-  :: Integer -- ^ "petId" -  ID of pet to return
-  -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet
-getPetById petId =
-  _mkRequest "GET" ["/pet/",toPath petId]
-    
+-- | @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 
+  :: Tags -- ^ "tags" -  Tags to filter by
+  -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet]
+findPetsByTags (Tags tags) =
+  _mkRequest "GET" ["/pet/findByTags"]
+    `setQuery` toQueryColl CommaSeparated ("tags", Just tags)
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+{-# DEPRECATED findPetsByTags "" #-}
+
+data FindPetsByTags  
+-- | @application/xml@
+instance Produces FindPetsByTags MimeXML
+-- | @application/json@
+instance Produces FindPetsByTags MimeJSON
 
-data GetPetById  
--- | @application/xml@
-instance Produces GetPetById MimeXML
--- | @application/json@
-instance Produces GetPetById MimeJSON
-
-
--- *** updatePet
-
--- | @PUT \/pet@
+
+-- *** getPetById
+
+-- | @GET \/pet\/{petId}@
+-- 
+-- Find pet by ID
+-- 
+-- Returns a single pet
+-- 
+-- AuthMethod: 'AuthApiKeyApiKey'
 -- 
--- Update an existing pet
--- 
--- 
--- 
--- AuthMethod: petstore_auth
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-updatePet 
-  :: (Consumes UpdatePet contentType, MimeRender contentType Pet)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
-  -> SwaggerPetstoreRequest UpdatePet contentType res
-updatePet _ body =
-  _mkRequest "PUT" ["/pet"]
-    `setBodyParam` body
+getPetById 
+  :: PetId -- ^ "petId" -  ID of pet to return
+  -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet
+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
 
-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: petstore_auth
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-updatePetWithForm 
-  :: (Consumes UpdatePetWithForm contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Integer -- ^ "petId" -  ID of pet that needs to be updated
-  -> SwaggerPetstoreRequest UpdatePetWithForm contentType res
-updatePetWithForm _ petId =
-  _mkRequest "POST" ["/pet/",toPath petId]
-    
-
-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 Status where
-  applyOptionalParam req (Status 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
-
+-- | @PUT \/pet@
+-- 
+-- Update an existing pet
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+updatePet 
+  :: (Consumes UpdatePet contentType, MimeRender contentType Pet)
+  => contentType -- ^ request content-type ('MimeType')
+  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
+  -> SwaggerPetstoreRequest UpdatePet contentType res
+updatePet _ body =
+  _mkRequest "PUT" ["/pet"]
+    `setBodyParam` body
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+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 -- ^ request content-type ('MimeType')
+  -> PetId -- ^ "petId" -  ID of pet that needs to be updated
+  -> SwaggerPetstoreRequest UpdatePetWithForm contentType res
+updatePetWithForm _ (PetId petId) =
+  _mkRequest "POST" ["/pet/",toPath petId]
+    
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
 
--- *** uploadFile
+data UpdatePetWithForm  
 
--- | @POST \/pet\/{petId}\/uploadImage@
--- 
--- uploads an image
--- 
--- 
--- 
--- AuthMethod: petstore_auth
--- 
-uploadFile 
-  :: (Consumes UploadFile contentType)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Integer -- ^ "petId" -  ID of pet to update
-  -> SwaggerPetstoreRequest UploadFile contentType ApiResponse
-uploadFile _ petId =
-  _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"]
-    
-
-data UploadFile  
+-- | /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
+
 
--- | /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 
-  :: Text -- ^ "orderId" -  ID of the order that needs to be deleted
-  -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res
-deleteOrder orderId =
-  _mkRequest "DELETE" ["/store/order/",toPath orderId]
-    
-
-data DeleteOrder  
--- | @application/xml@
-instance Produces DeleteOrder MimeXML
--- | @application/json@
-instance Produces DeleteOrder MimeJSON
-
+-- *** uploadFile
+
+-- | @POST \/pet\/{petId}\/uploadImage@
+-- 
+-- uploads an image
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+uploadFile 
+  :: (Consumes UploadFile contentType)
+  => contentType -- ^ request content-type ('MimeType')
+  -> PetId -- ^ "petId" -  ID of pet to update
+  -> SwaggerPetstoreRequest UploadFile contentType ApiResponse
+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
 
--- *** getInventory
-
--- | @GET \/store\/inventory@
+-- | @DELETE \/store\/order\/{order_id}@
+-- 
+-- Delete purchase order by ID
 -- 
--- Returns pet inventories by status
+-- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
 -- 
--- Returns a map of status codes to quantities
+-- Note: Has 'Produces' instances, but no response schema
 -- 
--- AuthMethod: api_key
--- 
-getInventory 
-  :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int))
-getInventory =
-  _mkRequest "GET" ["/store/inventory"]
+deleteOrder 
+  :: OrderIdText -- ^ "orderId" -  ID of the order that needs to be deleted
+  -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res
+deleteOrder (OrderIdText orderId) =
+  _mkRequest "DELETE" ["/store/order/",toPath orderId]
+    
 
-data GetInventory  
--- | @application/json@
-instance Produces GetInventory MimeJSON
-
-
--- *** getOrderById
+data DeleteOrder  
+-- | @application/xml@
+instance Produces DeleteOrder MimeXML
+-- | @application/json@
+instance Produces DeleteOrder MimeJSON
+
 
--- | @GET \/store\/order\/{order_id}@
--- 
--- Find purchase order by ID
+-- *** getInventory
+
+-- | @GET \/store\/inventory@
 -- 
--- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+-- Returns pet inventories by status
 -- 
-getOrderById 
-  :: Integer -- ^ "orderId" -  ID of pet that needs to be fetched
-  -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order
-getOrderById orderId =
-  _mkRequest "GET" ["/store/order/",toPath orderId]
-    
-
-data GetOrderById  
--- | @application/xml@
-instance Produces GetOrderById MimeXML
--- | @application/json@
-instance Produces GetOrderById MimeJSON
-
+-- Returns a map of status codes to quantities
+-- 
+-- AuthMethod: 'AuthApiKeyApiKey'
+-- 
+getInventory 
+  :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int))
+getInventory =
+  _mkRequest "GET" ["/store/inventory"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
+
+data GetInventory  
+-- | @application/json@
+instance Produces GetInventory MimeJSON
 
--- *** placeOrder
-
--- | @POST \/store\/order@
--- 
--- Place an order for a pet
--- 
+
+-- *** getOrderById
+
+-- | @GET \/store\/order\/{order_id}@
+-- 
+-- Find purchase order by ID
 -- 
--- 
-placeOrder 
-  :: (Consumes PlaceOrder contentType, MimeRender contentType Order)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Order -- ^ "body" -  order placed for purchasing the pet
-  -> SwaggerPetstoreRequest PlaceOrder contentType Order
-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 -- ^ request content-type ('MimeType')
-  -> User -- ^ "body" -  Created user object
-  -> SwaggerPetstoreRequest CreateUser contentType res
-createUser _ body =
-  _mkRequest "POST" ["/user"]
-    `setBodyParam` body
-
-data CreateUser 
+-- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+-- 
+getOrderById 
+  :: OrderId -- ^ "orderId" -  ID of pet that needs to be fetched
+  -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order
+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 -- ^ request content-type ('MimeType')
+  -> Order -- ^ "body" -  order placed for purchasing the pet
+  -> SwaggerPetstoreRequest PlaceOrder contentType Order
+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
+
 
--- | /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@
+-- ** User
+
+-- *** createUser
+
+-- | @POST \/user@
+-- 
+-- Create user
+-- 
+-- This can only be done by the logged in user.
+-- 
+-- Note: Has 'Produces' instances, but no response schema
 -- 
--- Creates list of users with given input array
--- 
--- 
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-createUsersWithArrayInput 
-  :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User])
-  => contentType -- ^ request content-type ('MimeType')
-  -> [User] -- ^ "body" -  List of user object
-  -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res
-createUsersWithArrayInput _ body =
-  _mkRequest "POST" ["/user/createWithArray"]
-    `setBodyParam` body
-
-data CreateUsersWithArrayInput 
-
--- | /Body Param/ "body" - List of user object
-instance HasBodyParam CreateUsersWithArrayInput [User] 
--- | @application/xml@
-instance Produces CreateUsersWithArrayInput MimeXML
--- | @application/json@
-instance Produces CreateUsersWithArrayInput MimeJSON
-
-
--- *** createUsersWithListInput
-
--- | @POST \/user\/createWithList@
+createUser 
+  :: (Consumes CreateUser contentType, MimeRender contentType User)
+  => contentType -- ^ request content-type ('MimeType')
+  -> User -- ^ "body" -  Created user object
+  -> SwaggerPetstoreRequest CreateUser contentType res
+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
 -- 
--- Creates list of users with given input array
--- 
--- 
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-createUsersWithListInput 
-  :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User])
-  => contentType -- ^ request content-type ('MimeType')
-  -> [User] -- ^ "body" -  List of user object
-  -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res
-createUsersWithListInput _ body =
-  _mkRequest "POST" ["/user/createWithList"]
-    `setBodyParam` body
-
-data CreateUsersWithListInput 
-
--- | /Body Param/ "body" - List of user object
-instance HasBodyParam CreateUsersWithListInput [User] 
--- | @application/xml@
-instance Produces CreateUsersWithListInput MimeXML
--- | @application/json@
-instance Produces CreateUsersWithListInput MimeJSON
-
-
--- *** deleteUser
-
--- | @DELETE \/user\/{username}@
+createUsersWithArrayInput 
+  :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
+  => contentType -- ^ request content-type ('MimeType')
+  -> Body -- ^ "body" -  List of user object
+  -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res
+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
 -- 
--- Delete user
--- 
--- This can only be done by the logged in user.
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-deleteUser 
-  :: Text -- ^ "username" -  The name that needs to be deleted
-  -> SwaggerPetstoreRequest DeleteUser MimeNoContent res
-deleteUser username =
-  _mkRequest "DELETE" ["/user/",toPath username]
-    
-
-data DeleteUser  
--- | @application/xml@
-instance Produces DeleteUser MimeXML
--- | @application/json@
-instance Produces DeleteUser MimeJSON
+createUsersWithListInput 
+  :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
+  => contentType -- ^ request content-type ('MimeType')
+  -> Body -- ^ "body" -  List of user object
+  -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res
+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
+
 
-
--- *** getUserByName
-
--- | @GET \/user\/{username}@
--- 
--- Get user by user name
--- 
+-- *** deleteUser
+
+-- | @DELETE \/user\/{username}@
+-- 
+-- Delete user
+-- 
+-- This can only be done by the logged in user.
 -- 
--- 
-getUserByName 
-  :: Text -- ^ "username" -  The name that needs to be fetched. Use user1 for testing. 
-  -> SwaggerPetstoreRequest GetUserByName MimeNoContent User
-getUserByName username =
-  _mkRequest "GET" ["/user/",toPath username]
-    
-
-data GetUserByName  
--- | @application/xml@
-instance Produces GetUserByName MimeXML
--- | @application/json@
-instance Produces GetUserByName MimeJSON
-
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+deleteUser 
+  :: Username -- ^ "username" -  The name that needs to be deleted
+  -> SwaggerPetstoreRequest DeleteUser MimeNoContent res
+deleteUser (Username username) =
+  _mkRequest "DELETE" ["/user/",toPath username]
+    
+
+data DeleteUser  
+-- | @application/xml@
+instance Produces DeleteUser MimeXML
+-- | @application/json@
+instance Produces DeleteUser MimeJSON
 
--- *** loginUser
-
--- | @GET \/user\/login@
--- 
--- Logs user into the system
--- 
+
+-- *** getUserByName
+
+-- | @GET \/user\/{username}@
+-- 
+-- Get user by user name
 -- 
 -- 
-loginUser 
-  :: Text -- ^ "username" -  The user name for login
-  -> Text -- ^ "password" -  The password for login in clear text
-  -> SwaggerPetstoreRequest LoginUser MimeNoContent Text
-loginUser username 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
+-- 
+getUserByName 
+  :: Username -- ^ "username" -  The name that needs to be fetched. Use user1 for testing. 
+  -> SwaggerPetstoreRequest GetUserByName MimeNoContent User
+getUserByName (Username username) =
+  _mkRequest "GET" ["/user/",toPath username]
+    
+
+data GetUserByName  
+-- | @application/xml@
+instance Produces GetUserByName MimeXML
+-- | @application/json@
+instance Produces GetUserByName MimeJSON
+
 
-
--- *** logoutUser
-
--- | @GET \/user\/logout@
--- 
--- Logs out current logged in user session
+-- *** loginUser
+
+-- | @GET \/user\/login@
+-- 
+-- Logs user into the system
+-- 
 -- 
 -- 
--- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-logoutUser 
-  :: SwaggerPetstoreRequest LogoutUser MimeNoContent res
-logoutUser =
-  _mkRequest "GET" ["/user/logout"]
-
-data LogoutUser  
--- | @application/xml@
-instance Produces LogoutUser MimeXML
--- | @application/json@
-instance Produces LogoutUser MimeJSON
-
+loginUser 
+  :: Username -- ^ "username" -  The user name for login
+  -> Password -- ^ "password" -  The password for login in clear text
+  -> SwaggerPetstoreRequest LoginUser MimeNoContent Text
+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
 
--- *** updateUser
-
--- | @PUT \/user\/{username}@
--- 
--- Updated user
--- 
--- This can only be done by the logged in user.
+
+-- *** logoutUser
+
+-- | @GET \/user\/logout@
+-- 
+-- Logs out current logged in user session
+-- 
 -- 
--- Note: Has 'Produces' instances, but no response schema
--- 
-updateUser 
-  :: (Consumes UpdateUser contentType, MimeRender contentType User)
-  => contentType -- ^ request content-type ('MimeType')
-  -> Text -- ^ "username" -  name that need to be deleted
-  -> User -- ^ "body" -  Updated user object
-  -> SwaggerPetstoreRequest UpdateUser contentType res
-updateUser _ username body =
-  _mkRequest "PUT" ["/user/",toPath username]
-    
-    `setBodyParam` body
-
-data UpdateUser 
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+logoutUser 
+  :: SwaggerPetstoreRequest LogoutUser MimeNoContent res
+logoutUser =
+  _mkRequest "GET" ["/user/logout"]
+
+data LogoutUser  
+-- | @application/xml@
+instance Produces LogoutUser MimeXML
+-- | @application/json@
+instance Produces LogoutUser MimeJSON
+
 
--- | /Body Param/ "body" - Updated user object
-instance HasBodyParam UpdateUser User 
--- | @application/xml@
-instance Produces UpdateUser MimeXML
--- | @application/json@
-instance Produces UpdateUser MimeJSON
-
-
-
--- * HasBodyParam
-
--- | Designates the body parameter of a request
-class HasBodyParam req param where
-  setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  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
-  {-# MINIMAL applyOptionalParam | (-&-) #-}
+-- *** 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 -- ^ request content-type ('MimeType')
+  -> Username -- ^ "username" -  name that need to be deleted
+  -> User -- ^ "body" -  Updated user object
+  -> SwaggerPetstoreRequest UpdateUser contentType res
+updateUser _ (Username username) body =
+  _mkRequest "PUT" ["/user/",toPath username]
+    
+    `setBodyParam` body
+
+data UpdateUser 
 
-  -- | Apply an optional parameter to a request
-  applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  applyOptionalParam = (-&-)
-  {-# INLINE applyOptionalParam #-}
-
-  -- | infix operator \/ alias for 'addOptionalParam'
-  (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  (-&-) = applyOptionalParam
-  {-# INLINE (-&-) #-}
-
-infixl 2 -&-
- 
--- * Optional Request Parameter Types
-
-
-newtype BodyOuterBoolean = BodyOuterBoolean { unBodyOuterBoolean :: OuterBoolean } deriving (P.Eq, P.Show)
+-- | /Body Param/ "body" - Updated user object
+instance HasBodyParam UpdateUser User 
+-- | @application/xml@
+instance Produces UpdateUser MimeXML
+-- | @application/json@
+instance Produces UpdateUser MimeJSON
+
+
+
+-- * HasBodyParam
+
+-- | Designates the body parameter of a request
+class HasBodyParam req param where
+  setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  setBodyParam req xs =
+    req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader
 
-newtype BodyOuterComposite = BodyOuterComposite { unBodyOuterComposite :: OuterComposite } deriving (P.Eq, P.Show)
+-- * HasOptionalParam
 
-newtype Body = Body { unBody :: OuterNumber } deriving (P.Eq, P.Show)
-
-newtype BodyOuterString = BodyOuterString { unBodyOuterString :: OuterString } deriving (P.Eq, P.Show)
+-- | Designates the optional parameters of a request
+class HasOptionalParam req param where
+  {-# MINIMAL applyOptionalParam | (-&-) #-}
 
-newtype ParamInteger = ParamInteger { unParamInteger :: Int } 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 ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
-
-newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
+  -- | Apply an optional parameter to a request
+  applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  applyOptionalParam = (-&-)
+  {-# INLINE applyOptionalParam #-}
+
+  -- | infix operator \/ alias for 'addOptionalParam'
+  (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  (-&-) = applyOptionalParam
+  {-# INLINE (-&-) #-}
 
-newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
-
-newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
+infixl 2 -&-
+ 
+-- * Request Parameter Types
 
-newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
-
-newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
-
-newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
-
-newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
-
-newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
-
-newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
-
-newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
-
-newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
-
-newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
-
-newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
-
-newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
-
-newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
-
-newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
-
-newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show)
-
-newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
-
-newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
-
-
--- * SwaggerPetstoreRequest
-
--- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
-data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest
-  { rMethod  :: NH.Method   -- ^ Method of SwaggerPetstoreRequest
-  , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest
-  , rParams   :: Params -- ^ params of SwaggerPetstoreRequest
-  }
-  deriving (P.Show)
-
--- | 'rMethod' Lens
-rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method
-rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod
-{-# INLINE rMethodL #-}
-
--- | 'rUrlPath' Lens
-rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString]
-rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath
-{-# INLINE rUrlPathL #-}
-
--- | 'rParams' Lens
-rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params
-rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams
-{-# INLINE rParamsL #-}
-
--- | Request Params
-data Params = Params
-  { paramsQuery :: NH.Query
-  , paramsHeaders :: NH.RequestHeaders
-  , paramsBody :: ParamBody
-  }
-  deriving (P.Show)
-
--- | 'paramsQuery' Lens
-paramsQueryL :: Lens_' Params NH.Query
-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
-{-# INLINE paramsHeadersL #-}
-
--- | 'paramsBody' Lens
-paramsBodyL :: Lens_' Params ParamBody
-paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
-{-# INLINE paramsBodyL #-}
-
--- | Request Body
-data ParamBody
-  = ParamBodyNone
-  | ParamBodyB B.ByteString
-  | ParamBodyBL BL.ByteString
-  | ParamBodyFormUrlEncoded WH.Form
-  | ParamBodyMultipartFormData [NH.Part]
-  deriving (P.Show)
-
--- ** SwaggerPetstoreRequest Utils
-
-_mkRequest :: NH.Method -- ^ Method 
-          -> [BCL.ByteString] -- ^ Endpoint
-          -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type
-_mkRequest m u = SwaggerPetstoreRequest m u _mkParams
-
-_mkParams :: Params
-_mkParams = Params [] [] ParamBodyNone
-
-setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res
-setHeader req header =
-  req `removeHeader` P.fmap P.fst header &
-  L.over (rParamsL . paramsHeadersL) (header P.++)
-
-removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res
-removeHeader req header =
-  req &
-  L.over
-    (rParamsL . paramsHeadersL)
-    (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
-  where
-    cifst = CI.mk . P.fst
-
-
-_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
-_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
-_setAcceptHeader req accept =
-    case mimeType' accept of 
-        Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
-        Nothing -> req `removeHeader` ["accept"]
+-- | ApiKey
+newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
+-- | StatusText
+newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
+-- | ParamString
+newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
+-- | ParamInteger
+newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
+-- | EnumQueryDouble
+newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
+-- | Number
+newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show)
+-- | Int32
+newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
+-- | ParamDate
+newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
+-- | EnumFormString
+newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
+-- | Body
+newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
+-- | Tags
+newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
+-- | EnumQueryInteger
+newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
+-- | ParamFloat
+newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
+-- | Name2
+newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
+-- | Password
+newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
+-- | Status
+newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show)
+-- | ParamDouble
+newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show)
+-- | EnumHeaderString
+newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
+-- | Param2
+newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
+-- | PetId
+newtype PetId = PetId { unPetId :: Integer } 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)
+-- | EnumQueryString
+newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
+-- | ParamDateTime
+newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
+-- | EnumQueryStringArray
+newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
+-- | PatternWithoutDelimiter
+newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show)
+-- | Callback
+newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
+-- | Username
+newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
+-- | Int64
+newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
+-- | AdditionalMetadata
+newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
+-- | Byte
+newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
+-- | ParamBinary
+newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
+-- | EnumFormStringArray
+newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
+-- | EnumHeaderStringArray
+newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
+-- | Param
+newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
+-- | File
+newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
+
+-- * SwaggerPetstoreRequest
+
+-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
+data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest
+  { rMethod  :: NH.Method   -- ^ Method of SwaggerPetstoreRequest
+  , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest
+  , rParams   :: Params -- ^ params of SwaggerPetstoreRequest
+  , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods
+  }
+  deriving (P.Show)
+
+-- | 'rMethod' Lens
+rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method
+rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod
+{-# INLINE rMethodL #-}
+
+-- | 'rUrlPath' Lens
+rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString]
+rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath
+{-# INLINE rUrlPathL #-}
+
+-- | 'rParams' Lens
+rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params
+rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams
+{-# INLINE rParamsL #-}
+
+-- | 'rParams' Lens
+rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep]
+rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes
+{-# INLINE rAuthTypesL #-}
+
+-- | Request Params
+data Params = Params
+  { paramsQuery :: NH.Query
+  , paramsHeaders :: NH.RequestHeaders
+  , paramsBody :: ParamBody
+  }
+  deriving (P.Show)
+
+-- | 'paramsQuery' Lens
+paramsQueryL :: Lens_' Params NH.Query
+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
+{-# INLINE paramsHeadersL #-}
+
+-- | 'paramsBody' Lens
+paramsBodyL :: Lens_' Params ParamBody
+paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
+{-# INLINE paramsBodyL #-}
 
-_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res
-_setQuery req query = 
-  req &
-  L.over
-    (rParamsL . paramsQueryL)
-    ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
-  where
-    cifst = CI.mk . P.fst
+-- | Request Body
+data ParamBody
+  = ParamBodyNone
+  | ParamBodyB B.ByteString
+  | ParamBodyBL BL.ByteString
+  | ParamBodyFormUrlEncoded WH.Form
+  | ParamBodyMultipartFormData [NH.Part]
+  deriving (P.Show)
 
-_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res
-_addForm req newform = 
-    let form = case paramsBody (rParams req) of
-            ParamBodyFormUrlEncoded _form -> _form
-            _ -> mempty
-    in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
+-- ** SwaggerPetstoreRequest Utils
+
+_mkRequest :: NH.Method -- ^ Method 
+          -> [BCL.ByteString] -- ^ Endpoint
+          -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type
+_mkRequest m u = SwaggerPetstoreRequest m u _mkParams []
 
-_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res
-_addMultiFormPart req newpart = 
-    let parts = case paramsBody (rParams req) of
-            ParamBodyMultipartFormData _parts -> _parts
-            _ -> []
-    in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))
-
-_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res
-_setBodyBS req body = 
-    req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)
-
-_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res
-_setBodyLBS req body = 
-    req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)
-
-
--- ** Params Utils
+_mkParams :: Params
+_mkParams = Params [] [] ParamBodyNone
+
+setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res
+setHeader req header =
+  req `removeHeader` P.fmap P.fst header &
+  L.over (rParamsL . paramsHeadersL) (header P.++)
+
+removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res
+removeHeader req header =
+  req &
+  L.over
+    (rParamsL . paramsHeadersL)
+    (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
+  where
+    cifst = CI.mk . P.fst
+
 
-toPath
-  :: 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]
-
-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
-
--- *** Swagger `CollectionFormat` Utils
-
--- | Determines the format of the array if type array is used.
-data CollectionFormat
-  = 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" ('NH.Query') or "formData" ('WH.Form')
-
-toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header]
-toHeaderColl c xs = _toColl c toHeader xs
+_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
+_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
+_setAcceptHeader req accept =
+    case mimeType' accept of 
+        Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
+        Nothing -> req `removeHeader` ["accept"]
+
+setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res
+setQuery req query = 
+  req &
+  L.over
+    (rParamsL . paramsQueryL)
+    ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
+  where
+    cifst = CI.mk . P.fst
+
+addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res
+addForm req newform = 
+    let form = case paramsBody (rParams req) of
+            ParamBodyFormUrlEncoded _form -> _form
+            _ -> mempty
+    in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
 
-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)
-
-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
-        {-# 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.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
-    {-# INLINE go #-}
-    {-# INLINE expandList #-}
-    {-# INLINE combine #-}
-  
-
\ No newline at end of file +
_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + +_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) + +-- ** Params Utils + +toPath + :: 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] + +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 + +-- *** Swagger `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 + where + 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 + +_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.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 + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => AuthMethod a where + applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod req a@(AuthApiKeyApiKey secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + else req + +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + 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 req a@(AuthOAuthPetstoreAuth secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + else req + + +
\ 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 664b2de3d63..c2683fa528d 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 @@ -1,265 +1,296 @@ -
{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore.Client
 -}
-
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE DeriveFunctor #-}
-{-# LANGUAGE DeriveFoldable #-}
-{-# LANGUAGE DeriveTraversable #-}
-{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
 
-module SwaggerPetstore.Client where
-
-import SwaggerPetstore.Model
-import SwaggerPetstore.API
-import SwaggerPetstore.MimeTypes
-import SwaggerPetstore.Logging
-
-import qualified Control.Monad.IO.Class as P
-import qualified Data.Aeson as A
-import qualified Data.Aeson.Types as A
-import qualified Data.Proxy as P (Proxy(..))
-import Data.Function ((&))
-import Data.Monoid ((<>))
-import Data.Text (Text)
-import GHC.Exts (IsString(..))
-import Web.FormUrlEncoded as WH
-import Web.HttpApiData as WH
-import Control.Monad.Catch (MonadThrow)
-
-import qualified Data.Time as TI
-import qualified Data.Map as Map
-import qualified Data.Text as T
-import qualified Data.Text.Encoding as T
-import qualified Text.Printf as T
-
-import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Char8 as BC
-import qualified Data.ByteString.Lazy.Char8 as BCL
-import qualified Data.ByteString.Builder as BB
-import qualified Network.HTTP.Client as NH
-import qualified Network.HTTP.Client.TLS as NH
-import qualified Network.HTTP.Client.MultipartFormData as NH
-import qualified Network.HTTP.Types.Method as NH
-import qualified Network.HTTP.Types as NH
-import qualified Network.HTTP.Types.URI as NH
-
-import qualified Control.Exception.Safe as E
--- * Config
-
--- | 
-data SwaggerPetstoreConfig = SwaggerPetstoreConfig
-  { configHost  :: BCL.ByteString -- ^ host supplied in the Request
-  , configUserAgent :: Text -- ^ user-agent supplied in the Request
-  , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
-  , configLogContext :: LogContext -- ^ Configures the logger
-  }
-
--- | display the config
-instance Show SwaggerPetstoreConfig where
-  show c =
-    T.printf
-      "{ configHost = %v, configUserAgent = %v, ..}"
-      (show (configHost c))
-      (show (configUserAgent c))
-
--- | constructs a default SwaggerPetstoreConfig
---
--- configHost:
---
--- @http://petstore.swagger.io:80/v2@
---
--- configUserAgent:
---
--- @"swagger-haskell-http-client/1.0.0"@
---
-newConfig :: IO SwaggerPetstoreConfig
-newConfig = do
-    logCxt <- initLogContext
-    return $ SwaggerPetstoreConfig
-        { configHost = "http://petstore.swagger.io:80/v2"
-        , configUserAgent = "swagger-haskell-http-client/1.0.0"
-        , configLogExecWithContext = runDefaultLogExecWithContext
-        , configLogContext = logCxt
-        }  
-
-withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
-withStdoutLogging p = do
-    logCxt <- stdoutLoggingContext (configLogContext p)
-    return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt }
-
-withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
-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}
-
--- * Dispatch
-
--- ** Lbs
-
--- | send a request returning the raw http response
-dispatchLbs
-  :: (Produces req accept, MimeType contentType)
-  => NH.Manager -- ^ http-client Connection manager
-  -> SwaggerPetstoreConfig -- ^ config
-  -> SwaggerPetstoreRequest req contentType res -- ^ request
-  -> accept -- ^ "accept" 'MimeType'
-  -> IO (NH.Response BCL.ByteString) -- ^ response
-dispatchLbs manager config request accept = do
-  initReq <- _toInitRequest config request accept 
-  dispatchInitUnsafe manager config initReq
-
--- ** Mime
-
--- | pair of decoded http body and http response
-data MimeResult res =
-  MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body
-             , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response 
-             }
-  deriving (Show, Functor, Foldable, Traversable)
-
--- | pair of unrender/parser error and http response
-data MimeError =
-  MimeError {
-    mimeError :: String -- ^ unrender/parser error
-  , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response 
-  } deriving (Eq, Show)
-
--- | send a request returning the 'MimeResult'
-dispatchMime
-  :: (Produces req accept, MimeUnrender accept res, MimeType contentType)
-  => NH.Manager -- ^ http-client Connection manager
-  -> SwaggerPetstoreConfig -- ^ config
-  -> SwaggerPetstoreRequest req contentType res -- ^ request
-  -> accept -- ^ "accept" 'MimeType'
-  -> IO (MimeResult res) -- ^ response
-dispatchMime manager config request accept = do
-  httpResponse <- dispatchLbs manager config request accept
-  parsedResult <-
-    runConfigLogWithExceptions "Client" config $
-    do case mimeUnrender' 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)
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.Client where
+
+import SwaggerPetstore.Model
+import SwaggerPetstore.API
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Logging
+
+import qualified Control.Monad.IO.Class as P
+import qualified Data.Aeson as A
+import qualified Data.Aeson.Types as A
+import qualified Data.Proxy as P (Proxy(..))
+import Data.Function ((&))
+import Data.Monoid ((<>))
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
+import Web.FormUrlEncoded as WH
+import Web.HttpApiData as WH
+import Control.Monad.Catch (MonadThrow)
+
+import qualified Data.Time as TI
+import qualified Data.Map as Map
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Text.Printf as T
+
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy.Char8 as BCL
+import qualified Data.ByteString.Builder as BB
+import qualified Network.HTTP.Client as NH
+import qualified Network.HTTP.Client.TLS as NH
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Types.Method as NH
+import qualified Network.HTTP.Types as NH
+import qualified Network.HTTP.Types.URI as NH
+
+import qualified Control.Exception.Safe as E
+-- * Config
+
+-- | 
+data SwaggerPetstoreConfig = SwaggerPetstoreConfig
+  { configHost  :: BCL.ByteString -- ^ host supplied in the Request
+  , configUserAgent :: Text -- ^ user-agent supplied in the Request
+  , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
+  , configLogContext :: LogContext -- ^ Configures the logger
+  , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods
+  }
+
+-- | display the config
+instance Show SwaggerPetstoreConfig where
+  show c =
+    T.printf
+      "{ configHost = %v, configUserAgent = %v, ..}"
+      (show (configHost c))
+      (show (configUserAgent c))
+
+-- | constructs a default SwaggerPetstoreConfig
+--
+-- configHost:
+--
+-- @http://petstore.swagger.io:80/v2@
+--
+-- configUserAgent:
+--
+-- @"swagger-haskell-http-client/1.0.0"@
+--
+newConfig :: IO SwaggerPetstoreConfig
+newConfig = do
+    logCxt <- initLogContext
+    return $ SwaggerPetstoreConfig
+        { configHost = "http://petstore.swagger.io:80/v2"
+        , configUserAgent = "swagger-haskell-http-client/1.0.0"
+        , configLogExecWithContext = runDefaultLogExecWithContext
+        , configLogContext = logCxt
+        , configAuthMethods = []
+        }  
+
+-- | updates config use AuthMethod on matching requests
+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 }
+
+-- | updates the config to use stderr logging
+withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
+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}
+
+-- * Dispatch
+
+-- ** Lbs
+
+-- | send a request returning the raw http response
+dispatchLbs
+  :: (Produces req accept, MimeType contentType)
+  => NH.Manager -- ^ http-client Connection manager
+  -> SwaggerPetstoreConfig -- ^ config
+  -> SwaggerPetstoreRequest req contentType res -- ^ request
+  -> accept -- ^ "accept" 'MimeType'
+  -> IO (NH.Response BCL.ByteString) -- ^ response
+dispatchLbs manager config request accept = do
+  initReq <- _toInitRequest config request accept 
+  dispatchInitUnsafe manager config initReq
+
+-- ** Mime
+
+-- | pair of decoded http body and http response
+data MimeResult res =
+  MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body
+             , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response 
+             }
+  deriving (Show, Functor, Foldable, Traversable)
+
+-- | pair of unrender/parser error and http response
+data MimeError =
+  MimeError {
+    mimeError :: String -- ^ unrender/parser error
+  , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response 
+  } deriving (Eq, Show)
 
--- | like 'dispatchMime', but only returns the decoded http body
-dispatchMime'
-  :: (Produces req accept, MimeUnrender accept res, MimeType contentType)
+-- | send a request returning the 'MimeResult'
+dispatchMime
+  :: (Produces req accept, MimeUnrender accept res, MimeType contentType)
   => NH.Manager -- ^ http-client Connection manager
   -> SwaggerPetstoreConfig -- ^ config
-  -> SwaggerPetstoreRequest req contentType res -- ^ request
-  -> accept -- ^ "accept" 'MimeType'
-  -> IO (Either MimeError res) -- ^ response
-dispatchMime' manager config request accept = do
-    MimeResult parsedResult _ <- dispatchMime manager config request accept 
-    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)
-  => NH.Manager -- ^ http-client Connection manager
-  -> SwaggerPetstoreConfig -- ^ config
-  -> SwaggerPetstoreRequest req contentType res -- ^ request
-  -> accept -- ^ "accept" 'MimeType'
-  -> IO (NH.Response BCL.ByteString) -- ^ response
-dispatchLbsUnsafe manager config request accept = do
-  initReq <- _toInitRequest config request accept
-  dispatchInitUnsafe manager config initReq
-
--- | dispatch an InitRequest
-dispatchInitUnsafe
-  :: NH.Manager -- ^ http-client Connection manager
-  -> SwaggerPetstoreConfig -- ^ config
-  -> 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
-  where
-    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)
-         _ -> "<RequestBody>")
-    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
-  { unInitRequest :: NH.Request
-  } deriving (Show)
-
--- |  Build an http-client 'Request' record from the supplied config and request
-_toInitRequest
-  :: (MimeType accept, MimeType contentType)
-  => SwaggerPetstoreConfig -- ^ config
-  -> SwaggerPetstoreRequest req contentType res -- ^ request
-  -> accept -- ^ "accept" 'MimeType'
-  -> IO (InitRequest req contentType res accept) -- ^ initialized request
-_toInitRequest config req0 accept = do
-  parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0))
-  let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader
-      reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1)
-      reqQuery = NH.renderQuery True (paramsQuery (rParams req1))
-      pReq = parsedReq { NH.method = (rMethod req1)
-                       , NH.requestHeaders = reqHeaders
-                       , NH.queryString = reqQuery
-                       }
-  outReq <- case paramsBody (rParams req1) 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)
-
--- | 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)
-
--- | 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)
-
--- ** Logging 
-
--- | Run a block using the configured logger instance
-runConfigLog
-  :: 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
-
\ No newline at end of file +
-> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> 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 + where + 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) + _ -> "<RequestBody>") + 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 + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _applyAuthMethods req0 config + & _setContentTypeHeader + & flip _setAcceptHeader accept + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery + } + outReq <- case paramsBody (rParams req1) 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) + +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: SwaggerPetstoreRequest req contentType res + -> SwaggerPetstoreConfig + -> SwaggerPetstoreRequest req contentType res +_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = + foldl go req as + where + go r (AnyAuthMethod a) = r `applyAuthMethod` a + +-- | 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) + +-- | 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) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: 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 +
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 42c518137fd..8b8a1e21917 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -1,631 +1,641 @@ -
{-|
-Module : SwaggerPetstore.Lens
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 -}
-
-{-# LANGUAGE KindSignatures #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
 
-module SwaggerPetstore.Lens where
-
-import qualified Data.Aeson as A
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.Data as P (Data, Typeable)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Time as TI
-
-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
-
-import SwaggerPetstore.Model
-
--- * 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
+{-|
+Module : SwaggerPetstore.Lens
+-}
+
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.Lens where
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Data, Typeable)
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import qualified Data.Time as TI
+
+import Data.Text (Text)
 
-
--- * AdditionalPropertiesClass
+import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
 
--- | 'additionalPropertiesClassMapProperty' Lens
-additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
-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
-{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
+import SwaggerPetstore.Model
+
+-- * 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
+
+
+-- * AdditionalPropertiesClass
 
-
-
--- * Animal
-
--- | 'animalClassName' Lens
-animalClassNameL :: Lens_' Animal (Text)
-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
-{-# INLINE animalColorL #-}
+-- | 'additionalPropertiesClassMapProperty' Lens
+additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
+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
+{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
+
+
+
+-- * Animal
 
-
-
--- * AnimalFarm
-
+-- | 'animalClassName' Lens
+animalClassNameL :: Lens_' Animal (Text)
+animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName
+{-# INLINE animalClassNameL #-}
 
-
--- * ApiResponse
-
--- | 'apiResponseCode' Lens
-apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
-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
-{-# INLINE apiResponseTypeL #-}
+-- | 'animalColor' Lens
+animalColorL :: Lens_' Animal (Maybe Text)
+animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor
+{-# INLINE animalColorL #-}
+
+
+
+-- * AnimalFarm
+
+
+
+-- * ApiResponse
 
--- | 'apiResponseMessage' Lens
-apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)
-apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage
-{-# INLINE apiResponseMessageL #-}
+-- | 'apiResponseCode' Lens
+apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
+apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode
+{-# INLINE apiResponseCodeL #-}
 
-
-
--- * ArrayOfArrayOfNumberOnly
-
--- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
-arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
-arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
-{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
-
+-- | 'apiResponseType' Lens
+apiResponseTypeL :: Lens_' ApiResponse (Maybe Text)
+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
+{-# INLINE apiResponseMessageL #-}
 
 
--- * ArrayOfNumberOnly
-
--- | 'arrayOfNumberOnlyArrayNumber' Lens
-arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
-arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
-{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
-
+
+-- * ArrayOfArrayOfNumberOnly
+
+-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
+arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
+arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
+{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
 
 
--- * ArrayTest
-
--- | 'arrayTestArrayOfString' Lens
-arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
-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
-{-# INLINE arrayTestArrayArrayOfIntegerL #-}
+
+-- * ArrayOfNumberOnly
+
+-- | 'arrayOfNumberOnlyArrayNumber' Lens
+arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
+arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
+{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
+
+
+
+-- * ArrayTest
 
--- | 'arrayTestArrayArrayOfModel' Lens
-arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])
-arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel
-{-# INLINE arrayTestArrayArrayOfModelL #-}
+-- | 'arrayTestArrayOfString' Lens
+arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
+arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString
+{-# INLINE arrayTestArrayOfStringL #-}
 
-
-
--- * Capitalization
-
--- | 'capitalizationSmallCamel' Lens
-capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
-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
-{-# INLINE capitalizationCapitalCamelL #-}
+-- | 'arrayTestArrayArrayOfInteger' Lens
+arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]])
+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
+{-# INLINE arrayTestArrayArrayOfModelL #-}
+
+
+
+-- * Capitalization
 
--- | 'capitalizationSmallSnake' Lens
-capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
-capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake
-{-# INLINE capitalizationSmallSnakeL #-}
+-- | 'capitalizationSmallCamel' Lens
+capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
+capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel
+{-# INLINE capitalizationSmallCamelL #-}
 
--- | 'capitalizationCapitalSnake' Lens
-capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text)
-capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake
-{-# INLINE capitalizationCapitalSnakeL #-}
+-- | 'capitalizationCapitalCamel' Lens
+capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text)
+capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel
+{-# INLINE capitalizationCapitalCamelL #-}
 
--- | 'capitalizationScaEthFlowPoints' Lens
-capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
-capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints
-{-# INLINE capitalizationScaEthFlowPointsL #-}
+-- | 'capitalizationSmallSnake' Lens
+capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
+capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake
+{-# INLINE capitalizationSmallSnakeL #-}
 
--- | 'capitalizationAttName' Lens
-capitalizationAttNameL :: Lens_' Capitalization (Maybe Text)
-capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName
-{-# INLINE capitalizationAttNameL #-}
+-- | 'capitalizationCapitalSnake' Lens
+capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text)
+capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake
+{-# INLINE capitalizationCapitalSnakeL #-}
 
-
-
--- * Category
-
--- | 'categoryId' Lens
-categoryIdL :: Lens_' Category (Maybe Integer)
-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
-{-# INLINE categoryNameL #-}
+-- | 'capitalizationScaEthFlowPoints' Lens
+capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
+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
+{-# INLINE capitalizationAttNameL #-}
+
+
+
+-- * Category
 
-
-
--- * ClassModel
-
--- | 'classModelClass' Lens
-classModelClassL :: Lens_' ClassModel (Maybe Text)
-classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
-{-# INLINE classModelClassL #-}
-
+-- | 'categoryId' Lens
+categoryIdL :: Lens_' Category (Maybe Integer)
+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
+{-# INLINE categoryNameL #-}
 
 
--- * Client
-
--- | 'clientClient' Lens
-clientClientL :: Lens_' Client (Maybe Text)
-clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
-{-# INLINE clientClientL #-}
-
+
+-- * ClassModel
+
+-- | 'classModelClass' Lens
+classModelClassL :: Lens_' ClassModel (Maybe Text)
+classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
+{-# INLINE classModelClassL #-}
 
 
--- * EnumArrays
-
--- | 'enumArraysJustSymbol' Lens
-enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
-enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
-{-# INLINE enumArraysJustSymbolL #-}
-
--- | 'enumArraysArrayEnum' Lens
-enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
-enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
-{-# INLINE enumArraysArrayEnumL #-}
+
+-- * Client
+
+-- | 'clientClient' Lens
+clientClientL :: Lens_' Client (Maybe Text)
+clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
+{-# INLINE clientClientL #-}
+
+
+
+-- * EnumArrays
 
-
-
--- * EnumClass
-
+-- | 'enumArraysJustSymbol' Lens
+enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
+enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
+{-# INLINE enumArraysJustSymbolL #-}
 
-
--- * EnumTest
-
--- | 'enumTestEnumString' Lens
-enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
-enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
-{-# INLINE enumTestEnumStringL #-}
-
--- | 'enumTestEnumInteger' Lens
-enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
-enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
-{-# INLINE enumTestEnumIntegerL #-}
+-- | 'enumArraysArrayEnum' Lens
+enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
+enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
+{-# INLINE enumArraysArrayEnumL #-}
+
+
+
+-- * EnumClass
+
+
+
+-- * EnumTest
 
--- | 'enumTestEnumNumber' Lens
-enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
-enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber
-{-# INLINE enumTestEnumNumberL #-}
+-- | 'enumTestEnumString' Lens
+enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
+enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
+{-# INLINE enumTestEnumStringL #-}
 
--- | 'enumTestOuterEnum' Lens
-enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum)
-enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum
-{-# INLINE enumTestOuterEnumL #-}
+-- | 'enumTestEnumInteger' Lens
+enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
+enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
+{-# INLINE enumTestEnumIntegerL #-}
 
-
-
--- * FormatTest
-
--- | 'formatTestInteger' Lens
-formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
-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
-{-# INLINE formatTestInt32L #-}
+-- | 'enumTestEnumNumber' Lens
+enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
+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
+{-# INLINE enumTestOuterEnumL #-}
+
+
+
+-- * FormatTest
 
--- | 'formatTestInt64' Lens
-formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
-formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
-{-# INLINE formatTestInt64L #-}
+-- | 'formatTestInteger' Lens
+formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
+formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger
+{-# INLINE formatTestIntegerL #-}
 
--- | 'formatTestNumber' Lens
-formatTestNumberL :: Lens_' FormatTest (Double)
-formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber
-{-# INLINE formatTestNumberL #-}
+-- | 'formatTestInt32' Lens
+formatTestInt32L :: Lens_' FormatTest (Maybe Int)
+formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32
+{-# INLINE formatTestInt32L #-}
 
--- | 'formatTestFloat' Lens
-formatTestFloatL :: Lens_' FormatTest (Maybe Float)
-formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat
-{-# INLINE formatTestFloatL #-}
+-- | 'formatTestInt64' Lens
+formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
+formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
+{-# INLINE formatTestInt64L #-}
 
--- | 'formatTestDouble' Lens
-formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
-formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble
-{-# INLINE formatTestDoubleL #-}
+-- | 'formatTestNumber' Lens
+formatTestNumberL :: Lens_' FormatTest (Double)
+formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber
+{-# INLINE formatTestNumberL #-}
 
--- | 'formatTestString' Lens
-formatTestStringL :: Lens_' FormatTest (Maybe Text)
-formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString
-{-# INLINE formatTestStringL #-}
+-- | 'formatTestFloat' Lens
+formatTestFloatL :: Lens_' FormatTest (Maybe Float)
+formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat
+{-# INLINE formatTestFloatL #-}
 
--- | 'formatTestByte' Lens
-formatTestByteL :: Lens_' FormatTest (ByteArray)
-formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte
-{-# INLINE formatTestByteL #-}
+-- | 'formatTestDouble' Lens
+formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
+formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble
+{-# INLINE formatTestDoubleL #-}
 
--- | 'formatTestBinary' Lens
-formatTestBinaryL :: Lens_' FormatTest (Maybe Binary)
-formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary
-{-# INLINE formatTestBinaryL #-}
+-- | 'formatTestString' Lens
+formatTestStringL :: Lens_' FormatTest (Maybe Text)
+formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString
+{-# INLINE formatTestStringL #-}
 
--- | 'formatTestDate' Lens
-formatTestDateL :: Lens_' FormatTest (Date)
-formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate
-{-# INLINE formatTestDateL #-}
+-- | 'formatTestByte' Lens
+formatTestByteL :: Lens_' FormatTest (ByteArray)
+formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte
+{-# INLINE formatTestByteL #-}
 
--- | 'formatTestDateTime' Lens
-formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime)
-formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime
-{-# INLINE formatTestDateTimeL #-}
+-- | 'formatTestBinary' Lens
+formatTestBinaryL :: Lens_' FormatTest (Maybe Binary)
+formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary
+{-# INLINE formatTestBinaryL #-}
 
--- | 'formatTestUuid' Lens
-formatTestUuidL :: Lens_' FormatTest (Maybe Text)
-formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
-{-# INLINE formatTestUuidL #-}
+-- | 'formatTestDate' Lens
+formatTestDateL :: Lens_' FormatTest (Date)
+formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate
+{-# INLINE formatTestDateL #-}
 
--- | 'formatTestPassword' Lens
-formatTestPasswordL :: Lens_' FormatTest (Text)
-formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
-{-# INLINE formatTestPasswordL #-}
+-- | 'formatTestDateTime' Lens
+formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime)
+formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime
+{-# INLINE formatTestDateTimeL #-}
 
-
-
--- * HasOnlyReadOnly
-
--- | 'hasOnlyReadOnlyBar' Lens
-hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
-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
-{-# INLINE hasOnlyReadOnlyFooL #-}
+-- | 'formatTestUuid' Lens
+formatTestUuidL :: Lens_' FormatTest (Maybe Text)
+formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
+{-# INLINE formatTestUuidL #-}
+
+-- | 'formatTestPassword' Lens
+formatTestPasswordL :: Lens_' FormatTest (Text)
+formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
+{-# INLINE formatTestPasswordL #-}
+
+
+
+-- * HasOnlyReadOnly
 
-
-
--- * MapTest
-
--- | 'mapTestMapMapOfString' Lens
-mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
-mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
-{-# INLINE mapTestMapMapOfStringL #-}
-
--- | 'mapTestMapOfEnumString' Lens
-mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
-mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
-{-# INLINE mapTestMapOfEnumStringL #-}
+-- | 'hasOnlyReadOnlyBar' Lens
+hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
+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
+{-# INLINE hasOnlyReadOnlyFooL #-}
+
+
+
+-- * MapTest
 
-
-
--- * MixedPropertiesAndAdditionalPropertiesClass
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
-mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
-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
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-}
+-- | 'mapTestMapMapOfString' Lens
+mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
+mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
+{-# INLINE mapTestMapMapOfStringL #-}
+
+-- | 'mapTestMapOfEnumString' Lens
+mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
+mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
+{-# INLINE mapTestMapOfEnumStringL #-}
+
+
+
+-- * MixedPropertiesAndAdditionalPropertiesClass
 
--- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens
-mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal))
-mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
+-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
+mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
+mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-}
 
-
-
--- * Model200Response
-
--- | 'model200ResponseName' Lens
-model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
-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
-{-# INLINE model200ResponseClassL #-}
+-- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens
+mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime)
+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
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
+
+
+
+-- * Model200Response
 
-
-
--- * ModelList
-
--- | 'modelList123List' Lens
-modelList123ListL :: Lens_' ModelList (Maybe Text)
-modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
-{-# INLINE modelList123ListL #-}
-
+-- | 'model200ResponseName' Lens
+model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
+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
+{-# INLINE model200ResponseClassL #-}
 
 
--- * ModelReturn
-
--- | 'modelReturnReturn' Lens
-modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
-modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
-{-# INLINE modelReturnReturnL #-}
-
+
+-- * ModelList
+
+-- | 'modelList123List' Lens
+modelList123ListL :: Lens_' ModelList (Maybe Text)
+modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
+{-# INLINE modelList123ListL #-}
 
 
--- * Name
-
--- | 'nameName' Lens
-nameNameL :: Lens_' Name (Int)
-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
-{-# INLINE nameSnakeCaseL #-}
+
+-- * ModelReturn
+
+-- | 'modelReturnReturn' Lens
+modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
+modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
+{-# INLINE modelReturnReturnL #-}
+
+
+
+-- * Name
 
--- | 'nameProperty' Lens
-namePropertyL :: Lens_' Name (Maybe Text)
-namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty
-{-# INLINE namePropertyL #-}
+-- | 'nameName' Lens
+nameNameL :: Lens_' Name (Int)
+nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName
+{-# INLINE nameNameL #-}
 
--- | 'name123Number' Lens
-name123NumberL :: Lens_' Name (Maybe Int)
-name123NumberL f Name{..} = (\name123Number -> Name { name123Number, ..} ) <$> f name123Number
-{-# INLINE name123NumberL #-}
+-- | 'nameSnakeCase' Lens
+nameSnakeCaseL :: Lens_' Name (Maybe Int)
+nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase
+{-# INLINE nameSnakeCaseL #-}
 
-
-
--- * NumberOnly
-
--- | 'numberOnlyJustNumber' Lens
-numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
-numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
-{-# INLINE numberOnlyJustNumberL #-}
-
+-- | 'nameProperty' Lens
+namePropertyL :: Lens_' Name (Maybe Text)
+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
+{-# INLINE name123NumberL #-}
 
 
--- * Order
-
--- | 'orderId' Lens
-orderIdL :: Lens_' Order (Maybe Integer)
-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
-{-# INLINE orderPetIdL #-}
+
+-- * NumberOnly
+
+-- | 'numberOnlyJustNumber' Lens
+numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
+numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
+{-# INLINE numberOnlyJustNumberL #-}
+
+
+
+-- * Order
 
--- | 'orderQuantity' Lens
-orderQuantityL :: Lens_' Order (Maybe Int)
-orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity
-{-# INLINE orderQuantityL #-}
+-- | 'orderId' Lens
+orderIdL :: Lens_' Order (Maybe Integer)
+orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId
+{-# INLINE orderIdL #-}
 
--- | 'orderShipDate' Lens
-orderShipDateL :: Lens_' Order (Maybe DateTime)
-orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate
-{-# INLINE orderShipDateL #-}
+-- | 'orderPetId' Lens
+orderPetIdL :: Lens_' Order (Maybe Integer)
+orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId
+{-# INLINE orderPetIdL #-}
 
--- | 'orderStatus' Lens
-orderStatusL :: Lens_' Order (Maybe Text)
-orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus
-{-# INLINE orderStatusL #-}
+-- | 'orderQuantity' Lens
+orderQuantityL :: Lens_' Order (Maybe Int)
+orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity
+{-# INLINE orderQuantityL #-}
 
--- | 'orderComplete' Lens
-orderCompleteL :: Lens_' Order (Maybe Bool)
-orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete
-{-# INLINE orderCompleteL #-}
+-- | 'orderShipDate' Lens
+orderShipDateL :: Lens_' Order (Maybe DateTime)
+orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate
+{-# INLINE orderShipDateL #-}
 
-
-
--- * OuterBoolean
-
+-- | 'orderStatus' Lens
+orderStatusL :: Lens_' Order (Maybe Text)
+orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus
+{-# INLINE orderStatusL #-}
 
-
--- * OuterComposite
-
--- | 'outerCompositeMyNumber' Lens
-outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
-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
-{-# INLINE outerCompositeMyStringL #-}
+-- | 'orderComplete' Lens
+orderCompleteL :: Lens_' Order (Maybe Bool)
+orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete
+{-# INLINE orderCompleteL #-}
+
+
+
+-- * OuterBoolean
+
+
+
+-- * OuterComposite
 
--- | 'outerCompositeMyBoolean' Lens
-outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
-outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
-{-# INLINE outerCompositeMyBooleanL #-}
+-- | 'outerCompositeMyNumber' Lens
+outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
+outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber
+{-# INLINE outerCompositeMyNumberL #-}
 
-
-
--- * OuterEnum
-
+-- | 'outerCompositeMyString' Lens
+outerCompositeMyStringL :: Lens_' OuterComposite (Maybe OuterString)
+outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString
+{-# INLINE outerCompositeMyStringL #-}
 
-
--- * OuterNumber
-
-
+-- | 'outerCompositeMyBoolean' Lens
+outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
+outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
+{-# INLINE outerCompositeMyBooleanL #-}
 
--- * OuterString
+
 
-
+-- * OuterEnum
 
--- * Pet
+
 
--- | 'petId' Lens
-petIdL :: Lens_' Pet (Maybe Integer)
-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
-{-# INLINE petCategoryL #-}
+-- * OuterNumber
+
+
+
+-- * OuterString
+
+
+
+-- * Pet
 
--- | 'petName' Lens
-petNameL :: Lens_' Pet (Text)
-petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
-{-# INLINE petNameL #-}
+-- | 'petId' Lens
+petIdL :: Lens_' Pet (Maybe Integer)
+petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId
+{-# INLINE petIdL #-}
 
--- | 'petPhotoUrls' Lens
-petPhotoUrlsL :: Lens_' Pet ([Text])
-petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls
-{-# INLINE petPhotoUrlsL #-}
+-- | 'petCategory' Lens
+petCategoryL :: Lens_' Pet (Maybe Category)
+petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory
+{-# INLINE petCategoryL #-}
 
--- | 'petTags' Lens
-petTagsL :: Lens_' Pet (Maybe [Tag])
-petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags
-{-# INLINE petTagsL #-}
+-- | 'petName' Lens
+petNameL :: Lens_' Pet (Text)
+petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
+{-# INLINE petNameL #-}
 
--- | 'petStatus' Lens
-petStatusL :: Lens_' Pet (Maybe Text)
-petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
-{-# INLINE petStatusL #-}
+-- | 'petPhotoUrls' Lens
+petPhotoUrlsL :: Lens_' Pet ([Text])
+petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls
+{-# INLINE petPhotoUrlsL #-}
 
-
-
--- * ReadOnlyFirst
-
--- | 'readOnlyFirstBar' Lens
-readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
-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
-{-# INLINE readOnlyFirstBazL #-}
+-- | 'petTags' Lens
+petTagsL :: Lens_' Pet (Maybe [Tag])
+petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags
+{-# INLINE petTagsL #-}
+
+-- | 'petStatus' Lens
+petStatusL :: Lens_' Pet (Maybe Text)
+petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
+{-# INLINE petStatusL #-}
+
+
+
+-- * ReadOnlyFirst
 
-
-
--- * SpecialModelName
-
--- | 'specialModelNameSpecialPropertyName' Lens
-specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
-specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
-{-# INLINE specialModelNameSpecialPropertyNameL #-}
-
+-- | 'readOnlyFirstBar' Lens
+readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
+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
+{-# INLINE readOnlyFirstBazL #-}
 
 
--- * Tag
-
--- | 'tagId' Lens
-tagIdL :: Lens_' Tag (Maybe Integer)
-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
-{-# INLINE tagNameL #-}
+
+-- * SpecialModelName
+
+-- | 'specialModelNameSpecialPropertyName' Lens
+specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
+specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
+{-# INLINE specialModelNameSpecialPropertyNameL #-}
+
+
+
+-- * Tag
 
-
-
--- * User
-
--- | 'userId' Lens
-userIdL :: Lens_' User (Maybe Integer)
-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
-{-# INLINE userUsernameL #-}
+-- | 'tagId' Lens
+tagIdL :: Lens_' Tag (Maybe Integer)
+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
+{-# INLINE tagNameL #-}
+
+
+
+-- * User
 
--- | 'userFirstName' Lens
-userFirstNameL :: Lens_' User (Maybe Text)
-userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName
-{-# INLINE userFirstNameL #-}
+-- | 'userId' Lens
+userIdL :: Lens_' User (Maybe Integer)
+userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId
+{-# INLINE userIdL #-}
 
--- | 'userLastName' Lens
-userLastNameL :: Lens_' User (Maybe Text)
-userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName
-{-# INLINE userLastNameL #-}
+-- | 'userUsername' Lens
+userUsernameL :: Lens_' User (Maybe Text)
+userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername
+{-# INLINE userUsernameL #-}
 
--- | 'userEmail' Lens
-userEmailL :: Lens_' User (Maybe Text)
-userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail
-{-# INLINE userEmailL #-}
+-- | 'userFirstName' Lens
+userFirstNameL :: Lens_' User (Maybe Text)
+userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName
+{-# INLINE userFirstNameL #-}
 
--- | 'userPassword' Lens
-userPasswordL :: Lens_' User (Maybe Text)
-userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword
-{-# INLINE userPasswordL #-}
+-- | 'userLastName' Lens
+userLastNameL :: Lens_' User (Maybe Text)
+userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName
+{-# INLINE userLastNameL #-}
 
--- | 'userPhone' Lens
-userPhoneL :: Lens_' User (Maybe Text)
-userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone
-{-# INLINE userPhoneL #-}
+-- | 'userEmail' Lens
+userEmailL :: Lens_' User (Maybe Text)
+userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail
+{-# INLINE userEmailL #-}
 
--- | 'userUserStatus' Lens
-userUserStatusL :: Lens_' User (Maybe Int)
-userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus
-{-# INLINE userUserStatusL #-}
+-- | 'userPassword' Lens
+userPasswordL :: Lens_' User (Maybe Text)
+userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword
+{-# INLINE userPasswordL #-}
 
-
-
--- * Cat
-
--- | 'catClassName' Lens
-catClassNameL :: Lens_' Cat (Text)
-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
-{-# INLINE catColorL #-}
+-- | 'userPhone' Lens
+userPhoneL :: Lens_' User (Maybe Text)
+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
+{-# INLINE userUserStatusL #-}
+
+
+
+-- * Cat
 
--- | 'catDeclawed' Lens
-catDeclawedL :: Lens_' Cat (Maybe Bool)
-catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
-{-# INLINE catDeclawedL #-}
+-- | 'catClassName' Lens
+catClassNameL :: Lens_' Cat (Text)
+catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName
+{-# INLINE catClassNameL #-}
 
-
-
--- * Dog
-
--- | 'dogClassName' Lens
-dogClassNameL :: Lens_' Dog (Text)
-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
-{-# INLINE dogColorL #-}
+-- | 'catColor' Lens
+catColorL :: Lens_' Cat (Maybe Text)
+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
+{-# INLINE catDeclawedL #-}
+
+
+
+-- * Dog
 
--- | 'dogBreed' Lens
-dogBreedL :: Lens_' Dog (Maybe Text)
-dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
-{-# INLINE dogBreedL #-}
+-- | 'dogClassName' Lens
+dogClassNameL :: Lens_' Dog (Text)
+dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName
+{-# INLINE dogClassNameL #-}
 
-
-
\ No newline at end of file +
-- | 'dogColor' Lens +dogColorL :: Lens_' Dog (Maybe Text) +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 +{-# INLINE dogBreedL #-} + + +
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html index f4a1beb4223..5877ed4c1c7 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -1,109 +1,119 @@ -
{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore.Logging
 Katip Logging functions
 -}
-
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-
-module SwaggerPetstore.Logging where
-
-import Data.Text (Text)
-import GHC.Exts (IsString(..))
-
-import qualified Control.Exception.Safe as E
-import qualified Control.Monad.IO.Class as P
-import qualified Control.Monad.Trans.Reader as P
-import qualified Data.Text as T
-import qualified Lens.Micro as L
-import qualified System.IO as IO
+
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module SwaggerPetstore.Logging where
 
-import qualified Katip as LG
-
--- * Type Aliases (for compatability)
-
--- | Runs a Katip logging block with the Log environment
-type LogExecWithContext = forall m. P.MonadIO m =>
-                                    LogContext -> LogExec m
-
--- | A Katip logging block
-type LogExec m = forall a. LG.KatipT m a -> m a
-
--- | A Katip Log environment
-type LogContext = LG.LogEnv
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
+
+import qualified Control.Exception.Safe as E
+import qualified Control.Monad.IO.Class as P
+import qualified Control.Monad.Trans.Reader as P
+import qualified Data.Text as T
+import qualified Lens.Micro as L
+import qualified System.IO as IO
+
+import qualified Katip as LG
+
+-- * Type Aliases (for compatability)
 
--- | A Katip Log severity
-type LogLevel = LG.Severity
-
--- * default logger
-
--- | the default log environment
-initLogContext :: IO LogContext
-initLogContext = LG.initLogEnv "SwaggerPetstore" "dev"
-
--- | Runs a Katip logging block with the Log environment
-runDefaultLogExecWithContext :: LogExecWithContext
-runDefaultLogExecWithContext = LG.runKatipT
+-- | Runs a Katip logging block with the Log environment
+type LogExecWithContext = forall m. P.MonadIO m =>
+                                    LogContext -> LogExec m
+
+-- | A Katip logging block
+type LogExec m = forall a. LG.KatipT m a -> m a
+
+-- | A Katip Log environment
+type LogContext = LG.LogEnv
+
+-- | A Katip Log severity
+type LogLevel = LG.Severity
 
--- * stdout logger
+-- * default logger
 
--- | Runs a Katip logging block with the Log environment
-stdoutLoggingExec :: LogExecWithContext
-stdoutLoggingExec = runDefaultLogExecWithContext
+-- | the default log environment
+initLogContext :: IO LogContext
+initLogContext = LG.initLogEnv "SwaggerPetstore" "dev"
 
--- | A Katip Log environment which targets stdout
-stdoutLoggingContext :: LogContext -> IO LogContext
-stdoutLoggingContext cxt = do
-    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2
-    LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
+-- | Runs a Katip logging block with the Log environment
+runDefaultLogExecWithContext :: LogExecWithContext
+runDefaultLogExecWithContext = LG.runKatipT
+
+-- * stdout logger
 
--- * stderr logger
-
--- | Runs a Katip logging block with the Log environment
-stderrLoggingExec :: LogExecWithContext
-stderrLoggingExec = runDefaultLogExecWithContext
-
--- | A Katip Log environment which targets stderr
-stderrLoggingContext :: LogContext -> IO LogContext
-stderrLoggingContext cxt = do
-    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
-    LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
+-- | Runs a Katip logging block with the Log environment
+stdoutLoggingExec :: LogExecWithContext
+stdoutLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stdout
+stdoutLoggingContext :: LogContext -> IO LogContext
+stdoutLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2
+    LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
+
+-- * stderr logger
 
--- * Null logger
-
--- | Disables Katip logging
-runNullLogExec :: LogExecWithContext
-runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
-
--- * Log Msg
-
--- | Log a katip message
-_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
-_log src level msg = do
-  LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
-
--- * Log Exceptions
-
--- | re-throws exceptions after logging them
-logExceptions
-  :: (LG.Katip m, E.MonadCatch m, Applicative m)
-  => Text -> m a -> m a
-logExceptions src =
-  E.handle
-    (\(e :: E.SomeException) -> do
-       _log src LG.ErrorS ((T.pack . show) e)
-       E.throw e)
+-- | Runs a Katip logging block with the Log environment
+stderrLoggingExec :: LogExecWithContext
+stderrLoggingExec = runDefaultLogExecWithContext
+
+-- | A Katip Log environment which targets stderr
+stderrLoggingContext :: LogContext -> IO LogContext
+stderrLoggingContext cxt = do
+    handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
+    LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
+
+-- * Null logger
+
+-- | Disables Katip logging
+runNullLogExec :: LogExecWithContext
+runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
+
+-- * Log Msg
+
+-- | Log a katip message
+_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
+_log src level msg = do
+  LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
+
+-- * Log Exceptions
 
--- * Log Level
-
-levelInfo :: LogLevel
-levelInfo = LG.InfoS
-
-levelError :: LogLevel
-levelError = LG.ErrorS
-
-levelDebug :: LogLevel
-levelDebug = LG.DebugS
-
-
\ No newline at end of file +
-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + +
\ 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 d2c23acd46c..2b02c676a81 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 @@ -1,220 +1,229 @@ -

-{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore.MimeTypes
 -}
-
-{-# LANGUAGE ConstraintKinds #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
-
-module SwaggerPetstore.MimeTypes where
-
-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.ByteString.Builder as BB
-import qualified Data.ByteString.Char8 as BC
-import qualified Data.ByteString.Lazy.Char8 as BCL
-
+
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.MimeTypes where
+
+import SwaggerPetstore.Model as M
 
-import qualified Network.HTTP.Media as ME
+import qualified Data.Aeson as A
 
-import qualified Web.FormUrlEncoded as WH
-import qualified Web.HttpApiData as WH
-
-import qualified Data.Data as P (Typeable)
-import qualified Data.Proxy as P (Proxy(..))
-import qualified Data.Text as T
-import qualified Data.String as P
-import qualified Data.Text.Encoding as T
-import qualified Control.Arrow as P (left)
-
-import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty)
-import qualified Prelude as P
-
--- * Content Negotiation
-
--- | A type for responses without content-body.
-data NoContent = NoContent
-  deriving (P.Show, P.Eq)
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Builder as BB
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy.Char8 as BCL
+
+
+import qualified Network.HTTP.Media as ME
+
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import qualified Data.Data as P (Typeable)
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Text as T
+import qualified Data.String as P
+import qualified Data.Text.Encoding as T
+import qualified Control.Arrow as P (left)
 
--- ** Mime Types
-
-data MimeJSON = MimeJSON deriving (P.Typeable)
-data MimeXML = MimeXML deriving (P.Typeable)
-data MimePlainText = MimePlainText deriving (P.Typeable)
-data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable)
-data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable)
-data MimeOctetStream = MimeOctetStream deriving (P.Typeable)
-data MimeNoContent = MimeNoContent deriving (P.Typeable)
-data MimeAny = MimeAny deriving (P.Typeable)
+import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty)
+import qualified Prelude as P
+
+-- * Content Negotiation
+
+-- | A type for responses without content-body.
+data NoContent = NoContent
+  deriving (P.Show, P.Eq)
+
+-- ** Mime Types
 
-data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
-data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
-
--- ** MimeType Class
-
-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]
-      Nothing -> []
+data MimeJSON = MimeJSON deriving (P.Typeable)
+data MimeXML = MimeXML deriving (P.Typeable)
+data MimePlainText = MimePlainText deriving (P.Typeable)
+data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable)
+data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable)
+data MimeOctetStream = MimeOctetStream deriving (P.Typeable)
+data MimeNoContent = MimeNoContent deriving (P.Typeable)
+data MimeAny = MimeAny deriving (P.Typeable)
+
+data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
+data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
+
+-- ** MimeType Class
 
-  mimeType :: P.Proxy mtype -> Maybe ME.MediaType
-  mimeType p =
-    case mimeTypes p of
-      [] -> Nothing
-      (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 Instances
-
--- | @application/json; charset=utf-8@
-instance MimeType MimeJSON where
-  mimeType _ = Just $ P.fromString "application/json"
--- | @application/xml; charset=utf-8@
-instance MimeType MimeXML where
-  mimeType _ = Just $ P.fromString "application/xml"
--- | @application/x-www-form-urlencoded@
-instance MimeType MimeFormUrlEncoded where
-  mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded"
--- | @multipart/form-data@
-instance MimeType MimeMultipartFormData where
-  mimeType _ = Just $ P.fromString "multipart/form-data"
--- | @text/plain; charset=utf-8@
-instance MimeType MimePlainText where
-  mimeType _ = Just $ P.fromString "text/plain"
--- | @application/octet-stream@
-instance MimeType MimeOctetStream where
-  mimeType _ = Just $ P.fromString "application/octet-stream"
--- | @"*/*"@
-instance MimeType MimeAny where
-  mimeType _ = Just $ P.fromString "*/*"
-instance MimeType MimeNoContent where
-  mimeType _ = Nothing
-
--- | @application/xml; charset=utf-8@
-instance MimeType MimeXmlCharsetutf8 where
-  mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
-
--- | @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
-
-
--- ** MimeRender Class
+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]
+      Nothing -> []
+
+  mimeType :: P.Proxy mtype -> Maybe ME.MediaType
+  mimeType p =
+    case mimeTypes p of
+      [] -> Nothing
+      (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 Instances
+
+-- | @application/json; charset=utf-8@
+instance MimeType MimeJSON where
+  mimeType _ = Just $ P.fromString "application/json"
+-- | @application/xml; charset=utf-8@
+instance MimeType MimeXML where
+  mimeType _ = Just $ P.fromString "application/xml"
+-- | @application/x-www-form-urlencoded@
+instance MimeType MimeFormUrlEncoded where
+  mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded"
+-- | @multipart/form-data@
+instance MimeType MimeMultipartFormData where
+  mimeType _ = Just $ P.fromString "multipart/form-data"
+-- | @text/plain; charset=utf-8@
+instance MimeType MimePlainText where
+  mimeType _ = Just $ P.fromString "text/plain"
+-- | @application/octet-stream@
+instance MimeType MimeOctetStream where
+  mimeType _ = Just $ P.fromString "application/octet-stream"
+-- | @"*/*"@
+instance MimeType MimeAny where
+  mimeType _ = Just $ P.fromString "*/*"
+instance MimeType MimeNoContent where
+  mimeType _ = Nothing
+
+-- | @application/xml; charset=utf-8@
+instance MimeType MimeXmlCharsetutf8 where
+  mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
 
-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
-
+-- | @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
 
--- ** MimeRender Instances
-
--- | `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
-
--- | @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
--- | @BCL.pack@
-instance MimeRender MimePlainText String where mimeRender _ = BCL.pack
-
--- | @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
--- | @BCL.pack@
-instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack
-
-instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id
-instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary
-
-instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData DateTime 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
-
-mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString
-mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam
-
--- | @P.Right . P.const NoContent@
-instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty
-
--- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec
--- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec
--- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec
--- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec
-
--- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
--- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
-
--- ** 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
-
--- ** MimeUnrender Instances
+
+-- ** 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
+
+
+-- ** MimeRender Instances
+
+-- | `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
+
+-- | @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
+-- | @BCL.pack@
+instance MimeRender MimePlainText String where mimeRender _ = BCL.pack
+
+-- | @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
+-- | @BCL.pack@
+instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack
+
+instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id
+instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary
+
+instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData
+instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData
+instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData
+instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData
+instance MimeRender MimeMultipartFormData DateTime 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
+
+mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString
+mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam
+
+-- | @P.Right . P.const NoContent@
+instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty
+
+-- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec
+-- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec
+-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec
+-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec
+
+-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
+-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
 
--- | @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
--- | @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
--- | @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
--- | @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
-
--- | @P.Right . P.const NoContent@
-instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
-
--- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
--- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined
-
--- ** Request Consumes
-
-class MimeType mtype => Consumes req mtype where
-
--- ** Request Produces
+-- ** 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
+
+-- ** MimeUnrender Instances
+
+-- | @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
+-- | @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
+-- | @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
+-- | @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
+
+-- | @P.Right . P.const NoContent@
+instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
 
-class MimeType mtype => Produces req mtype where
-
\ No newline at end of file +
-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined +-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** Request Consumes + +class MimeType mtype => Consumes req mtype where + +-- ** Request Produces + +class MimeType mtype => Produces req mtype where +
\ 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 643a514eb4c..cbb9e734385 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 @@ -1,1416 +1,1538 @@ -
{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore.Model
 -}
-
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE DeriveFoldable #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE DeriveTraversable #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TupleSections #-}
-{-# LANGUAGE TypeFamilies #-}
-{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
-
-module SwaggerPetstore.Model where
-
-import Data.Aeson ((.:),(.:!),(.:?),(.=))
-
-import qualified Data.Aeson as A
-import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Base64.Lazy as BL64
-import qualified Data.Data as P (Data, Typeable)
-import qualified Data.HashMap.Lazy as HM
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Maybe as P
-import qualified Data.Foldable as P
-import qualified Web.FormUrlEncoded as WH
-import qualified Web.HttpApiData as WH
-import qualified Control.DeepSeq as NF
-import qualified Data.Ix as P
-import qualified Data.Text as T
-import qualified Data.Text.Encoding as T
-import qualified Control.Arrow as P (left)
-import Data.Text (Text)
-
-import qualified Data.Time as TI
-import qualified Data.Time.ISO8601 as TI
-
-import Control.Applicative ((<|>))
-import Control.Applicative (Alternative)
-import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
-import qualified Prelude as P
-
-
+
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.Model where
+
+import Data.Aeson ((.:),(.:!),(.:?),(.=))
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Base64.Lazy as BL64
+import qualified Data.Data as P (Data, Typeable)
+import qualified Data.HashMap.Lazy as HM
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import qualified Data.Maybe as P
+import qualified Data.Foldable as P
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+import qualified Control.DeepSeq as NF
+import qualified Data.Ix as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Control.Arrow as P (left)
+import Data.Text (Text)
 
--- * Models
-
+import qualified Data.Time as TI
+import qualified Data.Time.ISO8601 as TI
 
--- ** 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)
+import Control.Applicative ((<|>))
+import Control.Applicative (Alternative)
+import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+
 
-instance A.FromJSON AdditionalPropertiesClass where
-  parseJSON = A.withObject "AdditionalPropertiesClass" $ \o ->
-    AdditionalPropertiesClass
-      <$> (o .:? "map_property")
-      <*> (o .:? "map_of_map_property")
-
-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
-  }
-  
-
--- ** Animal
--- |
-data Animal = Animal
-  { animalClassName :: !(Text) -- ^ /Required/ "className"
-  , animalColor :: !(Maybe Text) -- ^ "color"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Animal where
-  parseJSON = A.withObject "Animal" $ \o ->
-    Animal
-      <$> (o .:  "className")
-      <*> (o .:? "color")
+-- * 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
+  }
+  
 
-instance A.ToJSON Animal where
-  toJSON Animal {..} =
-   _omitNulls
-      [ "className" .= animalClassName
-      , "color" .= animalColor
-      ]
+-- ** Animal
+-- | Animal
+data Animal = Animal
+  { animalClassName :: !(Text) -- ^ /Required/ "className"
+  , animalColor :: !(Maybe Text) -- ^ "color"
+  } deriving (P.Show,P.Eq,P.Typeable)
 
 
--- | 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
--- |
-data AnimalFarm = AnimalFarm
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON AnimalFarm where
-  parseJSON = A.withObject "AnimalFarm" $ \o ->
-    pure 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
--- |
-data ApiResponse = ApiResponse
-  { apiResponseCode :: !(Maybe Int) -- ^ "code"
-  , apiResponseType :: !(Maybe Text) -- ^ "type"
-  , apiResponseMessage :: !(Maybe Text) -- ^ "message"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ApiResponse where
-  parseJSON = A.withObject "ApiResponse" $ \o ->
-    ApiResponse
-      <$> (o .:? "code")
-      <*> (o .:? "type")
-      <*> (o .:? "message")
-
-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
--- |
-data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly
-  { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ArrayOfArrayOfNumberOnly where
-  parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o ->
-    ArrayOfArrayOfNumberOnly
-      <$> (o .:? "ArrayArrayNumber")
+-- | 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
+      
+
+-- | 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)
+
+
+-- | 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
+      ]
+
 
-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
--- |
-data ArrayOfNumberOnly = ArrayOfNumberOnly
-  { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ArrayOfNumberOnly where
-  parseJSON = A.withObject "ArrayOfNumberOnly" $ \o ->
-    ArrayOfNumberOnly
-      <$> (o .:? "ArrayNumber")
-
-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
--- |
-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)
-
-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")
-
-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
--- |
-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)
-
-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")
-
-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
--- |
-data Category = Category
-  { categoryId :: !(Maybe Integer) -- ^ "id"
-  , categoryName :: !(Maybe Text) -- ^ "name"
-  } deriving (P.Show,P.Eq,P.Typeable)
+-- | 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 '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)
+
+
+-- | 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")
 
-instance A.FromJSON Category where
-  parseJSON = A.withObject "Category" $ \o ->
-    Category
-      <$> (o .:? "id")
-      <*> (o .:? "name")
-
-instance A.ToJSON Category where
-  toJSON Category {..} =
-   _omitNulls
-      [ "id" .= categoryId
-      , "name" .= categoryName
-      ]
+-- | 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 'Category' (by applying it's required fields, if any)
-mkCategory
-  :: Category
-mkCategory =
-  Category
-  { categoryId = Nothing
-  , categoryName = Nothing
-  }
-  
-
--- ** ClassModel
--- |
--- Model for testing model with \"_class\" property
-data ClassModel = ClassModel
-  { classModelClass :: !(Maybe Text) -- ^ "_class"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ClassModel where
-  parseJSON = A.withObject "ClassModel" $ \o ->
-    ClassModel
-      <$> (o .:? "_class")
-
-instance A.ToJSON ClassModel where
-  toJSON ClassModel {..} =
-   _omitNulls
-      [ "_class" .= classModelClass
-      ]
+-- | 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")
 
-
--- | Construct a value of type 'ClassModel' (by applying it's required fields, if any)
-mkClassModel
-  :: ClassModel
-mkClassModel =
-  ClassModel
-  { classModelClass = Nothing
-  }
-  
-
--- ** Client
--- |
-data Client = Client
-  { clientClient :: !(Maybe Text) -- ^ "client"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Client where
-  parseJSON = A.withObject "Client" $ \o ->
-    Client
-      <$> (o .:? "client")
-
-instance A.ToJSON Client where
-  toJSON Client {..} =
-   _omitNulls
-      [ "client" .= clientClient
-      ]
+-- | ToJSON Category
+instance A.ToJSON Category where
+  toJSON Category {..} =
+   _omitNulls
+      [ "id" .= categoryId
+      , "name" .= categoryName
+      ]
+
+
+-- | 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)
+
 
-
--- | Construct a value of type 'Client' (by applying it's required fields, if any)
-mkClient
-  :: Client
-mkClient =
-  Client
-  { clientClient = Nothing
-  }
-  
-
--- ** EnumArrays
--- |
-data EnumArrays = EnumArrays
-  { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol"
-  , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON EnumArrays where
-  parseJSON = A.withObject "EnumArrays" $ \o ->
-    EnumArrays
-      <$> (o .:? "just_symbol")
-      <*> (o .:? "array_enum")
+-- | 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
+  }
+  
 
-instance A.ToJSON EnumArrays where
-  toJSON EnumArrays {..} =
-   _omitNulls
-      [ "just_symbol" .= enumArraysJustSymbol
-      , "array_enum" .= enumArraysArrayEnum
-      ]
+-- ** Client
+-- | Client
+data Client = Client
+  { clientClient :: !(Maybe Text) -- ^ "client"
+  } deriving (P.Show,P.Eq,P.Typeable)
+
 
-
--- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any)
-mkEnumArrays
-  :: EnumArrays
-mkEnumArrays =
-  EnumArrays
-  { enumArraysJustSymbol = Nothing
-  , enumArraysArrayEnum = Nothing
-  }
-  
-
--- ** EnumClass
--- |
-data EnumClass = EnumClass
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON EnumClass where
-  parseJSON = A.withObject "EnumClass" $ \o ->
-    pure EnumClass
-      
-
-instance A.ToJSON EnumClass where
-  toJSON EnumClass  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'EnumClass' (by applying it's required fields, if any)
-mkEnumClass
-  :: EnumClass
-mkEnumClass =
-  EnumClass
-  { 
-  }
-  
+-- | 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 Text) -- ^ "just_symbol"
+  , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "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")
 
--- ** EnumTest
--- |
-data EnumTest = EnumTest
-  { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string"
-  , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer"
-  , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number"
-  , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum"
-  } deriving (P.Show,P.Eq,P.Typeable)
+-- | ToJSON EnumArrays
+instance A.ToJSON EnumArrays where
+  toJSON EnumArrays {..} =
+   _omitNulls
+      [ "just_symbol" .= enumArraysJustSymbol
+      , "array_enum" .= enumArraysArrayEnum
+      ]
+
 
-instance A.FromJSON EnumTest where
-  parseJSON = A.withObject "EnumTest" $ \o ->
-    EnumTest
-      <$> (o .:? "enum_string")
-      <*> (o .:? "enum_integer")
-      <*> (o .:? "enum_number")
-      <*> (o .:? "outerEnum")
-
-instance A.ToJSON EnumTest where
-  toJSON EnumTest {..} =
-   _omitNulls
-      [ "enum_string" .= enumTestEnumString
-      , "enum_integer" .= enumTestEnumInteger
-      , "enum_number" .= enumTestEnumNumber
-      , "outerEnum" .= enumTestOuterEnum
-      ]
+-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any)
+mkEnumArrays
+  :: EnumArrays
+mkEnumArrays =
+  EnumArrays
+  { enumArraysJustSymbol = Nothing
+  , enumArraysArrayEnum = Nothing
+  }
+  
+
+-- ** EnumClass
+-- | EnumClass
+data EnumClass = EnumClass
+  { 
+  } deriving (P.Show,P.Eq,P.Typeable)
+
 
-
--- | 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
-  }
-  
+-- | FromJSON EnumClass
+instance A.FromJSON EnumClass where
+  parseJSON = A.withObject "EnumClass" $ \o ->
+    pure EnumClass
+      
+
+-- | ToJSON EnumClass
+instance A.ToJSON EnumClass where
+  toJSON EnumClass  =
+   _omitNulls
+      [ 
+      ]
 
--- ** 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)
-
-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")
-
-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
--- |
-data HasOnlyReadOnly = HasOnlyReadOnly
-  { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar"
-  , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON HasOnlyReadOnly where
-  parseJSON = A.withObject "HasOnlyReadOnly" $ \o ->
-    HasOnlyReadOnly
-      <$> (o .:? "bar")
-      <*> (o .:? "foo")
-
-instance A.ToJSON HasOnlyReadOnly where
-  toJSON HasOnlyReadOnly {..} =
-   _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
--- |
-data MapTest = MapTest
-  { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string"
-  , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "map_of_enum_string"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON MapTest where
-  parseJSON = A.withObject "MapTest" $ \o ->
-    MapTest
-      <$> (o .:? "map_map_of_string")
-      <*> (o .:? "map_of_enum_string")
-
-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
-  }
-  
+
+-- | Construct a value of type 'EnumClass' (by applying it's required fields, if any)
+mkEnumClass
+  :: EnumClass
+mkEnumClass =
+  EnumClass
+  { 
+  }
+  
+
+-- ** EnumTest
+-- | EnumTest
+data EnumTest = EnumTest
+  { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string"
+  , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer"
+  , enumTestEnumNumber :: !(Maybe Double) -- ^ "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 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
+  }
+  
+
+-- ** 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 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)
 
--- ** 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 HasOnlyReadOnly
+instance A.FromJSON HasOnlyReadOnly where
+  parseJSON = A.withObject "HasOnlyReadOnly" $ \o ->
+    HasOnlyReadOnly
+      <$> (o .:? "bar")
+      <*> (o .:? "foo")
 
-instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where
-  parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o ->
-    MixedPropertiesAndAdditionalPropertiesClass
-      <$> (o .:? "uuid")
-      <*> (o .:? "dateTime")
-      <*> (o .:? "map")
-
-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
-  }
-  
+-- | ToJSON HasOnlyReadOnly
+instance A.ToJSON HasOnlyReadOnly where
+  toJSON HasOnlyReadOnly {..} =
+   _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 Text)) -- ^ "map_of_enum_string"
+  } deriving (P.Show,P.Eq,P.Typeable)
+
 
--- ** 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)
-
-instance A.FromJSON Model200Response where
-  parseJSON = A.withObject "Model200Response" $ \o ->
-    Model200Response
-      <$> (o .:? "name")
-      <*> (o .:? "class")
-
-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
--- |
-data ModelList = ModelList
-  { modelList123List :: !(Maybe Text) -- ^ "123-list"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ModelList where
-  parseJSON = A.withObject "ModelList" $ \o ->
-    ModelList
-      <$> (o .:? "123-list")
+-- | 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")
 
-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
--- |
--- Model for testing reserved words
-data ModelReturn = ModelReturn
-  { modelReturnReturn :: !(Maybe Int) -- ^ "return"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ModelReturn where
-  parseJSON = A.withObject "ModelReturn" $ \o ->
-    ModelReturn
-      <$> (o .:? "return")
-
-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
--- |
--- 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)
-
-instance A.FromJSON Name where
-  parseJSON = A.withObject "Name" $ \o ->
-    Name
-      <$> (o .:  "name")
-      <*> (o .:? "snake_case")
-      <*> (o .:? "property")
-      <*> (o .:? "123Number")
+-- | 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)
 
-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
--- |
-data NumberOnly = NumberOnly
-  { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON NumberOnly where
-  parseJSON = A.withObject "NumberOnly" $ \o ->
-    NumberOnly
-      <$> (o .:? "JustNumber")
-
-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
--- |
-data Order = Order
-  { orderId :: !(Maybe Integer) -- ^ "id"
-  , orderPetId :: !(Maybe Integer) -- ^ "petId"
-  , orderQuantity :: !(Maybe Int) -- ^ "quantity"
-  , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate"
-  , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status
-  , orderComplete :: !(Maybe Bool) -- ^ "complete"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Order where
-  parseJSON = A.withObject "Order" $ \o ->
-    Order
-      <$> (o .:? "id")
-      <*> (o .:? "petId")
-      <*> (o .:? "quantity")
-      <*> (o .:? "shipDate")
-      <*> (o .:? "status")
-      <*> (o .:? "complete")
-
-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
--- |
-data OuterBoolean = OuterBoolean
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON OuterBoolean where
-  parseJSON = A.withObject "OuterBoolean" $ \o ->
-    pure OuterBoolean
-      
-
-instance A.ToJSON OuterBoolean where
-  toJSON OuterBoolean  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any)
-mkOuterBoolean
-  :: OuterBoolean
-mkOuterBoolean =
-  OuterBoolean
-  { 
-  }
-  
-
--- ** 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)
-
-instance A.FromJSON OuterComposite where
-  parseJSON = A.withObject "OuterComposite" $ \o ->
-    OuterComposite
-      <$> (o .:? "my_number")
-      <*> (o .:? "my_string")
-      <*> (o .:? "my_boolean")
-
-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
-  }
-  
-
--- ** OuterEnum
--- |
-data OuterEnum = OuterEnum
-  { 
-  } 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
+  }
+  
+
+-- ** Order
+-- | Order
+data Order = Order
+  { orderId :: !(Maybe Integer) -- ^ "id"
+  , orderPetId :: !(Maybe Integer) -- ^ "petId"
+  , orderQuantity :: !(Maybe Int) -- ^ "quantity"
+  , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate"
+  , orderStatus :: !(Maybe Text) -- ^ "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
+      ]
+
 
-instance A.FromJSON OuterEnum where
-  parseJSON = A.withObject "OuterEnum" $ \o ->
-    pure OuterEnum
-      
-
-instance A.ToJSON OuterEnum where
-  toJSON OuterEnum  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any)
-mkOuterEnum
-  :: OuterEnum
-mkOuterEnum =
-  OuterEnum
+-- | 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
+data OuterBoolean = OuterBoolean
   { 
-  }
-  
+  } deriving (P.Show,P.Eq,P.Typeable)
+
 
--- ** OuterNumber
--- |
-data OuterNumber = OuterNumber
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
+-- | FromJSON OuterBoolean
+instance A.FromJSON OuterBoolean where
+  parseJSON = A.withObject "OuterBoolean" $ \o ->
+    pure OuterBoolean
+      
 
-instance A.FromJSON OuterNumber where
-  parseJSON = A.withObject "OuterNumber" $ \o ->
-    pure OuterNumber
-      
-
-instance A.ToJSON OuterNumber where
-  toJSON OuterNumber  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any)
-mkOuterNumber
-  :: OuterNumber
-mkOuterNumber =
-  OuterNumber
-  { 
-  }
-  
-
--- ** OuterString
--- |
-data OuterString = OuterString
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON OuterString where
-  parseJSON = A.withObject "OuterString" $ \o ->
-    pure OuterString
-      
-
-instance A.ToJSON OuterString where
-  toJSON OuterString  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterString' (by applying it's required fields, if any)
-mkOuterString
-  :: OuterString
-mkOuterString =
-  OuterString
-  { 
-  }
-  
-
--- ** 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 Text) -- ^ "status" - pet status in the store
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Pet where
-  parseJSON = A.withObject "Pet" $ \o ->
-    Pet
-      <$> (o .:? "id")
-      <*> (o .:? "category")
-      <*> (o .:  "name")
-      <*> (o .:  "photoUrls")
-      <*> (o .:? "tags")
-      <*> (o .:? "status")
-
-instance A.ToJSON Pet where
-  toJSON Pet {..} =
+-- | ToJSON OuterBoolean
+instance A.ToJSON OuterBoolean where
+  toJSON OuterBoolean  =
+   _omitNulls
+      [ 
+      ]
+
+
+-- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any)
+mkOuterBoolean
+  :: OuterBoolean
+mkOuterBoolean =
+  OuterBoolean
+  { 
+  }
+  
+
+-- ** 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
+  }
+  
+
+-- ** OuterEnum
+-- | OuterEnum
+data OuterEnum = OuterEnum
+  { 
+  } deriving (P.Show,P.Eq,P.Typeable)
+
+
+-- | FromJSON OuterEnum
+instance A.FromJSON OuterEnum where
+  parseJSON = A.withObject "OuterEnum" $ \o ->
+    pure OuterEnum
+      
+
+-- | ToJSON OuterEnum
+instance A.ToJSON OuterEnum where
+  toJSON OuterEnum  =
    _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
--- |
-data ReadOnlyFirst = ReadOnlyFirst
-  { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar"
-  , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON ReadOnlyFirst where
-  parseJSON = A.withObject "ReadOnlyFirst" $ \o ->
-    ReadOnlyFirst
-      <$> (o .:? "bar")
-      <*> (o .:? "baz")
-
-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
-  }
-  
+      [ 
+      ]
+
+
+-- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any)
+mkOuterEnum
+  :: OuterEnum
+mkOuterEnum =
+  OuterEnum
+  { 
+  }
+  
+
+-- ** OuterNumber
+-- | OuterNumber
+data OuterNumber = OuterNumber
+  { 
+  } deriving (P.Show,P.Eq,P.Typeable)
+
+
+-- | FromJSON OuterNumber
+instance A.FromJSON OuterNumber where
+  parseJSON = A.withObject "OuterNumber" $ \o ->
+    pure OuterNumber
+      
+
+-- | ToJSON OuterNumber
+instance A.ToJSON OuterNumber where
+  toJSON OuterNumber  =
+   _omitNulls
+      [ 
+      ]
+
+
+-- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any)
+mkOuterNumber
+  :: OuterNumber
+mkOuterNumber =
+  OuterNumber
+  { 
+  }
+  
+
+-- ** OuterString
+-- | OuterString
+data OuterString = OuterString
+  { 
+  } deriving (P.Show,P.Eq,P.Typeable)
+
+
+-- | FromJSON OuterString
+instance A.FromJSON OuterString where
+  parseJSON = A.withObject "OuterString" $ \o ->
+    pure OuterString
+      
 
--- ** SpecialModelName
--- |
-data SpecialModelName = SpecialModelName
-  { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON SpecialModelName where
-  parseJSON = A.withObject "SpecialModelName" $ \o ->
-    SpecialModelName
-      <$> (o .:? "$special[property.name]")
-
-instance A.ToJSON SpecialModelName where
-  toJSON SpecialModelName {..} =
-   _omitNulls
-      [ "$special[property.name]" .= specialModelNameSpecialPropertyName
-      ]
+-- | ToJSON OuterString
+instance A.ToJSON OuterString where
+  toJSON OuterString  =
+   _omitNulls
+      [ 
+      ]
+
+
+-- | Construct a value of type 'OuterString' (by applying it's required fields, if any)
+mkOuterString
+  :: OuterString
+mkOuterString =
+  OuterString
+  { 
+  }
+  
 
-
--- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any)
-mkSpecialModelName
-  :: SpecialModelName
-mkSpecialModelName =
-  SpecialModelName
-  { specialModelNameSpecialPropertyName = Nothing
-  }
-  
-
--- ** Tag
--- |
-data Tag = Tag
-  { tagId :: !(Maybe Integer) -- ^ "id"
-  , tagName :: !(Maybe Text) -- ^ "name"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Tag where
-  parseJSON = A.withObject "Tag" $ \o ->
-    Tag
-      <$> (o .:? "id")
-      <*> (o .:? "name")
+-- ** 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 Text) -- ^ "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")
 
-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
--- |
-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)
-
-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 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
--- |
-data Cat = Cat
-  { catClassName :: !(Text) -- ^ /Required/ "className"
-  , catColor :: !(Maybe Text) -- ^ "color"
-  , catDeclawed :: !(Maybe Bool) -- ^ "declawed"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
-instance A.FromJSON Cat where
-  parseJSON = A.withObject "Cat" $ \o ->
-    Cat
-      <$> (o .:  "className")
-      <*> (o .:? "color")
-      <*> (o .:? "declawed")
-
-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
--- |
-data Dog = Dog
-  { dogClassName :: !(Text) -- ^ /Required/ "className"
-  , dogColor :: !(Maybe Text) -- ^ "color"
-  , dogBreed :: !(Maybe Text) -- ^ "breed"
-  } 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
+  }
+  
+
+-- ** 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
+      ]
+
 
-instance A.FromJSON Dog where
-  parseJSON = A.withObject "Dog" $ \o ->
-    Dog
-      <$> (o .:  "className")
-      <*> (o .:? "color")
-      <*> (o .:? "breed")
-
-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
-  }
-  
-
--- * 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
-  where
-    notNull (_, A.Null) = False
-    notNull _ = True
-
-_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])
-_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x
-
-_emptyToNothing :: Maybe String -> Maybe String
-_emptyToNothing (Just "") = Nothing
-_emptyToNothing x = x
-{-# INLINE _emptyToNothing #-}
-
-_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a
-_memptyToNothing (Just x) | x P.== P.mempty = Nothing
-_memptyToNothing x = x
-{-# INLINE _memptyToNothing #-}
+-- | 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
+      ]
 
--- * DateTime Formatting
-
-newtype DateTime = DateTime { unDateTime :: TI.UTCTime }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime)
-instance A.FromJSON DateTime where
-  parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)
-instance A.ToJSON DateTime where
-  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)
-instance P.Show DateTime where
-  show (DateTime t) = _showDateTime t
-
--- | @_parseISO8601@
-_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 =
-  TI.formatISO8601Millis
-{-# INLINE _showDateTime #-}
-
-_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
-_parseISO8601 t =
-  P.asum $
-  P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$>
-  ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]
-{-# INLINE _parseISO8601 #-}
+
+-- | 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")
 
--- * Date Formatting
-
-newtype Date = Date { unDate :: TI.Day }
-  deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime)
-instance A.FromJSON Date where
-  parseJSON = A.withText "Date" (_readDate . T.unpack)
-instance A.ToJSON Date where
-  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)
-instance P.Show Date where
-  show (Date t) = _showDate t
-
--- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@
-_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 TI.defaultTimeLocale "%Y-%m-%d"
-{-# INLINE _showDate #-}
-
--- * Byte/Binary Formatting
-
-  
--- | base64 encoded characters
-newtype ByteArray = ByteArray { unByteArray :: BL.ByteString }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
-
-instance A.FromJSON ByteArray where
-  parseJSON = A.withText "ByteArray" _readByteArray
-instance A.ToJSON ByteArray where
-  toJSON = A.toJSON . _showByteArray
-instance WH.FromHttpApiData ByteArray where
-  parseUrlPiece = P.left T.pack . _readByteArray
-instance WH.ToHttpApiData ByteArray where
-  toUrlPiece = _showByteArray
-instance P.Show ByteArray where
-  show = T.unpack . _showByteArray
-
--- | read base64 encoded characters
-_readByteArray :: Monad m => Text -> m ByteArray
-_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8
-{-# INLINE _readByteArray #-}
-
--- | show base64 encoded characters
-_showByteArray :: ByteArray -> Text
-_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray
-{-# INLINE _showByteArray #-}
-
--- | any sequence of octets
-newtype Binary = Binary { unBinary :: BL.ByteString }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
-
-instance A.FromJSON Binary where
-  parseJSON = A.withText "Binary" _readBinaryBase64
-instance A.ToJSON Binary where
-  toJSON = A.toJSON . _showBinaryBase64
-instance WH.FromHttpApiData Binary where
-  parseUrlPiece = P.left T.pack . _readBinaryBase64
-instance WH.ToHttpApiData Binary where
-  toUrlPiece = _showBinaryBase64
-instance P.Show Binary where
-  show = T.unpack . _showBinaryBase64
+-- | 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
+  }
+  
+
+-- * 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
+  where
+    notNull (_, A.Null) = False
+    notNull _ = True
 
-_readBinaryBase64 :: Monad m => Text -> m Binary
-_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8
-{-# INLINE _readBinaryBase64 #-}
+-- | Encodes fields using WH.toQueryParam
+_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])
+_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x
 
-_showBinaryBase64 :: Binary -> Text
-_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
-{-# INLINE _showBinaryBase64 #-}
\ No newline at end of file +
-- | Collapse (Just "") to Nothing +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_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 +{-# INLINE _memptyToNothing #-} + +-- * DateTime Formatting + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t + +-- | @_parseISO8601@ +_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 = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +-- | parse an ISO8601 date-time string +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t + +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_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 TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} +
\ No newline at end of file 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 25b9e55eff2..aa1d021477e 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -1,20 +1,30 @@ -
{-|
+
{-
+   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: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
 Module : SwaggerPetstore
 -}
-
-module SwaggerPetstore
-  ( module SwaggerPetstore.Client
-  , module SwaggerPetstore.API
-  , module SwaggerPetstore.Model
-  , module SwaggerPetstore.MimeTypes
-  , module SwaggerPetstore.Lens
-  , module SwaggerPetstore.Logging
-  ) where
-
-import SwaggerPetstore.API
-import SwaggerPetstore.Client
-import SwaggerPetstore.Model
-import SwaggerPetstore.MimeTypes
-import SwaggerPetstore.Lens
-import SwaggerPetstore.Logging
-
\ No newline at end of file +
+module SwaggerPetstore + ( module SwaggerPetstore.Client + , module SwaggerPetstore.API + , module SwaggerPetstore.Model + , module SwaggerPetstore.MimeTypes + , module SwaggerPetstore.Lens + , module SwaggerPetstore.Logging + ) where + +import SwaggerPetstore.API +import SwaggerPetstore.Client +import SwaggerPetstore.Model +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens +import SwaggerPetstore.Logging +
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index d4faad4d5ca..cf703a572d6 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -26,9 +26,16 @@ main = do config0 <- S.withStdoutLogging =<< S.newConfig - let config = case lookup "HOST" env of - Just h -> config0 { S.configHost = BCL.pack h } - _ -> config0 + let config = + -- configure host + case lookup "HOST" env of + Just h -> config0 { S.configHost = BCL.pack h } + _ -> config0 + -- each configured auth method is only applied to requests that specify them + `S.addAuthMethod` S.AuthBasicHttpBasicTest "username" "password" + `S.addAuthMethod` S.AuthApiKeyApiKey "secret-key" + `S.addAuthMethod` S.AuthApiKeyApiKeyQuery "secret-key" + `S.addAuthMethod` S.AuthOAuthPetstoreAuth "secret-key" putStrLn "******** CONFIG ********" putStrLn (show config) @@ -87,7 +94,7 @@ runPet mgr config = do Right pet@S.Pet { S.petId = Just pid } -> do -- create the request for getPetById - let getPetByIdRequest = S.getPetById pid + let getPetByIdRequest = S.getPetById (S.PetId pid) -- dispatchMime returns MimeResult, which includes the -- expected decoded model object 'Pet', or a parse failure @@ -97,12 +104,12 @@ runPet mgr config = do Right r -> putStrLn $ "getPetById: found pet: " <> show r -- display 'Pet' model object, r -- findPetsByStatus - let findPetsByStatusRequest = S.findPetsByStatus ["available","pending","sold"] + let findPetsByStatusRequest = S.findPetsByStatus (S.Status ["available","pending","sold"]) findPetsByStatusResult <- S.dispatchMime mgr config findPetsByStatusRequest S.MimeJSON mapM_ (\r -> putStrLn $ "findPetsByStatus: found " <> (show . length) r <> " pets") findPetsByStatusResult -- findPetsByTags - let findPetsByTagsRequest = S.findPetsByTags ["name","tag1"] + let findPetsByTagsRequest = S.findPetsByTags (S.Tags ["name","tag1"]) findPetsByTagsResult <- S.dispatchMime mgr config findPetsByTagsRequest S.MimeJSON mapM_ (\r -> putStrLn $ "findPetsByTags: found " <> (show . length) r <> " pets") findPetsByTagsResult @@ -119,20 +126,20 @@ runPet mgr config = do -- -- Defined in ‘SwaggerPetstore.API’ -- instance S.HasOptionalParam S.UpdatePetWithForm S.Status -- -- Defined in ‘SwaggerPetstore.API’ - let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded pid + let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded (S.PetId pid) `S.applyOptionalParam` S.Name2 "petName" - `S.applyOptionalParam` S.Status "pending" + `S.applyOptionalParam` S.StatusText "pending" _ <- S.dispatchLbs mgr config updatePetWithFormRequest S.MimeJSON -- multipart/form-data file uploads are just a different content-type - let uploadFileRequest = S.uploadFile S.MimeMultipartFormData pid + let uploadFileRequest = S.uploadFile S.MimeMultipartFormData (S.PetId pid) `S.applyOptionalParam` S.File "package.yaml" -- the file contents of the path are read when dispatched `S.applyOptionalParam` S.AdditionalMetadata "a package.yaml file" uploadFileRequestResult <- S.dispatchMime mgr config uploadFileRequest S.MimeJSON mapM_ (\r -> putStrLn $ "uploadFile: " <> show r) uploadFileRequestResult -- deletePet - let deletePetRequest = S.deletePet pid + let deletePetRequest = S.deletePet (S.PetId pid) `S.applyOptionalParam` S.ApiKey "api key" _ <- S.dispatchLbs mgr config deletePetRequest S.MimeJSON @@ -155,7 +162,7 @@ runStore mgr config = do -- we can set arbitrary headers with setHeader let getInventoryRequest = S.getInventory - `S.setHeader` [("api_key","special-key")] + `S.setHeader` [("random-header","random-value")] getInventoryRequestRequestResult <- S.dispatchMime mgr config getInventoryRequest S.MimeJSON mapM_ (\r -> putStrLn $ "getInventoryRequest: found " <> (show . length) r <> " results") getInventoryRequestRequestResult @@ -168,12 +175,12 @@ runStore mgr config = do let orderId = maybe 10 id $ either (const Nothing) (S.orderId) (S.mimeResult placeOrderResult) -- getOrderByid - let getOrderByIdRequest = S.getOrderById orderId + let getOrderByIdRequest = S.getOrderById (S.OrderId orderId) getOrderByIdRequestResult <- S.dispatchMime mgr config getOrderByIdRequest S.MimeJSON mapM_ (\r -> putStrLn $ "getOrderById: found order: " <> show r) getOrderByIdRequestResult -- deleteOrder - let deleteOrderRequest = S.deleteOrder "21" + let deleteOrderRequest = S.deleteOrder (S.OrderIdText "21") _ <- S.dispatchLbs mgr config deleteOrderRequest S.MimeJSON return () @@ -205,32 +212,32 @@ runUser mgr config = do -- can use lenses (model record names are appended L) to view or modify records let users = take 8 $ drop 1 $ iterate (L.over S.userUsernameL (fmap (<> "*")) . L.over S.userIdL (fmap (+ 1))) user - let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON users + let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON (S.Body users) _ <- S.dispatchLbs mgr config createUsersWithArrayInputRequest S.MimeNoContent -- createUsersWithArrayInput - let createUsersWithListInputRequest = S.createUsersWithListInput S.MimeJSON users + let createUsersWithListInputRequest = S.createUsersWithListInput S.MimeJSON (S.Body users) _ <- S.dispatchLbs mgr config createUsersWithListInputRequest S.MimeNoContent -- getUserByName - let getUserByNameRequest = S.getUserByName username + let getUserByNameRequest = S.getUserByName (S.Username username) getUserByNameResult <- S.dispatchMime mgr config getUserByNameRequest S.MimeJSON mapM_ (\r -> putStrLn $ "getUserByName: found user: " <> show r) getUserByNameResult -- loginUser - let loginUserRequest = S.loginUser username "password1" + let loginUserRequest = S.loginUser (S.Username username) (S.Password "password1") loginUserResult <- S.dispatchLbs mgr config loginUserRequest S.MimeJSON BCL.putStrLn $ "loginUser: " <> (NH.responseBody loginUserResult) -- updateUser - let updateUserRequest = S.updateUser S.MimeJSON username (user { S.userEmail = Just "xyz@example.com" }) + let updateUserRequest = S.updateUser S.MimeJSON (S.Username username) (user { S.userEmail = Just "xyz@example.com" }) _ <- S.dispatchLbs mgr config updateUserRequest S.MimeJSON -- logoutUser _ <- S.dispatchLbs mgr config S.logoutUser S.MimeJSON -- deleteUser - let deleteUserRequest = S.deleteUser username + let deleteUserRequest = S.deleteUser (S.Username username) _ <- S.dispatchLbs mgr config deleteUserRequest S.MimeJSON return () 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 320722d1a21..1ced8a3c753 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -12,16 +12,17 @@ Module : SwaggerPetstore.API -} -{-# LANGUAGE RecordWildCards #-} - -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module SwaggerPetstore.API where @@ -40,6 +41,7 @@ import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Base64 as B64 import qualified Network.HTTP.Client.MultipartFormData as NH import qualified Network.HTTP.Media as ME @@ -49,7 +51,7 @@ import qualified Web.HttpApiData as WH import qualified Web.FormUrlEncoded as WH import qualified Data.CaseInsensitive as CI -import qualified Data.Data as P (Typeable) +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.Set as Set @@ -217,76 +219,77 @@ instance Produces TestClientModel MimeJSON -- -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -- --- AuthMethod: http_basic_test +-- AuthMethod: 'AuthBasicHttpBasicTest' -- -- Note: Has 'Produces' instances, but no response schema -- testEndpointParameters :: (Consumes TestEndpointParameters contentType) => contentType -- ^ request content-type ('MimeType') - -> Double -- ^ "number" - None - -> Double -- ^ "double" - None - -> Text -- ^ "patternWithoutDelimiter" - None - -> ByteArray -- ^ "byte" - None + -> Number -- ^ "number" - None + -> ParamDouble -- ^ "double" - None + -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None + -> Byte -- ^ "byte" - None -> SwaggerPetstoreRequest TestEndpointParameters contentType res -testEndpointParameters _ number double patternWithoutDelimiter byte = +testEndpointParameters _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = _mkRequest "POST" ["/fake"] - `_addForm` toForm ("number", number) - `_addForm` toForm ("double", double) - `_addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `_addForm` toForm ("byte", byte) + `addForm` toForm ("number", number) + `addForm` toForm ("double", double) + `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) + `addForm` toForm ("byte", byte) + `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) data TestEndpointParameters -- | /Optional Param/ "integer" - None instance HasOptionalParam TestEndpointParameters ParamInteger where applyOptionalParam req (ParamInteger xs) = - req `_addForm` toForm ("integer", xs) + req `addForm` toForm ("integer", xs) -- | /Optional Param/ "int32" - None instance HasOptionalParam TestEndpointParameters Int32 where applyOptionalParam req (Int32 xs) = - req `_addForm` toForm ("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) + req `addForm` toForm ("int64", xs) -- | /Optional Param/ "float" - None instance HasOptionalParam TestEndpointParameters ParamFloat where applyOptionalParam req (ParamFloat xs) = - req `_addForm` toForm ("float", xs) + req `addForm` toForm ("float", xs) -- | /Optional Param/ "string" - None instance HasOptionalParam TestEndpointParameters ParamString where applyOptionalParam req (ParamString xs) = - req `_addForm` toForm ("string", xs) + req `addForm` toForm ("string", xs) -- | /Optional Param/ "binary" - None instance HasOptionalParam TestEndpointParameters ParamBinary where applyOptionalParam req (ParamBinary xs) = - req `_addForm` toForm ("binary", xs) + req `addForm` toForm ("binary", xs) -- | /Optional Param/ "date" - None instance HasOptionalParam TestEndpointParameters ParamDate where applyOptionalParam req (ParamDate xs) = - req `_addForm` toForm ("date", xs) + req `addForm` toForm ("date", xs) -- | /Optional Param/ "dateTime" - None instance HasOptionalParam TestEndpointParameters ParamDateTime where applyOptionalParam req (ParamDateTime xs) = - req `_addForm` toForm ("dateTime", xs) + req `addForm` toForm ("dateTime", xs) -- | /Optional Param/ "password" - None instance HasOptionalParam TestEndpointParameters Password where applyOptionalParam req (Password xs) = - req `_addForm` toForm ("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) + req `addForm` toForm ("callback", xs) -- | @application/xml; charset=utf-8@ instance Consumes TestEndpointParameters MimeXmlCharsetutf8 @@ -321,12 +324,12 @@ 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) + 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) + req `addForm` toForm ("enum_form_string", xs) -- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where @@ -341,22 +344,22 @@ instance HasOptionalParam TestEnumParameters EnumHeaderString where -- | /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) + 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) + 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) + 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) + req `addForm` toForm ("enum_query_double", xs) -- | @*/*@ instance Consumes TestEnumParameters MimeAny @@ -376,13 +379,13 @@ instance Produces TestEnumParameters MimeAny testJsonFormData :: (Consumes TestJsonFormData contentType) => contentType -- ^ request content-type ('MimeType') - -> Text -- ^ "param" - field1 - -> Text -- ^ "param2" - field2 + -> Param -- ^ "param" - field1 + -> Param2 -- ^ "param2" - field2 -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent -testJsonFormData _ param param2 = +testJsonFormData _ (Param param) (Param2 param2) = _mkRequest "GET" ["/fake/jsonFormData"] - `_addForm` toForm ("param", param) - `_addForm` toForm ("param2", param2) + `addForm` toForm ("param", param) + `addForm` toForm ("param2", param2) data TestJsonFormData @@ -398,7 +401,7 @@ instance Consumes TestJsonFormData MimeJSON -- -- To test class name in snake case -- --- AuthMethod: api_key_query +-- AuthMethod: 'AuthApiKeyApiKeyQuery' -- testClassname :: (Consumes TestClassname contentType, MimeRender contentType Client) @@ -408,6 +411,7 @@ testClassname testClassname _ body = _mkRequest "PATCH" ["/fake_classname_test"] `setBodyParam` body + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) data TestClassname @@ -431,7 +435,7 @@ instance Produces TestClassname MimeJSON -- -- -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- -- Note: Has 'Produces' instances, but no response schema -- @@ -443,6 +447,7 @@ addPet addPet _ body = _mkRequest "POST" ["/pet"] `setBodyParam` body + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data AddPet @@ -468,16 +473,17 @@ instance Produces AddPet MimeJSON -- -- -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- -- Note: Has 'Produces' instances, but no response schema -- deletePet - :: Integer -- ^ "petId" - Pet id to delete + :: PetId -- ^ "petId" - Pet id to delete -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet petId = +deletePet (PetId petId) = _mkRequest "DELETE" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data DeletePet instance HasOptionalParam DeletePet ApiKey where @@ -497,14 +503,15 @@ instance Produces DeletePet MimeJSON -- -- Multiple status values can be provided with comma separated strings -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByStatus - :: [Text] -- ^ "status" - Status values that need to be considered for filter + :: Status -- ^ "status" - Status values that need to be considered for filter -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus status = +findPetsByStatus (Status status) = _mkRequest "GET" ["/pet/findByStatus"] - `_setQuery` toQueryColl CommaSeparated ("status", Just status) + `setQuery` toQueryColl CommaSeparated ("status", Just status) + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data FindPetsByStatus -- | @application/xml@ @@ -521,14 +528,15 @@ instance Produces FindPetsByStatus MimeJSON -- -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByTags - :: [Text] -- ^ "tags" - Tags to filter by + :: Tags -- ^ "tags" - Tags to filter by -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags tags = +findPetsByTags (Tags tags) = _mkRequest "GET" ["/pet/findByTags"] - `_setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) {-# DEPRECATED findPetsByTags "" #-} @@ -547,14 +555,15 @@ instance Produces FindPetsByTags MimeJSON -- -- Returns a single pet -- --- AuthMethod: api_key +-- AuthMethod: 'AuthApiKeyApiKey' -- getPetById - :: Integer -- ^ "petId" - ID of pet to return + :: PetId -- ^ "petId" - ID of pet to return -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -getPetById petId = +getPetById (PetId petId) = _mkRequest "GET" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) data GetPetById -- | @application/xml@ @@ -571,7 +580,7 @@ instance Produces GetPetById MimeJSON -- -- -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- -- Note: Has 'Produces' instances, but no response schema -- @@ -583,6 +592,7 @@ updatePet updatePet _ body = _mkRequest "PUT" ["/pet"] `setBodyParam` body + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UpdatePet @@ -608,30 +618,31 @@ instance Produces UpdatePet MimeJSON -- -- -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- -- Note: Has 'Produces' instances, but no response schema -- updatePetWithForm :: (Consumes UpdatePetWithForm contentType) => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet that needs to be updated + -> PetId -- ^ "petId" - ID of pet that needs to be updated -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ petId = +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) + req `addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet -instance HasOptionalParam UpdatePetWithForm Status where - applyOptionalParam req (Status xs) = - req `_addForm` toForm ("status", xs) +instance HasOptionalParam UpdatePetWithForm StatusText where + applyOptionalParam req (StatusText xs) = + req `addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -650,16 +661,17 @@ instance Produces UpdatePetWithForm MimeJSON -- -- -- --- AuthMethod: petstore_auth +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- uploadFile :: (Consumes UploadFile contentType) => contentType -- ^ request content-type ('MimeType') - -> Integer -- ^ "petId" - ID of pet to update + -> PetId -- ^ "petId" - ID of pet to update -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ petId = +uploadFile _ (PetId petId) = _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UploadFile @@ -693,9 +705,9 @@ instance Produces UploadFile MimeJSON -- Note: Has 'Produces' instances, but no response schema -- deleteOrder - :: Text -- ^ "orderId" - ID of the order that needs to be deleted + :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -deleteOrder orderId = +deleteOrder (OrderIdText orderId) = _mkRequest "DELETE" ["/store/order/",toPath orderId] @@ -714,12 +726,13 @@ instance Produces DeleteOrder MimeJSON -- -- Returns a map of status codes to quantities -- --- AuthMethod: api_key +-- AuthMethod: 'AuthApiKeyApiKey' -- getInventory :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) getInventory = _mkRequest "GET" ["/store/inventory"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) data GetInventory -- | @application/json@ @@ -735,9 +748,9 @@ instance Produces GetInventory MimeJSON -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -- getOrderById - :: Integer -- ^ "orderId" - ID of pet that needs to be fetched + :: OrderId -- ^ "orderId" - ID of pet that needs to be fetched -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -getOrderById orderId = +getOrderById (OrderId orderId) = _mkRequest "GET" ["/store/order/",toPath orderId] @@ -817,9 +830,9 @@ instance Produces CreateUser MimeJSON -- Note: Has 'Produces' instances, but no response schema -- createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object + -> Body -- ^ "body" - List of user object -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res createUsersWithArrayInput _ body = _mkRequest "POST" ["/user/createWithArray"] @@ -828,7 +841,7 @@ createUsersWithArrayInput _ body = data CreateUsersWithArrayInput -- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput [User] +instance HasBodyParam CreateUsersWithArrayInput Body -- | @application/xml@ instance Produces CreateUsersWithArrayInput MimeXML -- | @application/json@ @@ -846,9 +859,9 @@ instance Produces CreateUsersWithArrayInput MimeJSON -- Note: Has 'Produces' instances, but no response schema -- createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) => contentType -- ^ request content-type ('MimeType') - -> [User] -- ^ "body" - List of user object + -> Body -- ^ "body" - List of user object -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res createUsersWithListInput _ body = _mkRequest "POST" ["/user/createWithList"] @@ -857,7 +870,7 @@ createUsersWithListInput _ body = data CreateUsersWithListInput -- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput [User] +instance HasBodyParam CreateUsersWithListInput Body -- | @application/xml@ instance Produces CreateUsersWithListInput MimeXML -- | @application/json@ @@ -875,9 +888,9 @@ instance Produces CreateUsersWithListInput MimeJSON -- Note: Has 'Produces' instances, but no response schema -- deleteUser - :: Text -- ^ "username" - The name that needs to be deleted + :: Username -- ^ "username" - The name that needs to be deleted -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser username = +deleteUser (Username username) = _mkRequest "DELETE" ["/user/",toPath username] @@ -897,9 +910,9 @@ instance Produces DeleteUser MimeJSON -- -- getUserByName - :: Text -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + :: Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName username = +getUserByName (Username username) = _mkRequest "GET" ["/user/",toPath username] @@ -919,13 +932,13 @@ instance Produces GetUserByName MimeJSON -- -- loginUser - :: Text -- ^ "username" - The user name for login - -> Text -- ^ "password" - The password for login in clear text + :: Username -- ^ "username" - The user name for login + -> Password -- ^ "password" - The password for login in clear text -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser username password = +loginUser (Username username) (Password password) = _mkRequest "GET" ["/user/login"] - `_setQuery` toQuery ("username", Just username) - `_setQuery` toQuery ("password", Just password) + `setQuery` toQuery ("username", Just username) + `setQuery` toQuery ("password", Just password) data LoginUser -- | @application/xml@ @@ -969,10 +982,10 @@ instance Produces LogoutUser MimeJSON updateUser :: (Consumes UpdateUser contentType, MimeRender contentType User) => contentType -- ^ request content-type ('MimeType') - -> Text -- ^ "username" - name that need to be deleted + -> Username -- ^ "username" - name that need to be deleted -> User -- ^ "body" - Updated user object -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ username body = +updateUser _ (Username username) body = _mkRequest "PUT" ["/user/",toPath username] `setBodyParam` body @@ -1014,64 +1027,81 @@ class HasOptionalParam req param where infixl 2 -&- --- * Optional Request Parameter Types - - -newtype BodyOuterBoolean = BodyOuterBoolean { unBodyOuterBoolean :: OuterBoolean } deriving (P.Eq, P.Show) - -newtype BodyOuterComposite = BodyOuterComposite { unBodyOuterComposite :: OuterComposite } deriving (P.Eq, P.Show) - -newtype Body = Body { unBody :: OuterNumber } deriving (P.Eq, P.Show) - -newtype BodyOuterString = BodyOuterString { unBodyOuterString :: OuterString } deriving (P.Eq, P.Show) +-- * Request Parameter Types +-- | ApiKey +newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) +-- | StatusText +newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) +-- | ParamString +newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) +-- | ParamInteger newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) - +-- | EnumQueryDouble +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) +-- | Number +newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) +-- | Int32 newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) - -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) - -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) - -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) - -newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) - +-- | ParamDate newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) - -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) - -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) - -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) - -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) - +-- | EnumFormString newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show) - -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) - -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) - -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) - -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) - +-- | Body +newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) +-- | Tags +newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- | EnumQueryInteger newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) - -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) - -newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) - +-- | ParamFloat +newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) +-- | Name2 newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) - -newtype Status = Status { unStatus :: Text } deriving (P.Eq, P.Show) - +-- | Password +newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) +-- | Status +newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show) +-- | ParamDouble +newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) +-- | EnumHeaderString +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) +-- | Param2 +newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) +-- | PetId +newtype PetId = PetId { unPetId :: Integer } 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) +-- | EnumQueryString +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) +-- | ParamDateTime +newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) +-- | EnumQueryStringArray +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) +-- | PatternWithoutDelimiter +newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) +-- | Callback +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) +-- | Username +newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) +-- | Int64 +newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) +-- | AdditionalMetadata newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) - +-- | Byte +newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) +-- | ParamBinary +newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) +-- | EnumFormStringArray +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) +-- | EnumHeaderStringArray +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) +-- | Param +newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) +-- | File newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) - -- * SwaggerPetstoreRequest -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. @@ -1079,6 +1109,7 @@ data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , rParams :: Params -- ^ params of SwaggerPetstoreRequest + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods } deriving (P.Show) @@ -1097,6 +1128,11 @@ rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} +-- | 'rParams' Lens +rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep] +rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes +{-# INLINE rAuthTypesL #-} + -- | Request Params data Params = Params { paramsQuery :: NH.Query @@ -1134,7 +1170,7 @@ data ParamBody _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] _mkParams :: Params _mkParams = Params [] [] ParamBodyNone @@ -1166,8 +1202,8 @@ _setAcceptHeader req accept = Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["accept"] -_setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -_setQuery req query = +setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +setQuery req query = req & L.over (rParamsL . paramsQueryL) @@ -1175,8 +1211,8 @@ _setQuery req query = where cifst = CI.mk . P.fst -_addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -_addForm req newform = +addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +addForm req newform = let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty @@ -1197,6 +1233,9 @@ _setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> Sw _setBodyLBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) -- ** Params Utils @@ -1261,3 +1300,60 @@ _toCollA' c encode one xs = case c of {-# INLINE expandList #-} {-# INLINE combine #-} +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => AuthMethod a where + applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod req a@(AuthApiKeyApiKey secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + else req + +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + 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 req a@(AuthOAuthPetstoreAuth secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + else req + + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index 041f7a11013..51c766bb551 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -68,6 +68,7 @@ data SwaggerPetstoreConfig = SwaggerPetstoreConfig , configUserAgent :: Text -- ^ user-agent supplied in the Request , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods } -- | display the config @@ -96,13 +97,21 @@ newConfig = do , configUserAgent = "swagger-haskell-http-client/1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt + , configAuthMethods = [] } +-- | updates config use AuthMethod on matching requests +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 } +-- | updates the config to use stderr logging withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig withStderrLogging p = do logCxt <- stderrLoggingContext (configLogContext p) @@ -235,7 +244,9 @@ _toInitRequest -> IO (InitRequest req contentType res accept) -- ^ initialized request _toInitRequest config req0 accept = do parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _setAcceptHeader req0 accept & _setContentTypeHeader + let req1 = _applyAuthMethods req0 config + & _setContentTypeHeader + & flip _setAcceptHeader accept reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) pReq = parsedReq { NH.method = (rMethod req1) @@ -251,6 +262,16 @@ _toInitRequest config req0 accept = do pure (InitRequest outReq) +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: SwaggerPetstoreRequest req contentType res + -> SwaggerPetstoreConfig + -> SwaggerPetstoreRequest req contentType res +_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = + foldl go req as + where + go r (AnyAuthMethod a) = r `applyAuthMethod` a + -- | 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) 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 24e45353039..01b042c2c96 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -61,18 +61,21 @@ 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") +-- | ToJSON AdditionalPropertiesClass instance A.ToJSON AdditionalPropertiesClass where toJSON AdditionalPropertiesClass {..} = _omitNulls @@ -92,18 +95,21 @@ mkAdditionalPropertiesClass = -- ** 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 @@ -124,16 +130,19 @@ mkAnimal animalClassName = -- ** 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 +-- | ToJSON AnimalFarm instance A.ToJSON AnimalFarm where toJSON AnimalFarm = _omitNulls @@ -151,13 +160,15 @@ mkAnimalFarm = -- ** 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 @@ -165,6 +176,7 @@ instance A.FromJSON ApiResponse where <*> (o .:? "type") <*> (o .:? "message") +-- | ToJSON ApiResponse instance A.ToJSON ApiResponse where toJSON ApiResponse {..} = _omitNulls @@ -186,16 +198,19 @@ mkApiResponse = -- ** 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 @@ -213,16 +228,19 @@ mkArrayOfArrayOfNumberOnly = -- ** 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 @@ -240,13 +258,15 @@ mkArrayOfNumberOnly = -- ** 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 @@ -254,6 +274,7 @@ instance A.FromJSON ArrayTest where <*> (o .:? "array_array_of_integer") <*> (o .:? "array_array_of_model") +-- | ToJSON ArrayTest instance A.ToJSON ArrayTest where toJSON ArrayTest {..} = _omitNulls @@ -275,7 +296,7 @@ mkArrayTest = -- ** Capitalization --- | +-- | Capitalization data Capitalization = Capitalization { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" @@ -285,6 +306,8 @@ data Capitalization = Capitalization , 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 @@ -295,6 +318,7 @@ instance A.FromJSON Capitalization where <*> (o .:? "SCA_ETH_Flow_Points") <*> (o .:? "ATT_NAME") +-- | ToJSON Capitalization instance A.ToJSON Capitalization where toJSON Capitalization {..} = _omitNulls @@ -322,18 +346,21 @@ mkCapitalization = -- ** 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 @@ -353,17 +380,20 @@ mkCategory = -- ** 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 @@ -381,16 +411,19 @@ mkClassModel = -- ** 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 @@ -408,18 +441,21 @@ mkClient = -- ** EnumArrays --- | +-- | EnumArrays data EnumArrays = EnumArrays { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol" , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "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 @@ -439,16 +475,19 @@ mkEnumArrays = -- ** EnumClass --- | +-- | EnumClass data EnumClass = EnumClass { } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON EnumClass instance A.FromJSON EnumClass where parseJSON = A.withObject "EnumClass" $ \o -> pure EnumClass +-- | ToJSON EnumClass instance A.ToJSON EnumClass where toJSON EnumClass = _omitNulls @@ -466,7 +505,7 @@ mkEnumClass = -- ** EnumTest --- | +-- | EnumTest data EnumTest = EnumTest { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" @@ -474,6 +513,8 @@ data EnumTest = EnumTest , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON EnumTest instance A.FromJSON EnumTest where parseJSON = A.withObject "EnumTest" $ \o -> EnumTest @@ -482,6 +523,7 @@ instance A.FromJSON EnumTest where <*> (o .:? "enum_number") <*> (o .:? "outerEnum") +-- | ToJSON EnumTest instance A.ToJSON EnumTest where toJSON EnumTest {..} = _omitNulls @@ -505,7 +547,7 @@ mkEnumTest = -- ** FormatTest --- | +-- | FormatTest data FormatTest = FormatTest { formatTestInteger :: !(Maybe Int) -- ^ "integer" , formatTestInt32 :: !(Maybe Int) -- ^ "int32" @@ -522,6 +564,8 @@ data FormatTest = FormatTest , formatTestPassword :: !(Text) -- ^ /Required/ "password" } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON FormatTest instance A.FromJSON FormatTest where parseJSON = A.withObject "FormatTest" $ \o -> FormatTest @@ -539,6 +583,7 @@ instance A.FromJSON FormatTest where <*> (o .:? "uuid") <*> (o .: "password") +-- | ToJSON FormatTest instance A.ToJSON FormatTest where toJSON FormatTest {..} = _omitNulls @@ -584,18 +629,21 @@ mkFormatTest formatTestNumber formatTestByte formatTestDate 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") +-- | ToJSON HasOnlyReadOnly instance A.ToJSON HasOnlyReadOnly where toJSON HasOnlyReadOnly {..} = _omitNulls @@ -615,18 +663,21 @@ mkHasOnlyReadOnly = -- ** MapTest --- | +-- | MapTest data MapTest = MapTest { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "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 @@ -646,13 +697,15 @@ mkMapTest = -- ** 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 @@ -660,6 +713,7 @@ instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where <*> (o .:? "dateTime") <*> (o .:? "map") +-- | ToJSON MixedPropertiesAndAdditionalPropertiesClass instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = _omitNulls @@ -681,19 +735,22 @@ mkMixedPropertiesAndAdditionalPropertiesClass = -- ** 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 @@ -713,16 +770,19 @@ mkModel200Response = -- ** 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 @@ -740,17 +800,20 @@ mkModelList = -- ** 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 @@ -768,7 +831,7 @@ mkModelReturn = -- ** Name --- | +-- | Name -- Model for testing model name same as property name data Name = Name { nameName :: !(Int) -- ^ /Required/ "name" @@ -777,6 +840,8 @@ data Name = Name , name123Number :: !(Maybe Int) -- ^ "123Number" } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON Name instance A.FromJSON Name where parseJSON = A.withObject "Name" $ \o -> Name @@ -785,6 +850,7 @@ instance A.FromJSON Name where <*> (o .:? "property") <*> (o .:? "123Number") +-- | ToJSON Name instance A.ToJSON Name where toJSON Name {..} = _omitNulls @@ -809,16 +875,19 @@ mkName nameName = -- ** 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 @@ -836,7 +905,7 @@ mkNumberOnly = -- ** Order --- | +-- | Order data Order = Order { orderId :: !(Maybe Integer) -- ^ "id" , orderPetId :: !(Maybe Integer) -- ^ "petId" @@ -846,6 +915,8 @@ data Order = Order , orderComplete :: !(Maybe Bool) -- ^ "complete" } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON Order instance A.FromJSON Order where parseJSON = A.withObject "Order" $ \o -> Order @@ -856,6 +927,7 @@ instance A.FromJSON Order where <*> (o .:? "status") <*> (o .:? "complete") +-- | ToJSON Order instance A.ToJSON Order where toJSON Order {..} = _omitNulls @@ -883,16 +955,19 @@ mkOrder = -- ** OuterBoolean --- | +-- | OuterBoolean data OuterBoolean = OuterBoolean { } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON OuterBoolean instance A.FromJSON OuterBoolean where parseJSON = A.withObject "OuterBoolean" $ \o -> pure OuterBoolean +-- | ToJSON OuterBoolean instance A.ToJSON OuterBoolean where toJSON OuterBoolean = _omitNulls @@ -910,13 +985,15 @@ mkOuterBoolean = -- ** 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 @@ -924,6 +1001,7 @@ instance A.FromJSON OuterComposite where <*> (o .:? "my_string") <*> (o .:? "my_boolean") +-- | ToJSON OuterComposite instance A.ToJSON OuterComposite where toJSON OuterComposite {..} = _omitNulls @@ -945,16 +1023,19 @@ mkOuterComposite = -- ** OuterEnum --- | +-- | OuterEnum data OuterEnum = OuterEnum { } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON OuterEnum instance A.FromJSON OuterEnum where parseJSON = A.withObject "OuterEnum" $ \o -> pure OuterEnum +-- | ToJSON OuterEnum instance A.ToJSON OuterEnum where toJSON OuterEnum = _omitNulls @@ -972,16 +1053,19 @@ mkOuterEnum = -- ** OuterNumber --- | +-- | OuterNumber data OuterNumber = OuterNumber { } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON OuterNumber instance A.FromJSON OuterNumber where parseJSON = A.withObject "OuterNumber" $ \o -> pure OuterNumber +-- | ToJSON OuterNumber instance A.ToJSON OuterNumber where toJSON OuterNumber = _omitNulls @@ -999,16 +1083,19 @@ mkOuterNumber = -- ** OuterString --- | +-- | OuterString data OuterString = OuterString { } deriving (P.Show,P.Eq,P.Typeable) + +-- | FromJSON OuterString instance A.FromJSON OuterString where parseJSON = A.withObject "OuterString" $ \o -> pure OuterString +-- | ToJSON OuterString instance A.ToJSON OuterString where toJSON OuterString = _omitNulls @@ -1026,7 +1113,7 @@ mkOuterString = -- ** Pet --- | +-- | Pet data Pet = Pet { petId :: !(Maybe Integer) -- ^ "id" , petCategory :: !(Maybe Category) -- ^ "category" @@ -1036,6 +1123,8 @@ data Pet = Pet , petStatus :: !(Maybe Text) -- ^ "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 @@ -1046,6 +1135,7 @@ instance A.FromJSON Pet where <*> (o .:? "tags") <*> (o .:? "status") +-- | ToJSON Pet instance A.ToJSON Pet where toJSON Pet {..} = _omitNulls @@ -1075,18 +1165,21 @@ mkPet petName petPhotoUrls = -- ** 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 @@ -1106,16 +1199,19 @@ mkReadOnlyFirst = -- ** 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 @@ -1133,18 +1229,21 @@ mkSpecialModelName = -- ** 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 @@ -1164,7 +1263,7 @@ mkTag = -- ** User --- | +-- | User data User = User { userId :: !(Maybe Integer) -- ^ "id" , userUsername :: !(Maybe Text) -- ^ "username" @@ -1176,6 +1275,8 @@ data User = User , 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 @@ -1188,6 +1289,7 @@ instance A.FromJSON User where <*> (o .:? "phone") <*> (o .:? "userStatus") +-- | ToJSON User instance A.ToJSON User where toJSON User {..} = _omitNulls @@ -1219,13 +1321,15 @@ mkUser = -- ** 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 @@ -1233,6 +1337,7 @@ instance A.FromJSON Cat where <*> (o .:? "color") <*> (o .:? "declawed") +-- | ToJSON Cat instance A.ToJSON Cat where toJSON Cat {..} = _omitNulls @@ -1255,13 +1360,15 @@ mkCat catClassName = -- ** 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 @@ -1269,6 +1376,7 @@ instance A.FromJSON Dog where <*> (o .:? "color") <*> (o .:? "breed") +-- | ToJSON Dog instance A.ToJSON Dog where toJSON Dog {..} = _omitNulls @@ -1293,21 +1401,23 @@ mkDog dogClassName = -- * 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 where 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 +-- | Collapse (Just "") to Nothing _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing _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 @@ -1340,6 +1450,7 @@ _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} +-- | parse an ISO8601 date-time string _parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _parseISO8601 t = P.asum $ diff --git a/samples/client/petstore/haskell-http-client/pom.xml b/samples/client/petstore/haskell-http-client/pom.xml index 7ef1adb2331..1ae98163424 100644 --- a/samples/client/petstore/haskell-http-client/pom.xml +++ b/samples/client/petstore/haskell-http-client/pom.xml @@ -38,6 +38,7 @@ --install-ghc --no-haddock-deps haddock + --fast @@ -51,6 +52,7 @@ stack test + --fast diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index d2f9e7c9098..e981b82d4ec 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -92,6 +92,7 @@ test-suite tests , time , iso8601-time , aeson + , vector , semigroups , QuickCheck other-modules: diff --git a/samples/client/petstore/haskell-http-client/swagger.json b/samples/client/petstore/haskell-http-client/swagger.json index 4af4303cdb8..7c2e6c0cc65 100644 --- a/samples/client/petstore/haskell-http-client/swagger.json +++ b/samples/client/petstore/haskell-http-client/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index 4d00e2ec92f..a6563639f82 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -49,17 +49,24 @@ main = do env <- getEnvironment - let host = case lookup "HOST" env of - Just h -> BCL.pack h - _ -> "http://0.0.0.0/v2" + mgr <- NH.newManager NH.defaultManagerSettings config0 <- S.withStdoutLogging =<< S.newConfig - let config = config0 { S.configHost = host } + + let config = + -- configure host + case lookup "HOST" env of + Just h -> config0 { S.configHost = BCL.pack h } + _ -> config0 { S.configHost = "http://0.0.0.0/v2" } + -- each configured auth method is only applied to requests that specify them + `S.addAuthMethod` S.AuthBasicHttpBasicTest "username" "password" + `S.addAuthMethod` S.AuthApiKeyApiKey "secret-key" + `S.addAuthMethod` S.AuthApiKeyApiKeyQuery "secret-key" + `S.addAuthMethod` S.AuthOAuthPetstoreAuth "secret-key" putStrLn "\n******** CONFIG ********" putStrLn (show config) - mgr <- NH.newManager NH.defaultManagerSettings hspec $ do testPetOps mgr config @@ -91,7 +98,7 @@ testPetOps mgr config = Just pet@S.Pet {S.petId = Just petId} -> go (petId, pet) _ -> pendingWith "no petId") $ it "getPetById" $ \(petId, pet) -> do - let getPetByIdRequest = S.getPetById petId + let getPetByIdRequest = S.getPetById (S.PetId petId) getPetByIdRequestResult <- S.dispatchMime mgr config getPetByIdRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse getPetByIdRequestResult) `shouldBe` NH.status200 case S.mimeResult getPetByIdRequestResult of @@ -99,7 +106,7 @@ testPetOps mgr config = Left (S.MimeError e _) -> assertFailure e it "findPetsByStatus" $ do - let findPetsByStatusRequest = S.findPetsByStatus ["available","pending","sold"] + let findPetsByStatusRequest = S.findPetsByStatus (S.Status ["available","pending","sold"]) findPetsByStatusResult <- S.dispatchMime mgr config findPetsByStatusRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse findPetsByStatusResult) `shouldBe` NH.status200 case S.mimeResult findPetsByStatusResult of @@ -107,7 +114,7 @@ testPetOps mgr config = Left (S.MimeError e _) -> assertFailure e it "findPetsByTags" $ do - let findPetsByTagsRequest = S.findPetsByTags ["name","tag1"] + let findPetsByTagsRequest = S.findPetsByTags (S.Tags ["name","tag1"]) findPetsByTagsResult <- S.dispatchMime mgr config findPetsByTagsRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse findPetsByTagsResult) `shouldBe` NH.status200 case S.mimeResult findPetsByTagsResult of @@ -129,9 +136,9 @@ testPetOps mgr config = it "updatePetWithFormRequest" $ do readIORef _pet >>= \case Just S.Pet {S.petId = Just petId} -> do - let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded petId + let updatePetWithFormRequest = S.updatePetWithForm S.MimeFormUrlEncoded (S.PetId petId) `S.applyOptionalParam` S.Name2 "petName" - `S.applyOptionalParam` S.Status "pending" + `S.applyOptionalParam` S.StatusText "pending" updatePetWithFormResponse <- S.dispatchLbs mgr config updatePetWithFormRequest S.MimeJSON NH.responseStatus updatePetWithFormResponse `shouldBe` NH.status200 _ -> pendingWith "no pet" @@ -141,7 +148,7 @@ testPetOps mgr config = Just pet@S.Pet {S.petId = Just petId} -> go petId _ -> pendingWith "no petId") $ it "uploadFile" $ \petId -> do - let uploadFileRequest = S.uploadFile S.MimeMultipartFormData petId + let uploadFileRequest = S.uploadFile S.MimeMultipartFormData (S.PetId petId) `S.applyOptionalParam` S.File "package.yaml" `S.applyOptionalParam` S.AdditionalMetadata "a package.yaml file" uploadFileRequestResult <- S.dispatchMime mgr config uploadFileRequest S.MimeJSON @@ -155,7 +162,7 @@ testPetOps mgr config = Just pet@S.Pet {S.petId = Just petId} -> go petId _ -> pendingWith "no petId") $ it "deletePet" $ \petId -> do - let deletePetRequest = S.deletePet petId + let deletePetRequest = S.deletePet (S.PetId petId) `S.applyOptionalParam` S.ApiKey "api key" deletePetResponse <- S.dispatchLbs mgr config deletePetRequest S.MimeJSON NH.responseStatus deletePetResponse `shouldBe` NH.status200 @@ -200,7 +207,7 @@ testStoreOps mgr config = do Just order@S.Order {S.orderId = Just orderId} -> go (orderId, order) _ -> pendingWith "no orderId") $ it "getOrderById" $ \(orderId, order) -> do - let getOrderByIdRequest = S.getOrderById orderId + let getOrderByIdRequest = S.getOrderById (S.OrderId orderId) getOrderByIdRequestResult <- S.dispatchMime mgr config getOrderByIdRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse getOrderByIdRequestResult) `shouldBe` NH.status200 case S.mimeResult getOrderByIdRequestResult of @@ -212,7 +219,7 @@ testStoreOps mgr config = do Just S.Order {S.orderId = Just orderId} -> go (T.pack (show orderId)) _ -> pendingWith "no orderId") $ it "deleteOrder" $ \orderId -> do - let deleteOrderRequest = S.deleteOrder orderId + let deleteOrderRequest = S.deleteOrder (S.OrderIdText orderId) deleteOrderResult <- S.dispatchLbs mgr config deleteOrderRequest S.MimeJSON NH.responseStatus deleteOrderResult `shouldBe` NH.status200 @@ -249,19 +256,19 @@ testUserOps mgr config = do before (pure _users) $ it "createUsersWithArrayInput" $ \users -> do - let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON users + let createUsersWithArrayInputRequest = S.createUsersWithArrayInput S.MimeJSON (S.Body users) createUsersWithArrayInputResult <- S.dispatchLbs mgr config createUsersWithArrayInputRequest S.MimeNoContent NH.responseStatus createUsersWithArrayInputResult `shouldBe` NH.status200 before (pure _users) $ it "createUsersWithListInput" $ \users -> do - let createUsersWithListInputRequest = S.createUsersWithListInput S.MimeJSON users + let createUsersWithListInputRequest = S.createUsersWithListInput S.MimeJSON (S.Body users) createUsersWithListInputResult <- S.dispatchLbs mgr config createUsersWithListInputRequest S.MimeNoContent NH.responseStatus createUsersWithListInputResult `shouldBe` NH.status200 before (pure (_username, _user)) $ it "getUserByName" $ \(username, user) -> do - let getUserByNameRequest = S.getUserByName username + let getUserByNameRequest = S.getUserByName (S.Username username) getUserByNameResult <- S.dispatchMime mgr config getUserByNameRequest S.MimeJSON NH.responseStatus (S.mimeResultResponse getUserByNameResult) `shouldBe` NH.status200 case S.mimeResult getUserByNameResult of @@ -270,13 +277,13 @@ testUserOps mgr config = do before (pure (_username, _password)) $ it "loginUser" $ \(username, password) -> do - let loginUserRequest = S.loginUser username password + let loginUserRequest = S.loginUser (S.Username username) (S.Password password) loginUserResult <- S.dispatchLbs mgr config loginUserRequest S.MimeJSON NH.responseStatus loginUserResult `shouldBe` NH.status200 before (pure (_username, _user)) $ it "updateUser" $ \(username, user) -> do - let updateUserRequest = S.updateUser S.MimeJSON username user + let updateUserRequest = S.updateUser S.MimeJSON (S.Username username) user updateUserResult <- S.dispatchLbs mgr config updateUserRequest S.MimeJSON NH.responseStatus updateUserResult `shouldBe` NH.status200 @@ -286,6 +293,6 @@ testUserOps mgr config = do before (pure _username) $ it "deleteUser" $ \username -> do - let deleteUserRequest = S.deleteUser username + let deleteUserRequest = S.deleteUser (S.Username username) deleteUserResult <- S.dispatchLbs mgr config deleteUserRequest S.MimeJSON NH.responseStatus deleteUserResult `shouldBe` NH.status200 diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 87f3d95f95f..50853af7c99 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -2,20 +2,23 @@ module Instances where -import Data.Text (Text, pack) +import Control.Monad import Data.Char (isSpace) import Data.List (sort) -import qualified Data.Time as TI import Test.QuickCheck +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL import qualified Data.HashMap.Strict as HM import qualified Data.Set as Set -import qualified Data.ByteString.Lazy as BL +import qualified Data.Text as T +import qualified Data.Time as TI +import qualified Data.Vector as V import ApproxEq import SwaggerPetstore.Model -instance Arbitrary Text where - arbitrary = pack <$> arbitrary +instance Arbitrary T.Text where + arbitrary = T.pack <$> arbitrary instance Arbitrary TI.Day where arbitrary = TI.ModifiedJulianDay . (2000 +) <$> arbitrary @@ -45,6 +48,27 @@ instance Arbitrary Date where arbitrary = Date <$> arbitrary shrink (Date xs) = Date <$> shrink xs +-- | A naive Arbitrary instance for A.Value: +instance Arbitrary A.Value where + arbitrary = frequency [(3, simpleTypes), (1, arrayTypes), (1, objectTypes)] + where + simpleTypes :: Gen A.Value + simpleTypes = + frequency + [ (1, return A.Null) + , (2, liftM A.Bool (arbitrary :: Gen Bool)) + , (2, liftM (A.Number . fromIntegral) (arbitrary :: Gen Int)) + , (2, liftM (A.String . T.pack) (arbitrary :: Gen String)) + ] + mapF (k, v) = (T.pack k, v) + simpleAndArrays = frequency [(1, sized sizedArray), (4, simpleTypes)] + arrayTypes = sized sizedArray + objectTypes = sized sizedObject + sizedArray n = liftM (A.Array . V.fromList) $ replicateM n simpleTypes + sizedObject n = + liftM (A.object . map mapF) $ + replicateM n $ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays + -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups :: (Ord a) diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index 5ed151beee6..d717ddde856 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -17,42 +17,43 @@ import SwaggerPetstore.MimeTypes main :: IO () main = - hspec $ modifyMaxSize (const 10) $ - do describe "JSON instances" $ - do propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) - propMimeEq MimeJSON (Proxy :: Proxy Animal) - propMimeEq MimeJSON (Proxy :: Proxy AnimalFarm) - propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) - propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) - propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) - propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) - propMimeEq MimeJSON (Proxy :: Proxy Capitalization) - propMimeEq MimeJSON (Proxy :: Proxy Category) - propMimeEq MimeJSON (Proxy :: Proxy ClassModel) - propMimeEq MimeJSON (Proxy :: Proxy Client) - propMimeEq MimeJSON (Proxy :: Proxy EnumArrays) - propMimeEq MimeJSON (Proxy :: Proxy EnumClass) - propMimeEq MimeJSON (Proxy :: Proxy EnumTest) - propMimeEq MimeJSON (Proxy :: Proxy FormatTest) - propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) - propMimeEq MimeJSON (Proxy :: Proxy MapTest) - propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) - propMimeEq MimeJSON (Proxy :: Proxy Model200Response) - propMimeEq MimeJSON (Proxy :: Proxy ModelList) - propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) - propMimeEq MimeJSON (Proxy :: Proxy Name) - propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) - propMimeEq MimeJSON (Proxy :: Proxy Order) - propMimeEq MimeJSON (Proxy :: Proxy OuterBoolean) - propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) - propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) - propMimeEq MimeJSON (Proxy :: Proxy OuterNumber) - propMimeEq MimeJSON (Proxy :: Proxy OuterString) - propMimeEq MimeJSON (Proxy :: Proxy Pet) - propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) - propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) - propMimeEq MimeJSON (Proxy :: Proxy Tag) - propMimeEq MimeJSON (Proxy :: Proxy User) - propMimeEq MimeJSON (Proxy :: Proxy Cat) - propMimeEq MimeJSON (Proxy :: Proxy Dog) - + hspec $ modifyMaxSize (const 10) $ do + describe "JSON instances" $ do + pure () + propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy Animal) + propMimeEq MimeJSON (Proxy :: Proxy AnimalFarm) + propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) + propMimeEq MimeJSON (Proxy :: Proxy Capitalization) + propMimeEq MimeJSON (Proxy :: Proxy Category) + propMimeEq MimeJSON (Proxy :: Proxy ClassModel) + propMimeEq MimeJSON (Proxy :: Proxy Client) + propMimeEq MimeJSON (Proxy :: Proxy EnumArrays) + propMimeEq MimeJSON (Proxy :: Proxy EnumClass) + propMimeEq MimeJSON (Proxy :: Proxy EnumTest) + propMimeEq MimeJSON (Proxy :: Proxy FormatTest) + propMimeEq MimeJSON (Proxy :: Proxy HasOnlyReadOnly) + propMimeEq MimeJSON (Proxy :: Proxy MapTest) + propMimeEq MimeJSON (Proxy :: Proxy MixedPropertiesAndAdditionalPropertiesClass) + propMimeEq MimeJSON (Proxy :: Proxy Model200Response) + propMimeEq MimeJSON (Proxy :: Proxy ModelList) + propMimeEq MimeJSON (Proxy :: Proxy ModelReturn) + propMimeEq MimeJSON (Proxy :: Proxy Name) + propMimeEq MimeJSON (Proxy :: Proxy NumberOnly) + propMimeEq MimeJSON (Proxy :: Proxy Order) + propMimeEq MimeJSON (Proxy :: Proxy OuterBoolean) + propMimeEq MimeJSON (Proxy :: Proxy OuterComposite) + propMimeEq MimeJSON (Proxy :: Proxy OuterEnum) + propMimeEq MimeJSON (Proxy :: Proxy OuterNumber) + propMimeEq MimeJSON (Proxy :: Proxy OuterString) + propMimeEq MimeJSON (Proxy :: Proxy Pet) + propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) + propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) + propMimeEq MimeJSON (Proxy :: Proxy Tag) + propMimeEq MimeJSON (Proxy :: Proxy User) + propMimeEq MimeJSON (Proxy :: Proxy Cat) + propMimeEq MimeJSON (Proxy :: Proxy Dog) + From cc756b5563e77f9cd78d38b513a5f75d91b89886 Mon Sep 17 00:00:00 2001 From: Greg Marzouka Date: Sat, 7 Oct 2017 06:24:08 -0400 Subject: [PATCH 118/197] [Scala] Properly handle csv collectionFormat (#6540) * Add support for lists of path parameters (eg instances), and default params for optional case classes * Update Petstore sample * Revert defaulting of case class fields to None * Update Petstore sample --- .../src/main/resources/scala/apiInvoker.mustache | 3 +++ .../scala/src/main/scala/io/swagger/client/ApiInvoker.scala | 3 +++ .../scala/src/main/scala/io/swagger/client/ApiInvoker.scala | 3 +++ 3 files changed, 9 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache index 5c009e7e706..ccb74ec2f4d 100644 --- a/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/apiInvoker.mustache @@ -53,6 +53,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") } + def escape(values: List[String]): String = { + values.map(escape).mkString(",") + } def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 65cccaea4b2..182c49fc99d 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -63,6 +63,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") } + def escape(values: List[String]): String = { + values.map(escape).mkString(",") + } def escape(value: Long): String = value.toString diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 25ca1fc85cc..75f0833d51f 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -64,6 +64,9 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") } + def escape(values: List[String]): String = { + values.map(escape).mkString(",") + } def escape(value: Long): String = value.toString def escape(value: Double): String = value.toString From eab9c72a42b65ed2b2bef2bdddf9c6bc9761f8dc Mon Sep 17 00:00:00 2001 From: Adrian Moos Date: Sat, 7 Oct 2017 15:42:46 +0200 Subject: [PATCH 119/197] represent swagger enums as union of literal types (#6233) * represent swagger enums as union of literal types enabling their easy use in angular templates, structural subtyping among enums (in particular, different instances of the same enum are now mutually assignable), improving type safety by preventing incorrect widening, and permitting numeric enum values (albeit without descriptive names) Fixes #6206, #5146, #3500 * update samples * restore blank lines at end of file * fix typo --- .../resources/typescript-angular/modelEnum.mustache | 9 ++------- .../typescript-angular/modelGeneric.mustache | 11 +++-------- .../typescript-angular-v2/default/model/order.ts | 6 +----- .../typescript-angular-v2/default/model/pet.ts | 6 +----- .../petstore/typescript-angular-v2/npm/model/order.ts | 6 +----- .../petstore/typescript-angular-v2/npm/model/pet.ts | 6 +----- .../with-interfaces/model/Order.ts | 6 +----- .../with-interfaces/model/Pet.ts | 6 +----- .../petstore/typescript-angular-v4/npm/model/order.ts | 6 +----- .../petstore/typescript-angular-v4/npm/model/pet.ts | 6 +----- 10 files changed, 13 insertions(+), 55 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/modelEnum.mustache index 056533539ac..a32e859196f 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/modelEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/modelEnum.mustache @@ -1,7 +1,2 @@ -export enum {{classname}} { -{{#allowableValues}} -{{#enumVars}} - {{{name}}} = {{{value}}}{{^-last}},{{/-last}} -{{/enumVars}} -{{/allowableValues}} -} +export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; + diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/modelGeneric.mustache index 2f96d576d43..a8b3c80e364 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/modelGeneric.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/modelGeneric.mustache @@ -16,13 +16,8 @@ export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ export namespace {{classname}} { {{#vars}} {{#isEnum}} - export enum {{enumName}} { - {{#allowableValues}} - {{#enumVars}} - {{{name}}} = {{{value}}}{{^-last}},{{/-last}} - {{/enumVars}} - {{/allowableValues}} - } + export type {{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; {{/isEnum}} {{/vars}} -}{{/hasEnums}} \ No newline at end of file +}{{/hasEnums}} + diff --git a/samples/client/petstore/typescript-angular-v2/default/model/order.ts b/samples/client/petstore/typescript-angular-v2/default/model/order.ts index 402a86689c8..4639b8c2949 100644 --- a/samples/client/petstore/typescript-angular-v2/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v2/default/model/order.ts @@ -33,9 +33,5 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } diff --git a/samples/client/petstore/typescript-angular-v2/default/model/pet.ts b/samples/client/petstore/typescript-angular-v2/default/model/pet.ts index 0d6137d02cf..ce6c535b867 100644 --- a/samples/client/petstore/typescript-angular-v2/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v2/default/model/pet.ts @@ -35,9 +35,5 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/order.ts b/samples/client/petstore/typescript-angular-v2/npm/model/order.ts index 402a86689c8..4639b8c2949 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/model/order.ts @@ -33,9 +33,5 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts index 0d6137d02cf..ce6c535b867 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts @@ -35,9 +35,5 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Order.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Order.ts index 402a86689c8..4639b8c2949 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Order.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Order.ts @@ -33,9 +33,5 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Pet.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Pet.ts index 0d6137d02cf..ce6c535b867 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Pet.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/Pet.ts @@ -35,9 +35,5 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4/npm/model/order.ts index 402a86689c8..4639b8c2949 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/model/order.ts @@ -33,9 +33,5 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts index 0d6137d02cf..ce6c535b867 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts @@ -35,9 +35,5 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } From 7a7dd6d4cde4cbb86bf44928428479705cd6a120 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 8 Oct 2017 12:08:45 +0800 Subject: [PATCH 120/197] add ada style guide --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 491b56b5808..ab603bb2316 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,6 +35,7 @@ For a list of variables available in the template, please refer to this [page](h ### Style guide Code change should conform to the programming style guide of the respective languages: +- Ada: https://en.wikibooks.org/wiki/Ada_Style_Guide/Source_Code_Presentation - Android: https://source.android.com/source/code-style.html - Bash: https://github.com/bahamas10/bash-style-guide - C#: https://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx From cdc83ffd161149a6eddd3f52aa636b88f81876fa Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Sun, 8 Oct 2017 06:16:23 +0200 Subject: [PATCH 121/197] [Ada] Adding Ada client samples (#6634) * Add Ada client petstore samples - Add script to generate Ada client support with swagger-codegen - Add files to build the Ada sample - Add main program to use the generated client samples API and connect to the server to perform some operations * Add some description for the samples * Update the documentation to explain how to build, how to use the generated Ada client code --- bin/ada-petstore.sh | 35 ++ .../petstore/ada/.swagger-codegen-ignore | 23 ++ .../petstore/ada/.swagger-codegen/VERSION | 1 + samples/client/petstore/ada/README.md | 95 +++++ samples/client/petstore/ada/config.gpr | 88 +++++ samples/client/petstore/ada/petstore.gpr | 18 + .../src/client/samples-petstore-clients.adb | 355 ++++++++++++++++++ .../src/client/samples-petstore-clients.ads | 139 +++++++ .../src/client/samples-petstore-models.adb | 322 ++++++++++++++++ .../src/client/samples-petstore-models.ads | 216 +++++++++++ samples/client/petstore/ada/src/petstore.adb | 268 +++++++++++++ .../petstore/ada/src/samples-petstore.ads | 2 + samples/client/petstore/ada/src/samples.ads | 2 + 13 files changed, 1564 insertions(+) create mode 100755 bin/ada-petstore.sh create mode 100644 samples/client/petstore/ada/.swagger-codegen-ignore create mode 100644 samples/client/petstore/ada/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/ada/README.md create mode 100644 samples/client/petstore/ada/config.gpr create mode 100644 samples/client/petstore/ada/petstore.gpr create mode 100644 samples/client/petstore/ada/src/client/samples-petstore-clients.adb create mode 100644 samples/client/petstore/ada/src/client/samples-petstore-clients.ads create mode 100644 samples/client/petstore/ada/src/client/samples-petstore-models.adb create mode 100644 samples/client/petstore/ada/src/client/samples-petstore-models.ads create mode 100644 samples/client/petstore/ada/src/petstore.adb create mode 100644 samples/client/petstore/ada/src/samples-petstore.ads create mode 100644 samples/client/petstore/ada/src/samples.ads diff --git a/bin/ada-petstore.sh b/bin/ada-petstore.sh new file mode 100755 index 00000000000..d46e5013378 --- /dev/null +++ b/bin/ada-petstore.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +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" +model="modules/swagger-codegen/src/test/resources/2_0/petstore.yaml" +ags="$@ generate --template-dir modules/swagger-codegen/src/main/resources/Ada -l ada" +ags="$ags -i $model -t modules/swagger-codegen/src/main/resources/Ada -o samples/client/petstore/ada" +ags="$ags -DprojectName=Petstore --model-package Samples.Petstore" + +java $JAVA_OPTS -jar $executable $ags +rm -rf samples/client/petstore/ada/src/server diff --git a/samples/client/petstore/ada/.swagger-codegen-ignore b/samples/client/petstore/ada/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/ada/.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/ada/.swagger-codegen/VERSION b/samples/client/petstore/ada/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/ada/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ada/README.md b/samples/client/petstore/ada/README.md new file mode 100644 index 00000000000..1a055b7a58b --- /dev/null +++ b/samples/client/petstore/ada/README.md @@ -0,0 +1,95 @@ +# Swagger Petstore Ada Client + +## Overview + +This Ada client uses the Petstore API to demonstrate how to use the generator +and use the generated Ada code. The following files are generated by +[Swagger Codegen](https://github.com/swagger-api/swagger-codegen): + +* src/client/samples-petstore-models.ads +* src/client/samples-petstore-models.adb +* src/client/samples-petstore-clients.ads +* src/client/samples-petstore-clients.adb + +The 'Models' package contains the definition of types used by the request or response +in the API operations. It also provides operations to serialize and deserialize these +objects in JSON, XML or form-based data streams. + +The 'Clients' package contains the definition of operations provided by the Petstore API. + +## Requirements. + +To build this sample, you must have installed the GNAT Ada compiler as well the following libraries: + +* Ada Util (https://github.com/stcarrez/ada-util) +* Swagger Ada (https://github.com/stcarrez/swagger-ada) +* AWS (http://libre.adacore.com/libre/tools/aws/) + +## Building the petstore client + +Build the petstore client by using the following command: +```sh +gprbuild -Ppetstore -p +``` + +## Using the Swagger Ada code + +### Initialization + +The HTTP/REST support is provided by [Ada Util](https://github.com/stcarrez/ada-util) +and encapsulated by [Swagger Ada](https://github.com/stcarrez/swagger-ada). If you want +to use Curl, you should initialize with the following: + +``` + Util.Http.Clients.Curl.Register; +``` + +But if you want to use [AWS](http://libre.adacore.com/libre/tools/aws/), you will initialize with: + + +``` + Util.Http.Clients.Web.Register; +``` + +After the initialization is done, you will declare a client instance to access +the API operations: + +``` + C : Samples.Petstore.Clients.Client_Type; +``` + +The 'Client_Type' is the generated type that will implement the operations +described in the OpenAPI description file. + +And you should initialize the server base URI you want to connect to: + +``` + C.Set_Server ("http://petstore.swagger.io/v2"); +``` + +At this stage, you can use the generated operation. + +### Calling an operation + +Let's retrieve some pet information by calling the 'Get_Pet_By_Id' operation. +This operation needs an integer as input parameter and returns a 'Pet_Type' +object that contains all the pet information. You will first declare +the pet instance as follows: + +``` + Pet : Samples.Petstore.Models.Pet_Type; +``` + +And then call the 'Get_Pet_By_Id' operation: + +``` + C.Get_Pet_By_Id (768, Pet); +``` + +At this stage, you can access information from the 'Pet' instance: + +``` + Ada.Text_IO.Put_Line ("Id : " & Swagger.Long'Image (Pet.Id)); + Ada.Text_IO.Put_Line ("Name : " & Swagger.To_String (Pet.Name)); + Ada.Text_IO.Put_Line ("Status : " & Swagger.To_String (Pet.Status)); +``` diff --git a/samples/client/petstore/ada/config.gpr b/samples/client/petstore/ada/config.gpr new file mode 100644 index 00000000000..d3533ef3398 --- /dev/null +++ b/samples/client/petstore/ada/config.gpr @@ -0,0 +1,88 @@ +abstract project Config is + for Source_Dirs use (); + + type Yes_No is ("yes", "no"); + + type Library_Type_Type is ("relocatable", "static"); + + type Mode_Type is ("distrib", "debug", "optimize", "profile"); + Mode : Mode_Type := external ("MODE", "debug"); + + Coverage : Yes_No := External ("COVERAGE", "no"); + Processors := External ("PROCESSORS", "1"); + + package Builder is + case Mode is + when "debug" => + for Default_Switches ("Ada") use ("-g", "-j" & Processors); + when others => + for Default_Switches ("Ada") use ("-g", "-O2", "-j" & Processors); + end case; + end Builder; + + package compiler is + warnings := ("-gnatwua"); + defaults := ("-gnat2012"); + case Mode is + when "distrib" => + for Default_Switches ("Ada") use defaults & ("-gnatafno", "-gnatVa", "-gnatwa"); + + when "debug" => + for Default_Switches ("Ada") use defaults & warnings + & ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM99"); + + when "optimize" => + for Default_Switches ("Ada") use defaults & warnings + & ("-gnatn", "-gnatp", "-fdata-sections", "-ffunction-sections"); + + when "profile" => + for Default_Switches ("Ada") use defaults & warnings & ("-pg"); + end case; + + case Coverage is + when "yes" => + for Default_Switches ("ada") use Compiler'Default_Switches ("Ada") & + ("-fprofile-arcs", "-ftest-coverage"); + when others => + end case; + end compiler; + + package binder is + case Mode is + when "debug" => + for Default_Switches ("Ada") use ("-E"); + + when others => + for Default_Switches ("Ada") use ("-E"); + + end case; + end binder; + + package linker is + case Mode is + when "profile" => + for Default_Switches ("Ada") use ("-pg"); + + when "distrib" => + for Default_Switches ("Ada") use ("-s"); + + when "optimize" => + for Default_Switches ("Ada") use ("-Wl,--gc-sections"); + + when others => + null; + end case; + + case Coverage is + when "yes" => + for Default_Switches ("ada") use Linker'Default_Switches ("ada") & + ("-fprofile-arcs"); + when others => + end case; + end linker; + + package Ide is + for VCS_Kind use "git"; + end Ide; + +end Config; diff --git a/samples/client/petstore/ada/petstore.gpr b/samples/client/petstore/ada/petstore.gpr new file mode 100644 index 00000000000..ffcd99fd76c --- /dev/null +++ b/samples/client/petstore/ada/petstore.gpr @@ -0,0 +1,18 @@ +with "config"; +with "util"; +with "util_http"; +with "swagger"; +project Petstore is + + Mains := ("petstore.adb"); + for Main use Mains; + for Source_Dirs use ("src", "src/client"); + for Object_Dir use "./obj"; + for Exec_Dir use "./bin"; + + package Binder renames Config.Binder; + package Builder renames Config.Builder; + package Compiler renames Config.Compiler; + package Linker renames Config.Linker; + +end Petstore; diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb new file mode 100644 index 00000000000..37e99fb6575 --- /dev/null +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -0,0 +1,355 @@ +-- 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 package is auto generated by the swagger code generator 2.3.0-SNAPSHOT. +-- https://github.com/swagger-api/swagger-codegen.git +-- Do not edit the class manually. +with Swagger.Streams; +package body Samples.Petstore.Clients is + + -- Add a new pet to the store + procedure Add_Pet + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Pet_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (Swagger.Clients.APPLICATION_JSON, + Swagger.Clients.APPLICATION_XML)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/pet"); + Client.Call (Swagger.Clients.POST, URI, Req); + end Add_Pet; + + -- Deletes a pet + procedure Delete_Pet + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Api_Key : in Swagger.UString) is + URI : Swagger.Clients.URI_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/pet/{petId}"); + URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); + Client.Call (Swagger.Clients.DELETE, URI); + end Delete_Pet; + + -- Finds Pets by status + -- Multiple status values can be provided with comma separated strings + procedure Find_Pets_By_Status + (Client : in out Client_Type; + Status : in Swagger.UString_Vectors.Vector; + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Add_Param ("status", Status); + URI.Set_Path ("/pet/findByStatus"); + Client.Call (Swagger.Clients.GET, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Find_Pets_By_Status; + + -- Finds Pets by tags + -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + procedure Find_Pets_By_Tags + (Client : in out Client_Type; + Tags : in Swagger.UString_Vectors.Vector; + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Add_Param ("tags", Tags); + URI.Set_Path ("/pet/findByTags"); + Client.Call (Swagger.Clients.GET, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Find_Pets_By_Tags; + + -- Find pet by ID + -- Returns a single pet + procedure Get_Pet_By_Id + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Result : out Samples.Petstore.Models.Pet_Type) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/pet/{petId}"); + URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); + Client.Call (Swagger.Clients.GET, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Get_Pet_By_Id; + + -- Update an existing pet + procedure Update_Pet + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Pet_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (Swagger.Clients.APPLICATION_JSON, + Swagger.Clients.APPLICATION_XML)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/pet"); + Client.Call (Swagger.Clients.PUT, URI, Req); + end Update_Pet; + + -- Updates a pet in the store with form data + procedure Update_Pet_With_Form + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Name : in Swagger.UString; + Status : in Swagger.UString) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_FORM)); + Req.Stream.Write_Entity ("name", Name); + Req.Stream.Write_Entity ("status", Status); + + URI.Set_Path ("/pet/{petId}"); + URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); + Client.Call (Swagger.Clients.POST, URI); + end Update_Pet_With_Form; + + -- uploads an image + procedure Upload_File + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Additional_Metadata : in Swagger.UString; + File : in Swagger.Http_Content_Type; + Result : out Samples.Petstore.Models.ApiResponse_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((1 => Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_FORM)); + Req.Stream.Write_Entity ("additionalMetadata", Additional_Metadata); + Req.Stream.Write_Entity ("file", File); + + URI.Set_Path ("/pet/{petId}/uploadImage"); + URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); + Client.Call (Swagger.Clients.POST, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Upload_File; + + -- Delete purchase order by ID + -- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + procedure Delete_Order + (Client : in out Client_Type; + Order_Id : in Swagger.UString) is + URI : Swagger.Clients.URI_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/store/order/{orderId}"); + URI.Set_Path_Param ("orderId", Order_Id); + Client.Call (Swagger.Clients.DELETE, URI); + end Delete_Order; + + -- Returns pet inventories by status + -- Returns a map of status codes to quantities + procedure Get_Inventory + (Client : in out Client_Type; + Result : out Swagger.Integer_Map) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((1 => Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/store/inventory"); + Client.Call (Swagger.Clients.GET, URI, Reply); + Swagger.Streams.Deserialize (Reply, "", Result); + end Get_Inventory; + + -- Find purchase order by ID + -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + procedure Get_Order_By_Id + (Client : in out Client_Type; + Order_Id : in Swagger.Long; + Result : out Samples.Petstore.Models.Order_Type) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/store/order/{orderId}"); + URI.Set_Path_Param ("orderId", Swagger.To_String (Order_Id)); + Client.Call (Swagger.Clients.GET, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Get_Order_By_Id; + + -- Place an order for a pet + procedure Place_Order + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Order_Type; + Result : out Samples.Petstore.Models.Order_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/store/order"); + Client.Call (Swagger.Clients.POST, URI, Req, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Place_Order; + + -- Create user + -- This can only be done by the logged in user. + procedure Create_User + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/user"); + Client.Call (Swagger.Clients.POST, URI, Req); + end Create_User; + + -- Creates list of users with given input array + procedure Create_Users_With_Array_Input + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/user/createWithArray"); + Client.Call (Swagger.Clients.POST, URI, Req); + end Create_Users_With_Array_Input; + + -- Creates list of users with given input array + procedure Create_Users_With_List_Input + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/user/createWithList"); + Client.Call (Swagger.Clients.POST, URI, Req); + end Create_Users_With_List_Input; + + -- Delete user + -- This can only be done by the logged in user. + procedure Delete_User + (Client : in out Client_Type; + Username : in Swagger.UString) is + URI : Swagger.Clients.URI_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/user/{username}"); + URI.Set_Path_Param ("username", Username); + Client.Call (Swagger.Clients.DELETE, URI); + end Delete_User; + + -- Get user by user name + procedure Get_User_By_Name + (Client : in out Client_Type; + Username : in Swagger.UString; + Result : out Samples.Petstore.Models.User_Type) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/user/{username}"); + URI.Set_Path_Param ("username", Username); + Client.Call (Swagger.Clients.GET, URI, Reply); + Samples.Petstore.Models.Deserialize (Reply, "", Result); + end Get_User_By_Name; + + -- Logs user into the system + procedure Login_User + (Client : in out Client_Type; + Username : in Swagger.UString; + Password : in Swagger.UString; + Result : out Swagger.UString) is + URI : Swagger.Clients.URI_Type; + Reply : Swagger.Value_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Add_Param ("username", Username); + URI.Add_Param ("password", Password); + URI.Set_Path ("/user/login"); + Client.Call (Swagger.Clients.GET, URI, Reply); + Swagger.Streams.Deserialize (Reply, "", Result); + end Login_User; + + -- Logs out current logged in user session + procedure Logout_User + (Client : in out Client_Type) is + URI : Swagger.Clients.URI_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + + URI.Set_Path ("/user/logout"); + Client.Call (Swagger.Clients.GET, URI); + end Logout_User; + + -- Updated user + -- This can only be done by the logged in user. + procedure Update_User + (Client : in out Client_Type; + Username : in Swagger.UString; + P_Body : in Samples.Petstore.Models.User_Type) is + URI : Swagger.Clients.URI_Type; + Req : Swagger.Clients.Request_Type; + begin + Client.Set_Accept ((Swagger.Clients.APPLICATION_XML, + Swagger.Clients.APPLICATION_JSON)); + Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); + Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body); + + URI.Set_Path ("/user/{username}"); + URI.Set_Path_Param ("username", Username); + Client.Call (Swagger.Clients.PUT, URI, Req); + end Update_User; +end Samples.Petstore.Clients; diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads new file mode 100644 index 00000000000..e10d1ab4cd1 --- /dev/null +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads @@ -0,0 +1,139 @@ +-- 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 package is auto generated by the swagger code generator 2.3.0-SNAPSHOT. +-- https://github.com/swagger-api/swagger-codegen.git +-- Do not edit the class manually. +with Samples.Petstore.Models; +with Swagger.Clients; +package Samples.Petstore.Clients is + + type Client_Type is new Swagger.Clients.Client_Type with null record; + + -- Add a new pet to the store + procedure Add_Pet + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Pet_Type); + + -- Deletes a pet + procedure Delete_Pet + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Api_Key : in Swagger.UString); + + -- Finds Pets by status + -- Multiple status values can be provided with comma separated strings + procedure Find_Pets_By_Status + (Client : in out Client_Type; + Status : in Swagger.UString_Vectors.Vector; + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); + + -- Finds Pets by tags + -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + procedure Find_Pets_By_Tags + (Client : in out Client_Type; + Tags : in Swagger.UString_Vectors.Vector; + Result : out Samples.Petstore.Models.Pet_Type_Vectors.Vector); + + -- Find pet by ID + -- Returns a single pet + procedure Get_Pet_By_Id + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Result : out Samples.Petstore.Models.Pet_Type); + + -- Update an existing pet + procedure Update_Pet + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Pet_Type); + + -- Updates a pet in the store with form data + procedure Update_Pet_With_Form + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Name : in Swagger.UString; + Status : in Swagger.UString); + + -- uploads an image + procedure Upload_File + (Client : in out Client_Type; + Pet_Id : in Swagger.Long; + Additional_Metadata : in Swagger.UString; + File : in Swagger.Http_Content_Type; + Result : out Samples.Petstore.Models.ApiResponse_Type); + + -- Delete purchase order by ID + -- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + procedure Delete_Order + (Client : in out Client_Type; + Order_Id : in Swagger.UString); + + -- Returns pet inventories by status + -- Returns a map of status codes to quantities + procedure Get_Inventory + (Client : in out Client_Type; + Result : out Swagger.Integer_Map); + + -- Find purchase order by ID + -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + procedure Get_Order_By_Id + (Client : in out Client_Type; + Order_Id : in Swagger.Long; + Result : out Samples.Petstore.Models.Order_Type); + + -- Place an order for a pet + procedure Place_Order + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.Order_Type; + Result : out Samples.Petstore.Models.Order_Type); + + -- Create user + -- This can only be done by the logged in user. + procedure Create_User + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type); + + -- Creates list of users with given input array + procedure Create_Users_With_Array_Input + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); + + -- Creates list of users with given input array + procedure Create_Users_With_List_Input + (Client : in out Client_Type; + P_Body : in Samples.Petstore.Models.User_Type_Vectors.Vector); + + -- Delete user + -- This can only be done by the logged in user. + procedure Delete_User + (Client : in out Client_Type; + Username : in Swagger.UString); + + -- Get user by user name + procedure Get_User_By_Name + (Client : in out Client_Type; + Username : in Swagger.UString; + Result : out Samples.Petstore.Models.User_Type); + + -- Logs user into the system + procedure Login_User + (Client : in out Client_Type; + Username : in Swagger.UString; + Password : in Swagger.UString; + Result : out Swagger.UString); + + -- Logs out current logged in user session + procedure Logout_User + (Client : in out Client_Type); + + -- Updated user + -- This can only be done by the logged in user. + procedure Update_User + (Client : in out Client_Type; + Username : in Swagger.UString; + P_Body : in Samples.Petstore.Models.User_Type); + +end Samples.Petstore.Clients; diff --git a/samples/client/petstore/ada/src/client/samples-petstore-models.adb b/samples/client/petstore/ada/src/client/samples-petstore-models.adb new file mode 100644 index 00000000000..2c2cf97126d --- /dev/null +++ b/samples/client/petstore/ada/src/client/samples-petstore-models.adb @@ -0,0 +1,322 @@ +-- 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 package is auto generated by the swagger code generator 2.3.0-SNAPSHOT. +-- https://github.com/swagger-api/swagger-codegen.git +-- Do not edit the class manually. + +package body Samples.Petstore.Models is + + use Swagger.Streams; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in ApiResponse_Type) is + begin + Into.Start_Entity (Name); + Into.Write_Entity ("code", Value.Code); + Into.Write_Entity ("type", Value.P_Type); + Into.Write_Entity ("message", Value.Message); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in ApiResponse_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out ApiResponse_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "code", Value.Code); + Swagger.Streams.Deserialize (Object, "type", Value.P_Type); + Swagger.Streams.Deserialize (Object, "message", Value.Message); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out ApiResponse_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : ApiResponse_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Category_Type) is + begin + Into.Start_Entity (Name); + Serialize (Into, "id", Value.Id); + Into.Write_Entity ("name", Value.Name); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Category_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Category_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "id", Value.Id); + Swagger.Streams.Deserialize (Object, "name", Value.Name); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Category_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : Category_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Tag_Type) is + begin + Into.Start_Entity (Name); + Serialize (Into, "id", Value.Id); + Into.Write_Entity ("name", Value.Name); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Tag_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Tag_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "id", Value.Id); + Swagger.Streams.Deserialize (Object, "name", Value.Name); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Tag_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : Tag_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in User_Type) is + begin + Into.Start_Entity (Name); + Serialize (Into, "id", Value.Id); + Into.Write_Entity ("username", Value.Username); + Into.Write_Entity ("firstName", Value.First_Name); + Into.Write_Entity ("lastName", Value.Last_Name); + Into.Write_Entity ("email", Value.Email); + Into.Write_Entity ("password", Value.Password); + Into.Write_Entity ("phone", Value.Phone); + Into.Write_Entity ("userStatus", Value.User_Status); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in User_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out User_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "id", Value.Id); + Swagger.Streams.Deserialize (Object, "username", Value.Username); + Swagger.Streams.Deserialize (Object, "firstName", Value.First_Name); + Swagger.Streams.Deserialize (Object, "lastName", Value.Last_Name); + Swagger.Streams.Deserialize (Object, "email", Value.Email); + Swagger.Streams.Deserialize (Object, "password", Value.Password); + Swagger.Streams.Deserialize (Object, "phone", Value.Phone); + Swagger.Streams.Deserialize (Object, "userStatus", Value.User_Status); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out User_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : User_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Order_Type) is + begin + Into.Start_Entity (Name); + Serialize (Into, "id", Value.Id); + Serialize (Into, "petId", Value.Pet_Id); + Into.Write_Entity ("quantity", Value.Quantity); + Into.Write_Entity ("shipDate", Value.Ship_Date); + Into.Write_Entity ("status", Value.Status); + Into.Write_Entity ("complete", Value.Complete); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Order_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Order_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "id", Value.Id); + Swagger.Streams.Deserialize (Object, "petId", Value.Pet_Id); + Swagger.Streams.Deserialize (Object, "quantity", Value.Quantity); + Deserialize (Object, "shipDate", Value.Ship_Date); + Swagger.Streams.Deserialize (Object, "status", Value.Status); + Swagger.Streams.Deserialize (Object, "complete", Value.Complete); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Order_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : Order_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Pet_Type) is + begin + Into.Start_Entity (Name); + Serialize (Into, "id", Value.Id); + Serialize (Into, "category", Value.Category); + Into.Write_Entity ("name", Value.Name); + Serialize (Into, "photoUrls", Value.Photo_Urls); + Serialize (Into, "tags", Value.Tags); + Into.Write_Entity ("status", Value.Status); + Into.End_Entity (Name); + end Serialize; + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Pet_Type_Vectors.Vector) is + begin + Into.Start_Array (Name); + for Item of Value loop + Serialize (Into, "", Item); + end loop; + Into.End_Array (Name); + end Serialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Pet_Type) is + Object : Swagger.Value_Type; + begin + Swagger.Streams.Deserialize (From, Name, Object); + Swagger.Streams.Deserialize (Object, "id", Value.Id); + Deserialize (Object, "category", Value.Category); + Swagger.Streams.Deserialize (Object, "name", Value.Name); + Swagger.Streams.Deserialize (Object, "photoUrls", Value.Photo_Urls); + Deserialize (Object, "tags", Value.Tags); + Swagger.Streams.Deserialize (Object, "status", Value.Status); + end Deserialize; + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Pet_Type_Vectors.Vector) is + List : Swagger.Value_Array_Type; + Item : Pet_Type; + begin + Value.Clear; + Swagger.Streams.Deserialize (From, Name, List); + for Data of List loop + Deserialize (Data, "", Item); + Value.Append (Item); + end loop; + end Deserialize; + + +end Samples.Petstore.Models; diff --git a/samples/client/petstore/ada/src/client/samples-petstore-models.ads b/samples/client/petstore/ada/src/client/samples-petstore-models.ads new file mode 100644 index 00000000000..7bf3095598f --- /dev/null +++ b/samples/client/petstore/ada/src/client/samples-petstore-models.ads @@ -0,0 +1,216 @@ +-- 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 package is auto generated by the swagger code generator 2.3.0-SNAPSHOT. +-- https://github.com/swagger-api/swagger-codegen.git +-- Do not edit the class manually. +with Swagger.Streams; +with Ada.Containers.Vectors; +package Samples.Petstore.Models is + + + -- ------------------------------ + -- An uploaded response + -- Describes the result of uploading an image resource + -- ------------------------------ + type ApiResponse_Type is + record + Code : Integer; + P_Type : Swagger.UString; + Message : Swagger.UString; + end record; + + package ApiResponse_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => ApiResponse_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in ApiResponse_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in ApiResponse_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out ApiResponse_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out ApiResponse_Type_Vectors.Vector); + + + -- ------------------------------ + -- Pet catehgry + -- A category for a pet + -- ------------------------------ + type Category_Type is + record + Id : Swagger.Long; + Name : Swagger.UString; + end record; + + package Category_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => Category_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Category_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Category_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Category_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Category_Type_Vectors.Vector); + + + -- ------------------------------ + -- Pet Tag + -- A tag for a pet + -- ------------------------------ + type Tag_Type is + record + Id : Swagger.Long; + Name : Swagger.UString; + end record; + + package Tag_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => Tag_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Tag_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Tag_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Tag_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Tag_Type_Vectors.Vector); + + + -- ------------------------------ + -- a User + -- A User who is purchasing from the pet store + -- ------------------------------ + type User_Type is + record + Id : Swagger.Long; + Username : Swagger.UString; + First_Name : Swagger.UString; + Last_Name : Swagger.UString; + Email : Swagger.UString; + Password : Swagger.UString; + Phone : Swagger.UString; + User_Status : Integer; + end record; + + package User_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => User_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in User_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in User_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out User_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out User_Type_Vectors.Vector); + + + -- ------------------------------ + -- Pet Order + -- An order for a pets from the pet store + -- ------------------------------ + type Order_Type is + record + Id : Swagger.Long; + Pet_Id : Swagger.Long; + Quantity : Integer; + Ship_Date : Swagger.Datetime; + Status : Swagger.UString; + Complete : Boolean; + end record; + + package Order_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => Order_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Order_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Order_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Order_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Order_Type_Vectors.Vector); + + + -- ------------------------------ + -- a Pet + -- A pet for sale in the pet store + -- ------------------------------ + type Pet_Type is + record + Id : Swagger.Long; + Category : Samples.Petstore.Models.Category_Type; + Name : Swagger.UString; + Photo_Urls : Swagger.UString_Vectors.Vector; + Tags : Samples.Petstore.Models.Tag_Type_Vectors.Vector; + Status : Swagger.UString; + end record; + + package Pet_Type_Vectors is + new Ada.Containers.Vectors (Index_Type => Positive, + Element_Type => Pet_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Pet_Type); + + procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; + Name : in String; + Value : in Pet_Type_Vectors.Vector); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Pet_Type); + + procedure Deserialize (From : in Swagger.Value_Type; + Name : in String; + Value : out Pet_Type_Vectors.Vector); + + +end Samples.Petstore.Models; diff --git a/samples/client/petstore/ada/src/petstore.adb b/samples/client/petstore/ada/src/petstore.adb new file mode 100644 index 00000000000..b14200f0001 --- /dev/null +++ b/samples/client/petstore/ada/src/petstore.adb @@ -0,0 +1,268 @@ +with Samples.Petstore.Clients; +with Samples.Petstore.Models; +with Swagger; +with Util.Http.Clients.Curl; +with Ada.Text_IO; +with Ada.Command_Line; +with Ada.Calendar.Formatting; +with Ada.Exceptions; +procedure Test is + + use Ada.Text_IO; + + procedure Usage; + procedure Print_Pet (Pet : in Samples.Petstore.Models.Pet_Type); + procedure Print_Order (Order : in Samples.Petstore.Models.Order_Type); + procedure Get_User (C : in out Samples.Petstore.Clients.Client_Type); + procedure Get_Pet (C : in out Samples.Petstore.Clients.Client_Type); + procedure Get_Order (C : in out Samples.Petstore.Clients.Client_Type); + procedure List_Inventory (C : in out Samples.Petstore.Clients.Client_Type); + procedure List_Pet (C : in out Samples.Petstore.Clients.Client_Type); + procedure Delete_Pet (C : in out Samples.Petstore.Clients.Client_Type); + procedure Delete_User (C : in out Samples.Petstore.Clients.Client_Type); + procedure Delete_Order (C : in out Samples.Petstore.Clients.Client_Type); + procedure Add_Pet (C : in out Samples.Petstore.Clients.Client_Type); + procedure Login (C : in out Samples.Petstore.Clients.Client_Type; + Username : in String; + Password : in String); + + Server : constant Swagger.UString := Swagger.To_UString ("http://petstore.swagger.io/v2"); + Arg_Count : constant Natural := Ada.Command_Line.Argument_Count; + Arg : Positive := 1; + + procedure Usage is + begin + Put_Line ("Usage: petstore {list|add|rm|update} {user|order|pet} {params}..."); + Put_Line (" get pet ... Print pet given its id"); + Put_Line (" get user ... Print user given its name"); + Put_Line (" get order ... Print order given its id"); + Put_Line (" list pet ... List the pets with the given status"); + Put_Line (" list inventory List the inventory"); + Put_Line (" add pet ... Remove user with given name"); + Put_Line (" rm order ... Remove order with given id"); + Put_Line (" login Use login operation to get a session"); + end Usage; + + procedure Print_Pet (Pet : in Samples.Petstore.Models.Pet_Type) is + Need_Indent : Boolean := False; + begin + Put_Line ("Id : " & Swagger.Long'Image (Pet.Id)); + Put_Line ("Name : " & Swagger.To_String (Pet.Name)); + Put_Line ("Status : " & Swagger.To_String (Pet.Status)); + if not Pet.Tags.Is_Empty then + Put ("Tags : "); + for Tag of Pet.Tags loop + Put_Line ((if Need_Indent then " " else "") + & Swagger.To_String (Tag.Name)); + Need_Indent := True; + end loop; + end if; + if not Pet.Photo_Urls.Is_Empty then + Need_Indent := False; + Put ("URLs : "); + for Url of Pet.Photo_Urls loop + Put_Line ((if Need_Indent then " " else "") & Url); + Need_Indent := True; + end loop; + end if; + end Print_Pet; + + procedure Print_Order (Order : in Samples.Petstore.Models.Order_Type) is + begin + Put_Line ("Id : " & Swagger.Long'Image (Order.Id)); + Put_Line ("Pet id : " & Swagger.Long'Image (Order.Pet_Id)); + Put_Line ("Quantity : " & Integer'Image (Order.Quantity)); + Put_Line ("Status : " & Swagger.To_String (Order.Status)); + Put_Line ("Ship date : " & Ada.Calendar.Formatting.Image (Order.Ship_Date)); + Put_Line ("Complete : " & Boolean'Image (Order.Complete)); + end Print_Order; + + procedure Get_User (C : in out Samples.Petstore.Clients.Client_Type) is + + User : Samples.Petstore.Models.User_Type; + begin + for I in Arg .. Arg_Count loop + C.Get_User_By_Name (Swagger.To_UString (Ada.Command_Line.Argument (I)), User); + Put_Line ("Id : " & Swagger.Long'Image (User.Id)); + Put_Line ("Username : " & Swagger.To_String (User.Username)); + Put_Line ("Firstname: " & Swagger.To_String (User.First_Name)); + Put_Line ("Lastname : " & Swagger.To_String (User.Last_Name)); + Put_Line ("Email : " & Swagger.To_String (User.Email)); + Put_Line ("Password : " & Swagger.To_String (User.Password)); + Put_Line ("Phone : " & Swagger.To_String (User.Phone)); + end loop; + end Get_User; + + procedure Get_Pet (C : in out Samples.Petstore.Clients.Client_Type) is + Pet : Samples.Petstore.Models.Pet_Type; + begin + C.Set_Server (Server); + for I in Arg .. Arg_Count loop + declare + P : constant String := Ada.Command_Line.Argument (I); + begin + C.Get_Pet_By_Id (Swagger.Long'Value (P), Pet); + Print_Pet (Pet); + end; + end loop; + end Get_Pet; + + procedure Get_Order (C : in out Samples.Petstore.Clients.Client_Type) is + Order : Samples.Petstore.Models.Order_Type; + begin + C.Set_Server (Server); + for I in Arg .. Arg_Count loop + declare + P : constant String := Ada.Command_Line.Argument (I); + begin + C.Get_Order_By_Id (Swagger.Long'Value (P), Order); + Print_Order (Order); + end; + end loop; + end Get_Order; + + procedure List_Pet (C : in out Samples.Petstore.Clients.Client_Type) is + Pets : Samples.Petstore.Models.Pet_Type_Vectors.Vector; + begin + for I in Arg .. Arg_Count loop + declare + Status : Swagger.UString_Vectors.Vector; + P : constant String := Ada.Command_Line.Argument (I); + begin + Status.Append (P); + C.Find_Pets_By_Status (Status, Pets); + for Pet of Pets loop + Print_Pet (Pet); + end loop; + end; + end loop; + end List_Pet; + + procedure List_Inventory (C : in out Samples.Petstore.Clients.Client_Type) is + List : Swagger.Integer_Map; + Iter : Swagger.Integer_Maps.Cursor; + begin + C.Get_Inventory (List); + Ada.Text_IO.Put_Line ("Inventory size " & Natural'Image (Natural (List.Length))); + Iter := List.First; + while Swagger.Integer_Maps.Has_Element (Iter) loop + Put (Swagger.Integer_Maps.Key (Iter)); + Set_Col (70); + Put_Line (Natural'Image (Swagger.Integer_Maps.Element (Iter))); + Swagger.Integer_Maps.Next (Iter); + end loop; + end List_Inventory; + + procedure Login (C : in out Samples.Petstore.Clients.Client_Type; + Username : in String; + Password : in String) is + Session : Swagger.UString; + begin + C.Login_User (Swagger.To_UString (Username), + Swagger.To_UString (Password), + Session); + Put_Line ("New session : " & Swagger.To_String (Session)); + end Login; + + procedure Add_Pet (C : in out Samples.Petstore.Clients.Client_Type) is + Pet : Samples.Petstore.Models.Pet_Type; + begin + if Arg_Count /= 7 then + Put_Line ("Missing some arguments for add pet command"); + Usage; + return; + end if; + Pet.Id := Swagger.Long'Value (Ada.Command_Line.Argument (Arg)); + Pet.Name := Swagger.To_UString (Ada.Command_Line.Argument (Arg + 1)); + Pet.Status := Swagger.To_UString (Ada.Command_Line.Argument (Arg + 2)); + Pet.Category.Id := Swagger.Long'Value (Ada.Command_Line.Argument (Arg + 3)); + Pet.Category.Name := Swagger.To_UString (Ada.Command_Line.Argument (Arg + 4)); + C.Add_Pet (Pet); + end Add_Pet; + + procedure Delete_User (C : in out Samples.Petstore.Clients.Client_Type) is + begin + for I in Arg .. Arg_Count loop + C.Delete_User (Username => Swagger.To_UString (Ada.Command_Line.Argument (I))); + end loop; + end Delete_User; + + procedure Delete_Order (C : in out Samples.Petstore.Clients.Client_Type) is + begin + for I in Arg .. Arg_Count loop + C.Delete_Order (Swagger.To_UString (Ada.Command_Line.Argument (I))); + end loop; + end Delete_Order; + + procedure Delete_Pet (C : in out Samples.Petstore.Clients.Client_Type) is + Key : constant Swagger.UString := Swagger.To_UString (Ada.Command_Line.Argument (Arg)); + begin + Arg := Arg + 1; + for I in Arg .. Arg_Count loop + C.Delete_Pet (Swagger.Long'Value (Ada.Command_Line.Argument (I)), Key); + end loop; + end Delete_Pet; + +begin + if Arg_Count <= 1 then + Usage; + return; + end if; + Util.Http.Clients.Curl.Register; + declare + Command : constant String := Ada.Command_Line.Argument (Arg); + Item : constant String := Ada.Command_Line.Argument (Arg + 1); + C : Samples.Petstore.Clients.Client_Type; + begin + C.Set_Server (Server); + Arg := Arg + 2; + if Command = "login" then + Login (C, Item, Ada.Command_Line.Argument (Arg)); + elsif Command = "get" then + if Item = "user" then + Get_User (C); + elsif Item = "pet" then + Get_Pet (C); + elsif Item = "order" then + Get_Order (C); + else + Usage; + end if; + elsif Command = "list" then + if Item = "pet" then + List_Pet (C); + elsif Item = "inventory" then + List_Inventory (C); + else + Usage; + end if; + elsif Command = "add" then + if Item = "pet" then + Add_Pet (C); + else + Usage; + end if; + elsif Command = "rm" then + if Item = "user" then + Delete_User (C); + elsif Item = "order" then + Delete_Order (C); + elsif Item = "pet" then + Delete_Pet (C); + else + Usage; + end if; + elsif Command = "update" then + Usage; + else + Usage; + end if; + + exception + when E : Constraint_Error => + Put_Line ("Constraint error raised: " & Ada.Exceptions.Exception_Message (E)); + + end; +end Test; diff --git a/samples/client/petstore/ada/src/samples-petstore.ads b/samples/client/petstore/ada/src/samples-petstore.ads new file mode 100644 index 00000000000..c5292a19abf --- /dev/null +++ b/samples/client/petstore/ada/src/samples-petstore.ads @@ -0,0 +1,2 @@ +package Samples.Petstore is +end Samples.Petstore; \ No newline at end of file diff --git a/samples/client/petstore/ada/src/samples.ads b/samples/client/petstore/ada/src/samples.ads new file mode 100644 index 00000000000..af66cc10aa8 --- /dev/null +++ b/samples/client/petstore/ada/src/samples.ads @@ -0,0 +1,2 @@ +package Samples is +end Samples; \ No newline at end of file From 8a7940f199a03b7fabfa7ee6f54f34dee6134b47 Mon Sep 17 00:00:00 2001 From: jarlesat Date: Sun, 8 Oct 2017 09:28:12 +0200 Subject: [PATCH 122/197] Issue 5431 Support jaxrs client api interfaces (#6412) * Adds the ability to create code for an interface-based jaxrs client. * Adds shell script and sample files for jaxrs-spec-interface * rebase into adds shell * Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8" * Fixes generated pom.xml * Generate pom.xml by default * Prettier output from api.mustache * Fixes bug in mediatype, allowing charset-specification in swagger.yaml. * Merges generation of interface-based jaxrs client/api into jaxrs-spec. * Moves jaxrs-spec server interface to match location of jaxrs-spec server * Makes Generated-annotation in genereated classes slightly prettier. --- bin/jaxrs-spec-petstore-server-interface.sh | 33 + .../languages/JavaJAXRSSpecServerCodegen.java | 36 +- .../resources/JavaJaxRS/spec/api.mustache | 35 +- .../JavaJaxRS/spec/apiInterface.mustache | 14 + .../JavaJaxRS/spec/apiMethod.mustache | 16 + .../resources/JavaJaxRS/spec/pom.mustache | 15 +- .../spec/returnTypeInterface.mustache | 1 + .../JavaJAXRSSpecServerCodegenTest.java | 77 + .../.swagger-codegen-ignore | 23 + .../.swagger-codegen/VERSION | 1 + .../petstore/jaxrs-spec-interface/pom.xml | 48 + .../java/io/swagger/api/AnotherFakeApi.java | 27 + .../src/gen/java/io/swagger/api/FakeApi.java | 86 + .../io/swagger/api/FakeClassnameTestApi.java | 28 + .../src/gen/java/io/swagger/api/PetApi.java | 130 ++ .../src/gen/java/io/swagger/api/StoreApi.java | 57 + .../src/gen/java/io/swagger/api/UserApi.java | 87 + .../model/AdditionalPropertiesClass.java | 92 + .../src/gen/java/io/swagger/model/Animal.java | 92 + .../gen/java/io/swagger/model/AnimalFarm.java | 55 + .../model/ArrayOfArrayOfNumberOnly.java | 73 + .../io/swagger/model/ArrayOfNumberOnly.java | 73 + .../gen/java/io/swagger/model/ArrayTest.java | 111 ++ .../java/io/swagger/model/Capitalization.java | 166 ++ .../src/gen/java/io/swagger/model/Cat.java | 71 + .../gen/java/io/swagger/model/Category.java | 89 + .../gen/java/io/swagger/model/ClassModel.java | 74 + .../src/gen/java/io/swagger/model/Client.java | 70 + .../src/gen/java/io/swagger/model/Dog.java | 71 + .../gen/java/io/swagger/model/EnumArrays.java | 153 ++ .../gen/java/io/swagger/model/EnumClass.java | 44 + .../gen/java/io/swagger/model/EnumTest.java | 221 +++ .../gen/java/io/swagger/model/FormatTest.java | 316 +++ .../io/swagger/model/HasOnlyReadOnly.java | 89 + .../gen/java/io/swagger/model/MapTest.java | 123 ++ ...ropertiesAndAdditionalPropertiesClass.java | 114 ++ .../io/swagger/model/Model200Response.java | 93 + .../io/swagger/model/ModelApiResponse.java | 108 ++ .../java/io/swagger/model/ModelReturn.java | 74 + .../src/gen/java/io/swagger/model/Name.java | 132 ++ .../gen/java/io/swagger/model/NumberOnly.java | 71 + .../src/gen/java/io/swagger/model/Order.java | 198 ++ .../java/io/swagger/model/OuterComposite.java | 109 ++ .../gen/java/io/swagger/model/OuterEnum.java | 44 + .../src/gen/java/io/swagger/model/Pet.java | 203 ++ .../java/io/swagger/model/ReadOnlyFirst.java | 89 + .../io/swagger/model/SpecialModelName.java | 70 + .../src/gen/java/io/swagger/model/Tag.java | 89 + .../src/gen/java/io/swagger/model/User.java | 204 ++ .../jaxrs-spec-interface/swagger.json | 1693 +++++++++++++++++ samples/server/petstore/jaxrs-spec/pom.xml | 30 +- .../java/io/swagger/api/AnotherFakeApi.java | 29 + .../src/gen/java/io/swagger/api/FakeApi.java | 40 +- .../io/swagger/api/FakeClassnameTestApi.java | 11 +- .../src/gen/java/io/swagger/api/PetApi.java | 30 +- .../src/gen/java/io/swagger/api/StoreApi.java | 20 +- .../src/gen/java/io/swagger/api/UserApi.java | 33 +- .../server/petstore/jaxrs-spec/swagger.json | 45 +- 58 files changed, 6054 insertions(+), 172 deletions(-) create mode 100755 bin/jaxrs-spec-petstore-server-interface.sh create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiMethod.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegenTest.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/.swagger-codegen-ignore create mode 100644 samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION create mode 100644 samples/server/petstore/jaxrs-spec-interface/pom.xml create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/swagger.json create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java diff --git a/bin/jaxrs-spec-petstore-server-interface.sh b/bin/jaxrs-spec-petstore-server-interface.sh new file mode 100755 index 00000000000..3b28a0972f5 --- /dev/null +++ b/bin/jaxrs-spec-petstore-server-interface.sh @@ -0,0 +1,33 @@ +#!/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 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples/server/petstore/jaxrs-spec-interface +-DhideGenerationTimestamp=true +-DinterfaceOnly=true" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java index f229c641c2a..ba0c837be39 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -15,18 +15,18 @@ import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.SupportingFile; -import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.models.Operation; import io.swagger.models.Swagger; -import io.swagger.models.properties.Property; import io.swagger.util.Json; public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { - private static final String INTERFACE_ONLY = "interfaceOnly"; + public static final String INTERFACE_ONLY = "interfaceOnly"; + public static final String GENERATE_POM = "generatePom"; - protected boolean interfaceOnly = false; + private boolean interfaceOnly = false; + private boolean generatePom = true; public JavaJAXRSSpecServerCodegen() { @@ -36,7 +36,6 @@ public JavaJAXRSSpecServerCodegen() outputFolder = "generated-code/JavaJaxRS-Spec"; modelTemplateFiles.put("model.mustache", ".java"); - apiTemplateFiles.put("api.mustache", ".java"); apiPackage = "io.swagger.api"; modelPackage = "io.swagger.model"; @@ -74,25 +73,30 @@ public JavaJAXRSSpecServerCodegen() library.setEnum(supportedLibraries); cliOptions.add(library); - cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.")); + cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom))); + cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly))); } @Override public void processOpts() { - super.processOpts(); - - supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen - + if (additionalProperties.containsKey(GENERATE_POM)) { + generatePom = Boolean.valueOf(additionalProperties.get(GENERATE_POM).toString()); + } if (additionalProperties.containsKey(INTERFACE_ONLY)) { - this.setInterfaceOnly(Boolean.valueOf(additionalProperties.get(INTERFACE_ONLY).toString())); - if (!interfaceOnly) { - additionalProperties.remove(INTERFACE_ONLY); - } + interfaceOnly = Boolean.valueOf(additionalProperties.get(INTERFACE_ONLY).toString()); + } + if (interfaceOnly) { + // Change default artifactId if genereating interfaces only, before command line options are applied in base class. + artifactId = "swagger-jaxrs-client"; } - writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); + super.processOpts(); + supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen + if (generatePom) { + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); + } if (!interfaceOnly) { writeOptional(outputFolder, new SupportingFile("RestApplication.mustache", (sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")); @@ -106,8 +110,6 @@ public String getName() return "jaxrs-spec"; } - public void setInterfaceOnly(boolean interfaceOnly) { this.interfaceOnly = interfaceOnly; } - @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { String basePath = resourcePath; diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache index 8986db6df0a..4ccb9cc73aa 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/api.mustache @@ -10,39 +10,18 @@ import io.swagger.annotations.*; import java.util.Map; import java.util.List; -{{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; -{{/useBeanValidation}} -import java.lang.Exception; +{{#useBeanValidation}}import javax.validation.constraints.*; +import javax.validation.Valid;{{/useBeanValidation}} @Path("/{{{baseName}}}") - -@Api(description = "the {{{baseName}}} API") -{{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} -{{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} -{{>generatedAnnotation}} - -public {{#interfaceOnly}}interface{{/interfaceOnly}}{{^interfaceOnly}}class{{/interfaceOnly}} {{classname}} { +@Api(description = "the {{{baseName}}} API"){{#hasConsumes}} +@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} +@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} +{{>generatedAnnotation}}public {{#interfaceOnly}}interface{{/interfaceOnly}}{{^interfaceOnly}}class{{/interfaceOnly}} {{classname}} { {{#operations}} {{#operation}} - @{{httpMethod}} - {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} - {{#hasConsumes}}@Consumes({ {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}} - {{#hasProduces}}@Produces({ {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { - {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { - {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, - {{/hasMore}}{{/scopes}} - }{{/isOAuth}}){{#hasMore}}, - {{/hasMore}}{{/authMethods}} - }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) - @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) - public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) throws Exception{{#interfaceOnly}};{{/interfaceOnly}}{{^interfaceOnly}} { - return Response.ok().entity("magic!").build(); - }{{/interfaceOnly}} +{{#interfaceOnly}}{{>apiInterface}}{{/interfaceOnly}}{{^interfaceOnly}}{{>apiMethod}}{{/interfaceOnly}} {{/operation}} } {{/operations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache new file mode 100644 index 00000000000..6d786768986 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -0,0 +1,14 @@ + @{{httpMethod}}{{#subresourceOperation}} + @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} + @Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} + @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + {{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}); \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiMethod.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiMethod.mustache new file mode 100644 index 00000000000..d4ab5850ac2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiMethod.mustache @@ -0,0 +1,16 @@ + @{{httpMethod}}{{#subresourceOperation}} + @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} + @Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} + @Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }){{/hasProduces}} + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, + {{/hasMore}}{{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}} + }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) + public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) { + return Response.ok().entity("magic!").build(); + } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache index e469fdd90a2..b0316d58730 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -2,12 +2,17 @@ 4.0.0 {{groupId}} {{artifactId}} - war + {{#interfaceOnly}}jar{{/interfaceOnly}}{{^interfaceOnly}}war{{/interfaceOnly}} {{artifactId}} {{artifactVersion}} src/main/java - + {{#interfaceOnly}} + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + {{/interfaceOnly}}{{^interfaceOnly}} org.apache.maven.plugins maven-war-plugin @@ -27,7 +32,7 @@ - + {{/interfaceOnly}} @@ -48,7 +53,7 @@ junit ${junit-version} test - + {{^interfaceOnly}} org.testng testng @@ -68,7 +73,7 @@ org.beanshell - + {{/interfaceOnly}} {{#useBeanValidation}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache new file mode 100644 index 00000000000..b317e750c56 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache @@ -0,0 +1 @@ +{{#returnContainer}}{{{returnContainer}}}<{{/returnContainer}}{{{returnType}}}{{#returnContainer}}>{{/returnContainer}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegenTest.java new file mode 100644 index 00000000000..465ed7b904f --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegenTest.java @@ -0,0 +1,77 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.CliOption; +import io.swagger.codegen.SupportingFile; +import io.swagger.models.properties.BooleanProperty; +import org.junit.Test; +import org.testng.Assert; + +public class JavaJAXRSSpecServerCodegenTest { + + private JavaJAXRSSpecServerCodegen generator = new JavaJAXRSSpecServerCodegen(); + + @Test + public void do_not_process_RestApplication_when_interfaceOnly_is_true() { + generator.additionalProperties().put(JavaJAXRSSpecServerCodegen.INTERFACE_ONLY, "true"); + generator.processOpts(); + for (SupportingFile file : generator.supportingFiles()) { + Assert.assertNotEquals("RestApplication.mustache", file.templateFile); + } + } + + @Test + public void do_process_pom_by_default() { + generator.processOpts(); + for (SupportingFile file : generator.supportingFiles()) { + if ("pom.mustache".equals(file.templateFile)) { + return; + } + } + Assert.fail("Missing pom.mustache"); + } + + @Test + public void process_pom_if_generatePom_is_true() { + generator.additionalProperties().put(JavaJAXRSSpecServerCodegen.GENERATE_POM, "true"); + generator.processOpts(); + for (SupportingFile file : generator.supportingFiles()) { + if ("pom.mustache".equals(file.templateFile)) { + return; + } + } + Assert.fail("Missing pom.mustache"); + } + + @Test + public void do_not_process_pom_if_generatePom_is_false() { + generator.additionalProperties().put(JavaJAXRSSpecServerCodegen.GENERATE_POM, "false"); + generator.processOpts(); + for (SupportingFile file : generator.supportingFiles()) { + Assert.assertNotEquals("pom.mustache", file.templateFile); + } + } + + @Test + public void verify_that_generatePom_exists_as_a_parameter_with_default_true() { + for (CliOption option : generator.cliOptions()) { + if (option.getOpt().equals(JavaJAXRSSpecServerCodegen.GENERATE_POM)) { + Assert.assertEquals(BooleanProperty.TYPE, option.getType()); + Assert.assertEquals("true", option.getDefault()); + return; + } + } + Assert.fail("Missing " + JavaJAXRSSpecServerCodegen.GENERATE_POM); + } + + @Test + public void verify_that_interfaceOnly_exists_as_a_parameter_with_default_false() { + for (CliOption option : generator.cliOptions()) { + if (option.getOpt().equals(JavaJAXRSSpecServerCodegen.INTERFACE_ONLY)) { + Assert.assertEquals(BooleanProperty.TYPE, option.getType()); + Assert.assertEquals("false", option.getDefault()); + return; + } + } + Assert.fail("Missing " + JavaJAXRSSpecServerCodegen.INTERFACE_ONLY); + } +} diff --git a/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen-ignore b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/.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/jaxrs-spec-interface/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml new file mode 100644 index 00000000000..a32dafce9ee --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-client + jar + swagger-jaxrs-client + 1.0.0 + + src/main/java + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + + + javax.ws.rs + javax.ws.rs-api + 2.0 + provided + + + io.swagger + swagger-annotations + provided + 1.5.3 + + + junit + junit + ${junit-version} + test + + + + javax.validation + validation-api + 1.1.0.Final + provided + + + + 4.8.1 + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..c0359617b45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,27 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/another-fake") +@Api(description = "the another-fake API") +public interface AnotherFakeApi { + + @PATCH + @Path("/dummy") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test special tags", notes = "To test special tags", tags={ "$another-fake?" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + Client testSpecialTags(@Valid Client body); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java new file mode 100644 index 00000000000..cc205a1d9b9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java @@ -0,0 +1,86 @@ +package io.swagger.api; + +import java.math.BigDecimal; +import io.swagger.model.Client; +import java.util.Date; +import org.joda.time.LocalDate; +import io.swagger.model.OuterComposite; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/fake") +@Api(description = "the fake API") +public interface FakeApi { + + @POST + @Path("/outer/boolean") + @ApiOperation(value = "", notes = "Test serialization of outer boolean types", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + + @POST + @Path("/outer/composite") + @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body); + + @POST + @Path("/outer/number") + @ApiOperation(value = "", notes = "Test serialization of outer number types", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + + @POST + @Path("/outer/string") + @ApiOperation(value = "", notes = "Test serialization of outer string types", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output string", response = String.class) }) + String fakeOuterStringSerialize(@Valid String body); + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + Client testClientModel(@Valid Client body); + + @POST + @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { + @Authorization(value = "http_basic_test") + }, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback); + + @GET + @Consumes({ "*/*" }) + @Produces({ "*/*" }) + @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid request", response = Void.class), + @ApiResponse(code = 404, message = "Not found", response = Void.class) }) + void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble); + + @GET + @Path("/jsonFormData") + @Consumes({ "application/json" }) + @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java new file mode 100644 index 00000000000..710ea4c9b90 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -0,0 +1,28 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/fake_classname_test") +@Api(description = "the fake_classname_test API") +public interface FakeClassnameTestApi { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test class name in snake case", notes = "", authorizations = { + @Authorization(value = "api_key_query") + }, tags={ "fake_classname_tags 123#$%^" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + Client testClassname(@Valid Client body); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java new file mode 100644 index 00000000000..bd166d62b7f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java @@ -0,0 +1,130 @@ +package io.swagger.api; + +import java.io.File; +import io.swagger.model.ModelApiResponse; +import io.swagger.model.Pet; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/pet") +@Api(description = "the pet API") +public interface PetApi { + + @POST + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Add a new pet to the store", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + void addPet(@Valid Pet body); + + @DELETE + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Deletes a pet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + + @GET + @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) + List> findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + + @GET + @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) + List> findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + + @GET + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", authorizations = { + @Authorization(value = "api_key") + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) + Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId); + + @PUT + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Update an existing pet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Pet not found", response = Void.class), + @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + void updatePet(@Valid Pet body); + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updates a pet in the store with form data", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status); + + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @ApiOperation(value = "uploads an image", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, + @FormParam(value = "file") Attachment fileDetail); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java new file mode 100644 index 00000000000..ffa77a6cdc6 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java @@ -0,0 +1,57 @@ +package io.swagger.api; + +import java.util.Map; +import io.swagger.model.Order; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/store") +@Api(description = "the store API") +public interface StoreApi { + + @DELETE + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId); + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + Map> getInventory(); + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), + @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId); + + @POST + @Path("/order") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Place an order for a pet", notes = "", tags={ "store" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) + Order placeOrder(@Valid Order body); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java new file mode 100644 index 00000000000..d6c30a1f3dc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java @@ -0,0 +1,87 @@ +package io.swagger.api; + +import java.util.List; +import io.swagger.model.User; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/user") +@Api(description = "the user API") +public interface UserApi { + + @POST + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + void createUser(@Valid User body); + + @POST + @Path("/createWithArray") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + void createUsersWithArrayInput(@Valid List body); + + @POST + @Path("/createWithList") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + void createUsersWithListInput(@Valid List body); + + @DELETE + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username); + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Get user by user name", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username); + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Logs user into the system", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + + @GET + @Path("/logout") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + void logoutUser(); + + @PUT + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", tags={ "user" }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), + @ApiResponse(code = 404, message = "User not found", response = Void.class) }) + void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..17c61771f7c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -0,0 +1,92 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class AdditionalPropertiesClass { + + private @Valid Map mapProperty = new HashMap(); + private @Valid Map> mapOfMapProperty = new HashMap>(); + + /** + **/ + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + + @ApiModelProperty(value = "") + public Map getMapProperty() { + return mapProperty; + } + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + /** + **/ + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + + @ApiModelProperty(value = "") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java new file mode 100644 index 00000000000..cc18f7fa3a5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java @@ -0,0 +1,92 @@ +package io.swagger.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Animal { + + private @Valid String className = null; + private @Valid String color = "red"; + + /** + **/ + public Animal className(String className) { + this.className = className; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + /** + **/ + public Animal color(String color) { + this.color = color; + return this; + } + + + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(className, animal.className) && + Objects.equals(color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java new file mode 100644 index 00000000000..a730cb5ffc7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java @@ -0,0 +1,55 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class AnimalFarm extends ArrayList { + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnimalFarm animalFarm = (AnimalFarm) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalFarm {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..874660a2ef0 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,73 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayOfArrayOfNumberOnly { + + private @Valid List> arrayArrayNumber = new ArrayList>(); + + /** + **/ + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..2a3980fbd37 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -0,0 +1,73 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayOfNumberOnly { + + private @Valid List arrayNumber = new ArrayList(); + + /** + **/ + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + + @ApiModelProperty(value = "") + public List getArrayNumber() { + return arrayNumber; + } + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java new file mode 100644 index 00000000000..ec75158891a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java @@ -0,0 +1,111 @@ +package io.swagger.model; + +import io.swagger.model.ReadOnlyFirst; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ArrayTest { + + private @Valid List arrayOfString = new ArrayList(); + private @Valid List> arrayArrayOfInteger = new ArrayList>(); + private @Valid List> arrayArrayOfModel = new ArrayList>(); + + /** + **/ + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + + @ApiModelProperty(value = "") + public List getArrayOfString() { + return arrayOfString; + } + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + /** + **/ + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + /** + **/ + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(arrayOfString, arrayTest.arrayOfString) && + Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java new file mode 100644 index 00000000000..25bbfd84e38 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java @@ -0,0 +1,166 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Capitalization { + + private @Valid String smallCamel = null; + private @Valid String capitalCamel = null; + private @Valid String smallSnake = null; + private @Valid String capitalSnake = null; + private @Valid String scAETHFlowPoints = null; + private @Valid String ATT_NAME = null; + + /** + **/ + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + + @ApiModelProperty(value = "") + public String getSmallCamel() { + return smallCamel; + } + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + /** + **/ + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + + @ApiModelProperty(value = "") + public String getCapitalCamel() { + return capitalCamel; + } + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + /** + **/ + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + + @ApiModelProperty(value = "") + public String getSmallSnake() { + return smallSnake; + } + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + /** + **/ + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + + @ApiModelProperty(value = "") + public String getCapitalSnake() { + return capitalSnake; + } + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + /** + **/ + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + /** + * Name of the pet + **/ + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { + return ATT_NAME; + } + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(smallCamel, capitalization.smallCamel) && + Objects.equals(capitalCamel, capitalization.capitalCamel) && + Objects.equals(smallSnake, capitalization.smallSnake) && + Objects.equals(capitalSnake, capitalization.capitalSnake) && + Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java new file mode 100644 index 00000000000..fc259678da3 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java @@ -0,0 +1,71 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Cat extends Animal { + + private @Valid Boolean declawed = null; + + /** + **/ + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @ApiModelProperty(value = "") + public Boolean isDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(declawed, cat.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java new file mode 100644 index 00000000000..df544c396db --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java @@ -0,0 +1,89 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Category { + + private @Valid Long id = null; + private @Valid String name = null; + + /** + **/ + public Category id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Category name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + 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); + } + + @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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java new file mode 100644 index 00000000000..ec28d98861d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * Model for testing model with \"_class\" property + **/ +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model with \"_class\" property") + +public class ClassModel { + + private @Valid String propertyClass = null; + + /** + **/ + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java new file mode 100644 index 00000000000..57bcea24a47 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java @@ -0,0 +1,70 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Client { + + private @Valid String client = null; + + /** + **/ + public Client client(String client) { + this.client = client; + return this; + } + + + @ApiModelProperty(value = "") + public String getClient() { + return client; + } + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java new file mode 100644 index 00000000000..529d49d8ce2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java @@ -0,0 +1,71 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Dog extends Animal { + + private @Valid String breed = null; + + /** + **/ + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(breed, dog.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java new file mode 100644 index 00000000000..a3bbcc6cd6b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java @@ -0,0 +1,153 @@ +package io.swagger.model; + +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class EnumArrays { + + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JustSymbolEnum fromValue(String v) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid JustSymbolEnum justSymbol = null; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ArrayEnumEnum fromValue(String v) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid List arrayEnum = new ArrayList(); + + /** + **/ + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + /** + **/ + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + + @ApiModelProperty(value = "") + public List getArrayEnum() { + return arrayEnum; + } + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(justSymbol, enumArrays.justSymbol) && + Objects.equals(arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java new file mode 100644 index 00000000000..4b694360886 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java @@ -0,0 +1,44 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java new file mode 100644 index 00000000000..4f7283cdbf3 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java @@ -0,0 +1,221 @@ +package io.swagger.model; + +import io.swagger.model.OuterEnum; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class EnumTest { + + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringEnum fromValue(String v) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid EnumStringEnum enumString = null; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerEnum fromValue(String v) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid EnumIntegerEnum enumInteger = null; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumNumberEnum fromValue(String v) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid EnumNumberEnum enumNumber = null; + private @Valid OuterEnum outerEnum = null; + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + /** + **/ + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @ApiModelProperty(value = "") + public OuterEnum getOuterEnum() { + return outerEnum; + } + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber) && + Objects.equals(outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java new file mode 100644 index 00000000000..faead8afb01 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java @@ -0,0 +1,316 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.UUID; +import org.joda.time.LocalDate; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class FormatTest { + + private @Valid Integer integer = null; + private @Valid Integer int32 = null; + private @Valid Long int64 = null; + private @Valid BigDecimal number = null; + private @Valid Float _float = null; + private @Valid Double _double = null; + private @Valid String string = null; + private @Valid byte[] _byte = null; + private @Valid byte[] binary = null; + private @Valid LocalDate date = null; + private @Valid Date dateTime = null; + private @Valid UUID uuid = null; + private @Valid String password = null; + + /** + * minimum: 10 + * maximum: 100 + **/ + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + + @ApiModelProperty(value = "") + @Min(10) @Max(100) public Integer getInteger() { + return integer; + } + public void setInteger(Integer integer) { + this.integer = integer; + } + + /** + * minimum: 20 + * maximum: 200 + **/ + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + + @ApiModelProperty(value = "") + @Min(20) @Max(200) public Integer getInt32() { + return int32; + } + public void setInt32(Integer int32) { + this.int32 = int32; + } + + /** + **/ + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + + @ApiModelProperty(value = "") + public Long getInt64() { + return int64; + } + public void setInt64(Long int64) { + this.int64 = int64; + } + + /** + * minimum: 32.1 + * maximum: 543.2 + **/ + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + return number; + } + public void setNumber(BigDecimal number) { + this.number = number; + } + + /** + * minimum: 54.3 + * maximum: 987.6 + **/ + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + + @ApiModelProperty(value = "") + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + return _float; + } + public void setFloat(Float _float) { + this._float = _float; + } + + /** + * minimum: 67.8 + * maximum: 123.4 + **/ + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + + @ApiModelProperty(value = "") + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + return _double; + } + public void setDouble(Double _double) { + this._double = _double; + } + + /** + **/ + public FormatTest string(String string) { + this.string = string; + return this; + } + + + @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { + return string; + } + public void setString(String string) { + this.string = string; + } + + /** + **/ + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { + return _byte; + } + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + /** + **/ + public FormatTest binary(byte[] binary) { + this.binary = binary; + return this; + } + + + @ApiModelProperty(value = "") + public byte[] getBinary() { + return binary; + } + public void setBinary(byte[] binary) { + this.binary = binary; + } + + /** + **/ + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + public LocalDate getDate() { + return date; + } + public void setDate(LocalDate date) { + this.date = date; + } + + /** + **/ + public FormatTest dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + + @ApiModelProperty(value = "") + public Date getDateTime() { + return dateTime; + } + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + **/ + public FormatTest password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(integer, formatTest.integer) && + Objects.equals(int32, formatTest.int32) && + Objects.equals(int64, formatTest.int64) && + Objects.equals(number, formatTest.number) && + Objects.equals(_float, formatTest._float) && + Objects.equals(_double, formatTest._double) && + Objects.equals(string, formatTest.string) && + Objects.equals(_byte, formatTest._byte) && + Objects.equals(binary, formatTest.binary) && + Objects.equals(date, formatTest.date) && + Objects.equals(dateTime, formatTest.dateTime) && + Objects.equals(uuid, formatTest.uuid) && + Objects.equals(password, formatTest.password); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..c07f245e60a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -0,0 +1,89 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class HasOnlyReadOnly { + + private @Valid String bar = null; + private @Valid String foo = null; + + /** + **/ + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + @ApiModelProperty(value = "") + public String getBar() { + return bar; + } + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + @ApiModelProperty(value = "") + public String getFoo() { + return foo; + } + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(bar, hasOnlyReadOnly.bar) && + Objects.equals(foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java new file mode 100644 index 00000000000..638058f9216 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java @@ -0,0 +1,123 @@ +package io.swagger.model; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class MapTest { + + private @Valid Map> mapMapOfString = new HashMap>(); + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InnerEnum fromValue(String v) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid Map mapOfEnumString = new HashMap(); + + /** + **/ + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + /** + **/ + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..0b277958156 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,114 @@ +package io.swagger.model; + +import io.swagger.model.Animal; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private @Valid UUID uuid = null; + private @Valid Date dateTime = null; + private @Valid Map map = new HashMap(); + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { + this.dateTime = dateTime; + return this; + } + + + @ApiModelProperty(value = "") + public Date getDateTime() { + return dateTime; + } + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + + @ApiModelProperty(value = "") + public Map getMap() { + return map; + } + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java new file mode 100644 index 00000000000..53d4313dfd1 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java @@ -0,0 +1,93 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * Model for testing model name starting with number + **/ +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model name starting with number") + +public class Model200Response { + + private @Valid Integer name = null; + private @Valid String propertyClass = null; + + /** + **/ + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200Response = (Model200Response) o; + return Objects.equals(name, _200Response.name) && + Objects.equals(propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java new file mode 100644 index 00000000000..b21d4f89017 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -0,0 +1,108 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ModelApiResponse { + + private @Valid Integer code = null; + private @Valid String type = null; + private @Valid String message = null; + + /** + **/ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + + @ApiModelProperty(value = "") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + **/ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + @ApiModelProperty(value = "") + 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); + } + + @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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java new file mode 100644 index 00000000000..3e77fb415c7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java @@ -0,0 +1,74 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * Model for testing reserved words + **/ +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing reserved words") + +public class ModelReturn { + + private @Valid Integer _return = null; + + /** + **/ + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(_return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java new file mode 100644 index 00000000000..775320ca04f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java @@ -0,0 +1,132 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * Model for testing model name same as property name + **/ +import io.swagger.annotations.*; +import java.util.Objects; +@ApiModel(description = "Model for testing model name same as property name") + +public class Name { + + private @Valid Integer name = null; + private @Valid Integer snakeCase = null; + private @Valid String property = null; + private @Valid Integer _123Number = null; + + /** + **/ + public Name name(Integer name) { + this.name = name; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + public Integer getName() { + return name; + } + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + @ApiModelProperty(value = "") + public Integer getSnakeCase() { + return snakeCase; + } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + /** + **/ + public Name property(String property) { + this.property = property; + return this; + } + + + @ApiModelProperty(value = "") + public String getProperty() { + return property; + } + public void setProperty(String property) { + this.property = property; + } + + /** + **/ + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + + @ApiModelProperty(value = "") + public Integer get123Number() { + return _123Number; + } + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase) && + Objects.equals(property, name.property) && + Objects.equals(_123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java new file mode 100644 index 00000000000..631daa797cc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java @@ -0,0 +1,71 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class NumberOnly { + + private @Valid BigDecimal justNumber = null; + + /** + **/ + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java new file mode 100644 index 00000000000..344d5055c08 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java @@ -0,0 +1,198 @@ +package io.swagger.model; + +import java.util.Date; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Order { + + private @Valid Long id = null; + private @Valid Long petId = null; + private @Valid Integer quantity = null; + private @Valid Date shipDate = null; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String v) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid StatusEnum status = null; + private @Valid Boolean complete = false; + + /** + **/ + public Order id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + + @ApiModelProperty(value = "") + public Long getPetId() { + return petId; + } + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + + @ApiModelProperty(value = "") + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + + @ApiModelProperty(value = "") + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { + return status; + } + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @ApiModelProperty(value = "") + 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); + } + + @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/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java new file mode 100644 index 00000000000..28aa1476f3d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java @@ -0,0 +1,109 @@ +package io.swagger.model; + +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class OuterComposite { + + private @Valid BigDecimal myNumber = null; + private @Valid String myString = null; + private @Valid Boolean myBoolean = null; + + /** + **/ + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + /** + **/ + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + public void setMyString(String myString) { + this.myString = myString; + } + + /** + **/ + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(myNumber, outerComposite.myNumber) && + Objects.equals(myString, outerComposite.myString) && + Objects.equals(myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java new file mode 100644 index 00000000000..eb4b2679ebe --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java @@ -0,0 +1,44 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java new file mode 100644 index 00000000000..cd025d3bc8b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java @@ -0,0 +1,203 @@ +package io.swagger.model; + +import io.swagger.model.Category; +import io.swagger.model.Tag; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Pet { + + private @Valid Long id = null; + private @Valid Category category = null; + private @Valid String name = null; + private @Valid List photoUrls = new ArrayList(); + private @Valid List tags = new ArrayList(); + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String v) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(v)) { + return b; + } + } + return null; + } +} + + private @Valid StatusEnum status = null; + + /** + **/ + public Pet id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Pet category(Category category) { + this.category = category; + return this; + } + + + @ApiModelProperty(value = "") + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + public Pet name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + **/ + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + /** + **/ + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + **/ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + @ApiModelProperty(value = "pet status in the store") + 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); + } + + @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/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..115bbdef056 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -0,0 +1,89 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class ReadOnlyFirst { + + private @Valid String bar = null; + private @Valid String baz = null; + + /** + **/ + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + @ApiModelProperty(value = "") + public String getBar() { + return bar; + } + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + @ApiModelProperty(value = "") + public String getBaz() { + return baz; + } + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(bar, readOnlyFirst.bar) && + Objects.equals(baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java new file mode 100644 index 00000000000..08fe6d01869 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java @@ -0,0 +1,70 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class SpecialModelName { + + private @Valid Long specialPropertyName = null; + + /** + **/ + public SpecialModelName specialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + return this; + } + + + @ApiModelProperty(value = "") + public Long getSpecialPropertyName() { + return specialPropertyName; + } + public void setSpecialPropertyName(Long specialPropertyName) { + this.specialPropertyName = specialPropertyName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash(specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).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/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java new file mode 100644 index 00000000000..bd9f74287cd --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java @@ -0,0 +1,89 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class Tag { + + private @Valid Long id = null; + private @Valid String name = null; + + /** + **/ + public Tag id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Tag name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + 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); + } + + @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/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java new file mode 100644 index 00000000000..c872137dcad --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java @@ -0,0 +1,204 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; + + +public class User { + + private @Valid Long id = null; + private @Valid String username = null; + private @Valid String firstName = null; + private @Valid String lastName = null; + private @Valid String email = null; + private @Valid String password = null; + private @Valid String phone = null; + private @Valid Integer userStatus = null; + + /** + **/ + public User id(Long id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public User username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(value = "") + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + @ApiModelProperty(value = "") + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + @ApiModelProperty(value = "") + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + public User email(String email) { + this.email = email; + return this; + } + + + @ApiModelProperty(value = "") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + public User password(String password) { + this.password = password; + return this; + } + + + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + @ApiModelProperty(value = "User Status") + 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); + } + + @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/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json new file mode 100644 index 00000000000..7c2e6c0cc65 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -0,0 +1,1693 @@ +{ + "swagger" : "2.0", + "info" : { + "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: \" \\", + "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:80", + "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" ] + } ] + }, + "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" ] + } ] + } + }, + "/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", + "enum" : [ "available", "pending", "sold" ], + "default" : "available" + }, + "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" ] + } ] + } + }, + "/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 + } + }, + "/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" : [ ] + } ] + }, + "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" ] + } ] + }, + "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" ] + } ] + } + }, + "/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" ] + } ] + } + }, + "/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" : [ ] + } ] + } + }, + "/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" + } + } + } + }, + "/store/order/{order_id}" : { + "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" : "order_id", + "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" + } + } + }, + "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" : "order_id", + "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" + } + } + } + }, + "/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" + } + } + } + }, + "/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" + } + } + } + }, + "/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" + } + } + } + }, + "/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" + } + } + } + }, + "/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" + } + } + } + }, + "/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" + } + } + }, + "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" + } + } + }, + "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" + } + } + } + }, + "/fake_classname_test" : { + "patch" : { + "tags" : [ "fake_classname_tags 123#$%^" ], + "summary" : "To test class name in snake case", + "operationId" : "testClassname", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + }, + "security" : [ { + "api_key_query" : [ ] + } ] + } + }, + "/fake" : { + "get" : { + "tags" : [ "fake" ], + "summary" : "To test enum parameters", + "description" : "To test enum parameters", + "operationId" : "testEnumParameters", + "consumes" : [ "*/*" ], + "produces" : [ "*/*" ], + "parameters" : [ { + "name" : "enum_form_string_array", + "in" : "formData", + "description" : "Form parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_form_string", + "in" : "formData", + "description" : "Form parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_header_string_array", + "in" : "header", + "description" : "Header parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_header_string", + "in" : "header", + "description" : "Header parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_query_string_array", + "in" : "query", + "description" : "Query parameter enum test (string array)", + "required" : false, + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ ">", "$" ], + "default" : "$" + } + }, { + "name" : "enum_query_string", + "in" : "query", + "description" : "Query parameter enum test (string)", + "required" : false, + "type" : "string", + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] + }, { + "name" : "enum_query_integer", + "in" : "query", + "description" : "Query parameter enum test (double)", + "required" : false, + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -2 ] + }, { + "name" : "enum_query_double", + "in" : "formData", + "description" : "Query parameter enum test (double)", + "required" : false, + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + } ], + "responses" : { + "400" : { + "description" : "Invalid request" + }, + "404" : { + "description" : "Not found" + } + } + }, + "post" : { + "tags" : [ "fake" ], + "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "operationId" : "testEndpointParameters", + "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], + "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], + "parameters" : [ { + "name" : "integer", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "maximum" : 100, + "minimum" : 10 + }, { + "name" : "int32", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "maximum" : 200, + "minimum" : 20, + "format" : "int32" + }, { + "name" : "int64", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "integer", + "format" : "int64" + }, { + "name" : "number", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "number", + "maximum" : 543.2, + "minimum" : 32.1 + }, { + "name" : "float", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "number", + "maximum" : 987.6, + "format" : "float" + }, { + "name" : "double", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "number", + "maximum" : 123.4, + "minimum" : 67.8, + "format" : "double" + }, { + "name" : "string", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "pattern" : "/[a-z]/i" + }, { + "name" : "pattern_without_delimiter", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "string", + "pattern" : "^[A-Z].*" + }, { + "name" : "byte", + "in" : "formData", + "description" : "None", + "required" : true, + "type" : "string", + "format" : "byte" + }, { + "name" : "binary", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "binary" + }, { + "name" : "date", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "date" + }, { + "name" : "dateTime", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "format" : "date-time" + }, { + "name" : "password", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string", + "maxLength" : 64, + "minLength" : 10, + "format" : "password" + }, { + "name" : "callback", + "in" : "formData", + "description" : "None", + "required" : false, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "security" : [ { + "http_basic_test" : [ ] + } ] + }, + "patch" : { + "tags" : [ "fake" ], + "summary" : "To test \"client\" model", + "description" : "To test \"client\" model", + "operationId" : "testClientModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + } + } + }, + "/fake/outer/number" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer number types", + "operationId" : "fakeOuterNumberSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input number as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterNumber" + } + } ], + "responses" : { + "200" : { + "description" : "Output number", + "schema" : { + "$ref" : "#/definitions/OuterNumber" + } + } + } + } + }, + "/fake/outer/string" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer string types", + "operationId" : "fakeOuterStringSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input string as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterString" + } + } ], + "responses" : { + "200" : { + "description" : "Output string", + "schema" : { + "$ref" : "#/definitions/OuterString" + } + } + } + } + }, + "/fake/outer/boolean" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of outer boolean types", + "operationId" : "fakeOuterBooleanSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input boolean as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterBoolean" + } + } ], + "responses" : { + "200" : { + "description" : "Output boolean", + "schema" : { + "$ref" : "#/definitions/OuterBoolean" + } + } + } + } + }, + "/fake/outer/composite" : { + "post" : { + "tags" : [ "fake" ], + "description" : "Test serialization of object with outer number type", + "operationId" : "fakeOuterCompositeSerialize", + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Input composite as post body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/OuterComposite" + } + } ], + "responses" : { + "200" : { + "description" : "Output composite", + "schema" : { + "$ref" : "#/definitions/OuterComposite" + } + } + } + } + }, + "/fake/jsonFormData" : { + "get" : { + "tags" : [ "fake" ], + "summary" : "test json serialization of form data", + "description" : "", + "operationId" : "testJsonFormData", + "consumes" : [ "application/json" ], + "parameters" : [ { + "name" : "param", + "in" : "formData", + "description" : "field1", + "required" : true, + "type" : "string" + }, { + "name" : "param2", + "in" : "formData", + "description" : "field2", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation" + } + } + } + }, + "/another-fake/dummy" : { + "patch" : { + "tags" : [ "$another-fake?" ], + "summary" : "To test special tags", + "description" : "To test special tags", + "operationId" : "test_special_tags", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + } + } + } + }, + "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" + }, + "api_key_query" : { + "type" : "apiKey", + "name" : "api_key_query", + "in" : "query" + }, + "http_basic_test" : { + "type" : "basic" + } + }, + "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 + } + }, + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "xml" : { + "name" : "Category" + } + }, + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "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" + } + }, + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "type" : "object", + "required" : [ "name", "photoUrls" ], + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "x-is-unique" : true + }, + "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" ] + } + }, + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + } + }, + "$special[model.name]" : { + "properties" : { + "$special[property.name]" : { + "type" : "integer", + "format" : "int64" + } + }, + "xml" : { + "name" : "$special[model.name]" + } + }, + "Return" : { + "properties" : { + "return" : { + "type" : "integer", + "format" : "int32" + } + }, + "description" : "Model for testing reserved words", + "xml" : { + "name" : "Return" + } + }, + "Name" : { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "snake_case" : { + "type" : "integer", + "format" : "int32", + "readOnly" : true + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "type" : "integer", + "readOnly" : true + } + }, + "description" : "Model for testing model name same as property name", + "xml" : { + "name" : "Name" + } + }, + "200_response" : { + "properties" : { + "name" : { + "type" : "integer", + "format" : "int32" + }, + "class" : { + "type" : "string" + } + }, + "description" : "Model for testing model name starting with number", + "xml" : { + "name" : "Name" + } + }, + "ClassModel" : { + "properties" : { + "_class" : { + "type" : "string" + } + }, + "description" : "Model for testing model with \"_class\" property" + }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/definitions/Animal" + }, { + "type" : "object", + "properties" : { + "breed" : { + "type" : "string" + } + } + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/definitions/Animal" + }, { + "type" : "object", + "properties" : { + "declawed" : { + "type" : "boolean" + } + } + } ] + }, + "Animal" : { + "type" : "object", + "required" : [ "className" ], + "discriminator" : "className", + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "type" : "string", + "default" : "red" + } + } + }, + "AnimalFarm" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Animal" + } + }, + "format_test" : { + "type" : "object", + "required" : [ "byte", "date", "number", "password" ], + "properties" : { + "integer" : { + "type" : "integer", + "minimum" : 10, + "maximum" : 100 + }, + "int32" : { + "type" : "integer", + "format" : "int32", + "minimum" : 20, + "maximum" : 200 + }, + "int64" : { + "type" : "integer", + "format" : "int64" + }, + "number" : { + "type" : "number", + "minimum" : 32.1, + "maximum" : 543.2 + }, + "float" : { + "type" : "number", + "format" : "float", + "minimum" : 54.3, + "maximum" : 987.6 + }, + "double" : { + "type" : "number", + "format" : "double", + "minimum" : 67.8, + "maximum" : 123.4 + }, + "string" : { + "type" : "string", + "pattern" : "/[a-z]/i" + }, + "byte" : { + "type" : "string", + "format" : "byte", + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + }, + "binary" : { + "type" : "string", + "format" : "binary" + }, + "date" : { + "type" : "string", + "format" : "date" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "password" : { + "type" : "string", + "format" : "password", + "minLength" : 10, + "maxLength" : 64 + } + } + }, + "EnumClass" : { + "type" : "string", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "default" : "-efg" + }, + "Enum_Test" : { + "type" : "object", + "properties" : { + "enum_string" : { + "type" : "string", + "enum" : [ "UPPER", "lower", "" ] + }, + "enum_integer" : { + "type" : "integer", + "format" : "int32", + "enum" : [ 1, -1 ] + }, + "enum_number" : { + "type" : "number", + "format" : "double", + "enum" : [ 1.1, -1.2 ] + }, + "outerEnum" : { + "$ref" : "#/definitions/OuterEnum" + } + } + }, + "AdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "map_of_map_property" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + } + }, + "MixedPropertiesAndAdditionalPropertiesClass" : { + "type" : "object", + "properties" : { + "uuid" : { + "type" : "string", + "format" : "uuid" + }, + "dateTime" : { + "type" : "string", + "format" : "date-time" + }, + "map" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/Animal" + } + } + } + }, + "List" : { + "type" : "object", + "properties" : { + "123-list" : { + "type" : "string" + } + } + }, + "Client" : { + "type" : "object", + "properties" : { + "client" : { + "type" : "string" + } + } + }, + "ReadOnlyFirst" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "baz" : { + "type" : "string" + } + } + }, + "hasOnlyReadOnly" : { + "type" : "object", + "properties" : { + "bar" : { + "type" : "string", + "readOnly" : true + }, + "foo" : { + "type" : "string", + "readOnly" : true + } + } + }, + "Capitalization" : { + "type" : "object", + "properties" : { + "smallCamel" : { + "type" : "string" + }, + "CapitalCamel" : { + "type" : "string" + }, + "small_Snake" : { + "type" : "string" + }, + "Capital_Snake" : { + "type" : "string" + }, + "SCA_ETH_Flow_Points" : { + "type" : "string" + }, + "ATT_NAME" : { + "type" : "string", + "description" : "Name of the pet\n" + } + } + }, + "MapTest" : { + "type" : "object", + "properties" : { + "map_map_of_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + }, + "map_of_enum_string" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "enum" : [ "UPPER", "lower" ] + } + } + } + }, + "ArrayTest" : { + "type" : "object", + "properties" : { + "array_of_string" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "array_array_of_integer" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "array_array_of_model" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ReadOnlyFirst" + } + } + } + } + }, + "NumberOnly" : { + "type" : "object", + "properties" : { + "JustNumber" : { + "type" : "number" + } + } + }, + "ArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayNumber" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + }, + "ArrayOfArrayOfNumberOnly" : { + "type" : "object", + "properties" : { + "ArrayArrayNumber" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "number" + } + } + } + } + }, + "EnumArrays" : { + "type" : "object", + "properties" : { + "just_symbol" : { + "type" : "string", + "enum" : [ ">=", "$" ] + }, + "array_enum" : { + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "fish", "crab" ] + } + } + } + }, + "OuterEnum" : { + "type" : "string", + "enum" : [ "placed", "approved", "delivered" ] + }, + "OuterComposite" : { + "type" : "object", + "properties" : { + "my_number" : { + "$ref" : "#/definitions/OuterNumber" + }, + "my_string" : { + "$ref" : "#/definitions/OuterString" + }, + "my_boolean" : { + "$ref" : "#/definitions/OuterBoolean" + } + } + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } +} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 984515b6162..17d7b2328ef 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -12,9 +12,9 @@ org.apache.maven.plugins maven-war-plugin 3.1.0 - - false - + + false + maven-failsafe-plugin @@ -31,18 +31,18 @@ - - javax.ws.rs - javax.ws.rs-api - 2.0 - provided - - - io.swagger - swagger-annotations - provided - 1.5.3 - + + javax.ws.rs + javax.ws.rs-api + 2.0 + provided + + + io.swagger + swagger-annotations + provided + 1.5.3 + junit junit diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..a1853b368d5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,29 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/another-fake") +@Api(description = "the another-fake API") +public class AnotherFakeApi { + + @PATCH + @Path("/dummy") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testSpecialTags(@Valid Client body) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java index 26f55bbb1b4..39f7c494893 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeApi.java @@ -15,106 +15,88 @@ import java.util.List; import javax.validation.constraints.*; import javax.validation.Valid; -import java.lang.Exception; @Path("/fake") - @Api(description = "the fake API") - - - - -public class FakeApi { +public class FakeApi { @POST @Path("/outer/boolean") - - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - public Response fakeOuterBooleanSerialize(@Valid Boolean body) throws Exception { + public Response fakeOuterBooleanSerialize(@Valid Boolean body) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/composite") - - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) throws Exception { + public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/number") - - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - public Response fakeOuterNumberSerialize(@Valid BigDecimal body) throws Exception { + public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/string") - - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - public Response fakeOuterStringSerialize(@Valid String body) throws Exception { + public Response fakeOuterStringSerialize(@Valid String body) { return Response.ok().entity("magic!").build(); } @PATCH - @Consumes({ "application/json" }) @Produces({ "application/json" }) @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@Valid Client body) throws Exception { + public Response testClientModel(@Valid Client body) { return Response.ok().entity("magic!").build(); } @POST - - @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) - @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) + @Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) throws Exception { + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { return Response.ok().entity("magic!").build(); } @GET - @Consumes({ "*/*" }) @Produces({ "*/*" }) @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) throws Exception { + public Response testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) { return Response.ok().entity("magic!").build(); } @GET @Path("/jsonFormData") @Consumes({ "application/json" }) - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) throws Exception { + public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 3cfcd1b26f3..73a17df8e68 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -11,19 +11,12 @@ import java.util.List; import javax.validation.constraints.*; import javax.validation.Valid; -import java.lang.Exception; @Path("/fake_classname_test") - @Api(description = "the fake_classname_test API") - - - - -public class FakeClassnameTestApi { +public class FakeClassnameTestApi { @PATCH - @Consumes({ "application/json" }) @Produces({ "application/json" }) @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { @@ -31,7 +24,7 @@ public class FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@Valid Client body) throws Exception { + public Response testClassname(@Valid Client body) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java index bec6a70b95f..2315ee854a6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java @@ -13,19 +13,12 @@ import java.util.List; import javax.validation.constraints.*; import javax.validation.Valid; -import java.lang.Exception; @Path("/pet") - @Api(description = "the pet API") - - - - -public class PetApi { +public class PetApi { @POST - @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { @@ -36,13 +29,12 @@ public class PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@Valid Pet body) throws Exception { + public Response addPet(@Valid Pet body) { return Response.ok().entity("magic!").build(); } @DELETE @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -52,13 +44,12 @@ public Response addPet(@Valid Pet body) throws Exception { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) throws Exception { + public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) { return Response.ok().entity("magic!").build(); } @GET @Path("/findByStatus") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -69,13 +60,12 @@ public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) throws Exception { + public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) { return Response.ok().entity("magic!").build(); } @GET @Path("/findByTags") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -86,13 +76,12 @@ public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Sta @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) throws Exception { + public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) { return Response.ok().entity("magic!").build(); } @GET @Path("/{petId}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") @@ -101,12 +90,11 @@ public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) throws Exception { + public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) { return Response.ok().entity("magic!").build(); } @PUT - @Consumes({ "application/json", "application/xml" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @@ -119,7 +107,7 @@ public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@Valid Pet body) throws Exception { + public Response updatePet(@Valid Pet body) { return Response.ok().entity("magic!").build(); } @@ -135,7 +123,7 @@ public Response updatePet(@Valid Pet body) throws Exception { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) throws Exception { + public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { return Response.ok().entity("magic!").build(); } @@ -152,7 +140,7 @@ public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail) throws Exception { + @FormParam(value = "file") Attachment fileDetail) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java index 8e7f5403dfb..f2de22abfce 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/StoreApi.java @@ -12,64 +12,54 @@ import java.util.List; import javax.validation.constraints.*; import javax.validation.Valid; -import java.lang.Exception; @Path("/store") - @Api(description = "the store API") - - - - -public class StoreApi { +public class StoreApi { @DELETE @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) throws Exception { + public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } @GET @Path("/inventory") - @Produces({ "application/json" }) @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - public Response getInventory() throws Exception { + public Response getInventory() { return Response.ok().entity("magic!").build(); } @GET @Path("/order/{order_id}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) throws Exception { + public Response getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) { return Response.ok().entity("magic!").build(); } @POST @Path("/order") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@Valid Order body) throws Exception { + public Response placeOrder(@Valid Order body) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java index ff88e2889d0..63ab0965998 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/UserApi.java @@ -12,107 +12,92 @@ import java.util.List; import javax.validation.constraints.*; import javax.validation.Valid; -import java.lang.Exception; @Path("/user") - @Api(description = "the user API") - - - - -public class UserApi { +public class UserApi { @POST - - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@Valid User body) throws Exception { + public Response createUser(@Valid User body) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithArray") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithArrayInput(@Valid List body) throws Exception { + public Response createUsersWithArrayInput(@Valid List body) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithList") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithListInput(@Valid List body) throws Exception { + public Response createUsersWithListInput(@Valid List body) { return Response.ok().entity("magic!").build(); } @DELETE @Path("/{username}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) throws Exception { + public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) { return Response.ok().entity("magic!").build(); } @GET @Path("/{username}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) throws Exception { + public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) { return Response.ok().entity("magic!").build(); } @GET @Path("/login") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) throws Exception { + public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) { return Response.ok().entity("magic!").build(); } @GET @Path("/logout") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response logoutUser() throws Exception { + public Response logoutUser() { return Response.ok().entity("magic!").build(); } @PUT @Path("/{username}") - @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) throws Exception { + public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index d33017f379f..7c2e6c0cc65 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -1029,6 +1029,33 @@ } } } + }, + "/another-fake/dummy" : { + "patch" : { + "tags" : [ "$another-fake?" ], + "summary" : "To test special tags", + "description" : "To test special tags", + "operationId" : "test_special_tags", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + } + } } }, "securityDefinitions" : { @@ -1635,15 +1662,6 @@ "type" : "string", "enum" : [ "placed", "approved", "delivered" ] }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" - }, "OuterComposite" : { "type" : "object", "properties" : { @@ -1657,6 +1675,15 @@ "$ref" : "#/definitions/OuterBoolean" } } + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean" } }, "externalDocs" : { From 1f9f8c5a3e157daf62c891ff9f27db7f76897e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20=C5=9Eener?= Date: Sun, 8 Oct 2017 12:15:21 +0300 Subject: [PATCH 123/197] [JavaScript] Fix licenseNames (#6605) * [JavaScript] Fix licenseName in package.mustache * Fix invalid SPDX license expression in resources/2_0 * Update JavaScript samples --- .../languages/JavascriptClientCodegen.java | 28 ++--- .../resources/Javascript/es6/package.mustache | 2 +- .../resources/Javascript/package.mustache | 2 +- .../JavaScriptClientOptionsTest.java | 2 +- .../options/JavaScriptOptionsProvider.java | 3 +- .../test/resources/2_0/binaryDataTest.json | 2 +- .../test/resources/2_0/datePropertyTest.json | 2 +- .../test/resources/2_0/fileResponseTest.json | 2 +- .../2_0/globalConsumesAndProduces.json | 2 +- .../test/resources/2_0/globalSecurity.json | 2 +- .../src/test/resources/2_0/petstore-bash.json | 4 +- .../src/test/resources/2_0/petstore-orig.json | 2 +- .../resources/2_0/petstore-security-test.yaml | 2 +- .../resources/2_0/petstore-vendor-mime.yaml | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 2 +- .../src/test/resources/2_0/petstore.json | 2 +- .../src/test/resources/2_0/petstore.yaml | 2 +- .../src/test/resources/2_0/postBodyTest.json | 4 +- .../src/test/resources/2_0/requiredTest.json | 4 +- .../resources/2_0/responseHeaderTest.yaml | 4 +- .../resources/2_0/responseSelectionTest.json | 4 +- .../client/petstore/javascript-es6/README.md | 12 +- .../javascript-es6/docs/AnotherFakeApi.md | 54 +++++++++ .../docs/FakeClassnameTags123Api.md | 59 ++++++++++ .../petstore/javascript-es6/package.json | 2 +- .../javascript-es6/src/api/AnotherFakeApi.js | 83 ++++++++++++++ .../src/api/FakeClassnameTags123Api.js | 82 ++++++++++++++ .../petstore/javascript-es6/src/index.js | 15 ++- .../test/api/AnotherFakeApi.spec.js | 63 +++++++++++ .../test/api/FakeClassnameTags123Api.spec.js | 63 +++++++++++ .../petstore/javascript-promise-es6/README.md | 12 +- .../docs/AnotherFakeApi.md | 52 +++++++++ .../docs/FakeClassnameTags123Api.md | 57 ++++++++++ .../javascript-promise-es6/package.json | 2 +- .../src/api/AnotherFakeApi.js | 88 +++++++++++++++ .../src/api/FakeClassnameTags123Api.js | 86 ++++++++++++++ .../javascript-promise-es6/src/index.js | 15 ++- .../test/api/AnotherFakeApi.spec.js | 63 +++++++++++ .../test/api/FakeClassnameTags123Api.spec.js | 63 +++++++++++ .../petstore/javascript-promise/README.md | 12 +- .../javascript-promise/docs/AnotherFakeApi.md | 52 +++++++++ .../docs/FakeClassnameTags123Api.md | 57 ++++++++++ .../petstore/javascript-promise/package.json | 2 +- .../src/api/AnotherFakeApi.js | 105 ++++++++++++++++++ .../src/api/FakeClassnameTags123Api.js | 103 +++++++++++++++++ .../petstore/javascript-promise/src/index.js | 17 ++- .../test/api/AnotherFakeApi.spec.js | 66 +++++++++++ .../test/api/FakeClassnameTags123Api.spec.js | 66 +++++++++++ samples/client/petstore/javascript/README.md | 12 +- .../javascript/docs/AnotherFakeApi.md | 55 +++++++++ .../docs/FakeClassnameTags123Api.md | 60 ++++++++++ .../client/petstore/javascript/package.json | 2 +- .../javascript/src/api/AnotherFakeApi.js | 100 +++++++++++++++++ .../src/api/FakeClassnameTags123Api.js | 99 +++++++++++++++++ .../client/petstore/javascript/src/index.js | 17 ++- .../test/api/AnotherFakeApi.spec.js | 66 +++++++++++ .../test/api/FakeClassnameTags123Api.spec.js | 66 +++++++++++ 57 files changed, 1820 insertions(+), 87 deletions(-) create mode 100644 samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js create mode 100644 samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js create mode 100644 samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js create mode 100644 samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js create mode 100644 samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js create mode 100644 samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js create mode 100644 samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js create mode 100644 samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js create mode 100644 samples/client/petstore/javascript/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/javascript/src/api/AnotherFakeApi.js create mode 100644 samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js create mode 100644 samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 78807fbd576..7c82c09a4cf 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -52,7 +52,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo public static final String MODULE_NAME = "moduleName"; public static final String PROJECT_DESCRIPTION = "projectDescription"; public static final String PROJECT_VERSION = "projectVersion"; - public static final String PROJECT_LICENSE_NAME = "projectLicenseName"; public static final String USE_PROMISES = "usePromises"; public static final String USE_INHERITANCE = "useInheritance"; public static final String EMIT_MODEL_METHODS = "emitModelMethods"; @@ -84,7 +83,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo protected String moduleName; protected String projectDescription; protected String projectVersion; - protected String projectLicenseName; + protected String licenseName; protected String invokerPackage; protected String sourceFolder = "src"; @@ -179,7 +178,7 @@ public JavascriptClientCodegen() { "description of the project (Default: using info.description or \"Client library of \")")); cliOptions.add(new CliOption(PROJECT_VERSION, "version of the project (Default: using info.version or \"1.0.0\")")); - cliOptions.add(new CliOption(PROJECT_LICENSE_NAME, + cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME, "name of the license the project uses (Default: using info.license.name)")); cliOptions.add(new CliOption(USE_PROMISES, "use Promises as return values from the client API, instead of superagent callbacks") @@ -244,8 +243,8 @@ public void processOpts() { if (additionalProperties.containsKey(PROJECT_VERSION)) { setProjectVersion(((String) additionalProperties.get(PROJECT_VERSION))); } - if (additionalProperties.containsKey(PROJECT_LICENSE_NAME)) { - setProjectLicenseName(((String) additionalProperties.get(PROJECT_LICENSE_NAME))); + if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) { + setLicenseName(((String) additionalProperties.get(CodegenConstants.LICENSE_NAME))); } if (additionalProperties.containsKey(CodegenConstants.LOCAL_VARIABLE_PREFIX)) { setLocalVariablePrefix((String) additionalProperties.get(CodegenConstants.LOCAL_VARIABLE_PREFIX)); @@ -291,12 +290,11 @@ public void preprocessSwagger(Swagger swagger) { // when projectDescription is not specified, use info.description projectDescription = sanitizeName(info.getDescription()); } - if (additionalProperties.get(PROJECT_LICENSE_NAME) == null) { - // when projectLicense is not specified, use info.license - if (info.getLicense() != null) { - License license = info.getLicense(); - additionalProperties.put(PROJECT_LICENSE_NAME, sanitizeName(license.getName())); - } + + // when licenceName is not specified, use info.license + if (additionalProperties.get(CodegenConstants.LICENSE_NAME) == null && info.getLicense() != null) { + License license = info.getLicense(); + licenseName = license.getName(); } } @@ -313,11 +311,15 @@ public void preprocessSwagger(Swagger swagger) { if (projectDescription == null) { projectDescription = "Client library of " + projectName; } + if (StringUtils.isBlank(licenseName)) { + licenseName = "Unlicense"; + } additionalProperties.put(PROJECT_NAME, projectName); additionalProperties.put(MODULE_NAME, moduleName); additionalProperties.put(PROJECT_DESCRIPTION, escapeText(projectDescription)); additionalProperties.put(PROJECT_VERSION, projectVersion); + additionalProperties.put(CodegenConstants.LICENSE_NAME, licenseName); additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage); additionalProperties.put(CodegenConstants.LOCAL_VARIABLE_PREFIX, localVariablePrefix); @@ -422,8 +424,8 @@ public void setProjectVersion(String projectVersion) { this.projectVersion = projectVersion; } - public void setProjectLicenseName(String projectLicenseName) { - this.projectLicenseName = projectLicenseName; + public void setLicenseName(String licenseName) { + this.licenseName = licenseName; } public void setUsePromises(boolean usePromises) { diff --git a/modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache index 0998928468f..179f5cd3c73 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/es6/package.mustache @@ -2,7 +2,7 @@ "name": "{{{projectName}}}", "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", - "license": "Unlicense", + "license": "{{licenseName}}", "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", "scripts": { "test": "mocha --compilers js:babel-core/register --recursive" diff --git a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache index bdb18166c75..79d0d8f6721 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/package.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/package.mustache @@ -2,7 +2,7 @@ "name": "{{{projectName}}}", "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", - "license": "Unlicense", + "license": "{{licenseName}}", "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java index 16e96454ea3..4f02b013fb2 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavaScriptClientOptionsTest.java @@ -58,7 +58,7 @@ protected void setExpectations() { times = 1; clientCodegen.setProjectVersion(JavaScriptOptionsProvider.PROJECT_VERSION_VALUE); times = 1; - clientCodegen.setProjectLicenseName(JavaScriptOptionsProvider.PROJECT_LICENSE_NAME_VALUE); + clientCodegen.setLicenseName(JavaScriptOptionsProvider.PROJECT_LICENSE_NAME_VALUE); times = 1; clientCodegen.setUsePromises(Boolean.valueOf(JavaScriptOptionsProvider.USE_PROMISES_VALUE)); times = 1; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java index 12361277ddc..2c7a91cebe9 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaScriptOptionsProvider.java @@ -1,7 +1,6 @@ package io.swagger.codegen.options; import io.swagger.codegen.CodegenConstants; -import io.swagger.codegen.options.OptionsProvider; import io.swagger.codegen.languages.JavascriptClientCodegen; import com.google.common.collect.ImmutableMap; @@ -56,7 +55,7 @@ public JavaScriptOptionsProvider() { .put(JavascriptClientCodegen.MODULE_NAME, MODULE_NAME_VALUE) .put(JavascriptClientCodegen.PROJECT_DESCRIPTION, PROJECT_DESCRIPTION_VALUE) .put(JavascriptClientCodegen.PROJECT_VERSION, PROJECT_VERSION_VALUE) - .put(JavascriptClientCodegen.PROJECT_LICENSE_NAME, PROJECT_LICENSE_NAME_VALUE) + .put(CodegenConstants.LICENSE_NAME, PROJECT_LICENSE_NAME_VALUE) .put(JavascriptClientCodegen.USE_PROMISES, USE_PROMISES_VALUE) .put(JavascriptClientCodegen.USE_INHERITANCE, USE_INHERITANCE_VALUE) .put(JavascriptClientCodegen.EMIT_MODEL_METHODS, EMIT_MODEL_METHODS_VALUE) diff --git a/modules/swagger-codegen/src/test/resources/2_0/binaryDataTest.json b/modules/swagger-codegen/src/test/resources/2_0/binaryDataTest.json index 5ae05f9ae83..7b0f88838e5 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/binaryDataTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/binaryDataTest.json @@ -6,7 +6,7 @@ "title": "Swagger Petstore", "termsOfService": "http://helloreverb.com/terms/", "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/datePropertyTest.json b/modules/swagger-codegen/src/test/resources/2_0/datePropertyTest.json index 841bbb93dec..b5e0417dd0f 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/datePropertyTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/datePropertyTest.json @@ -6,7 +6,7 @@ "title": "Swagger Petstore", "termsOfService": "http://helloreverb.com/terms/", "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/fileResponseTest.json b/modules/swagger-codegen/src/test/resources/2_0/fileResponseTest.json index ab8237934ef..e5421675763 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/fileResponseTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/fileResponseTest.json @@ -4,7 +4,7 @@ "version": "1.0.0", "title": "File Response Test", "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json b/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json index 520218ed707..76e6bfbff8a 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json +++ b/modules/swagger-codegen/src/test/resources/2_0/globalConsumesAndProduces.json @@ -9,7 +9,7 @@ "email": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/globalSecurity.json b/modules/swagger-codegen/src/test/resources/2_0/globalSecurity.json index cc302bbf5a7..0f672a24324 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/globalSecurity.json +++ b/modules/swagger-codegen/src/test/resources/2_0/globalSecurity.json @@ -9,7 +9,7 @@ "email": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-bash.json b/modules/swagger-codegen/src/test/resources/2_0/petstore-bash.json index b58cd694d4e..7454660f8ba 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-bash.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-bash.json @@ -9,7 +9,7 @@ "email":"apiteam@swagger.io" }, "license":{ - "name":"Apache 2.0", + "name":"Apache-2.0", "url":"http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -1053,4 +1053,4 @@ "description":"Find out more about Swagger", "url":"http://swagger.io" } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-orig.json b/modules/swagger-codegen/src/test/resources/2_0/petstore-orig.json index 58577dd2f52..eeeb0698cd2 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-orig.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-orig.json @@ -9,7 +9,7 @@ "email": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml index 16bce94ac7d..2637a70b8c3 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml @@ -7,7 +7,7 @@ info: contact: email: apiteam@swagger.io */ ' " =end -- \r\n \n \r license: - name: Apache 2.0 */ ' " =end -- \r\n \n \r + name: Apache-2.0 */ ' " =end -- \r\n \n \r url: http://www.apache.org/licenses/LICENSE-2.0.html */ ' " =end -- \r\n \n \r host: petstore.swagger.io */ ' " =end -- \r\n \n \r basePath: /v2 */ ' " =end -- \r\n \n \r diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-vendor-mime.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-vendor-mime.yaml index 57380003800..1e58dc0ef85 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-vendor-mime.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-vendor-mime.yaml @@ -7,7 +7,7 @@ info: contact: email: apiteam@swagger.io license: - name: Apache 2.0 + name: Apache-2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' host: petstore.swagger.io basePath: /v2 diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 059a5ef4980..2510e6cc9ef 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -7,7 +7,7 @@ info: contact: email: apiteam@swagger.io license: - name: Apache 2.0 + name: Apache-2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' host: petstore.swagger.io:80 basePath: /v2 diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json index 64097a70227..4290daed14d 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json @@ -9,7 +9,7 @@ "email": "apiteam@wordnik.com" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml index b0f52e7eb97..787e72399c0 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml @@ -7,7 +7,7 @@ info: contact: email: apiteam@swagger.io license: - name: Apache 2.0 + name: Apache-2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' host: petstore.swagger.io basePath: /v2 diff --git a/modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json b/modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json index 31de5d80094..45270c73503 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/postBodyTest.json @@ -9,7 +9,7 @@ "name": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -99,4 +99,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/test/resources/2_0/requiredTest.json b/modules/swagger-codegen/src/test/resources/2_0/requiredTest.json index aaf79e10f89..db01506328b 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/requiredTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/requiredTest.json @@ -9,7 +9,7 @@ "email": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -92,4 +92,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml index 7c868bdabac..8bc8819a9ab 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/responseHeaderTest.yaml @@ -4,7 +4,7 @@ info: version: 1.0.0 title: Response header test license: - name: Apache 2.0 + name: Apache-2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' basePath: / schemes: @@ -38,4 +38,4 @@ paths: type: "integer" description: "I am the error code" '400': - description: Invalid ID supplied \ No newline at end of file + description: Invalid ID supplied diff --git a/modules/swagger-codegen/src/test/resources/2_0/responseSelectionTest.json b/modules/swagger-codegen/src/test/resources/2_0/responseSelectionTest.json index e31ae09488c..2e958e513f1 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/responseSelectionTest.json +++ b/modules/swagger-codegen/src/test/resources/2_0/responseSelectionTest.json @@ -9,7 +9,7 @@ "email": "apiteam@swagger.io" }, "license": { - "name": "Apache 2.0", + "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -138,4 +138,4 @@ } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 3c84a23057e..7d74305e7ce 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -70,11 +70,10 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() + +var body = new SwaggerPetstore.Client(); // {Client} client model -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; var callback = function(error, data, response) { if (error) { @@ -83,7 +82,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.fakeOuterBooleanSerialize(opts, callback); +api.testSpecialTags(body, callback); ``` @@ -93,6 +92,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -101,7 +101,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..5617fa29d63 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +let body = new SwaggerPetstore.Client(); // Client | client model + + +apiInstance.testSpecialTags(body, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..9b2c6dcd418 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +let api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +let apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +let body = new SwaggerPetstore.Client(); // Client | client model + + +apiInstance.testClassname(body, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-es6/package.json b/samples/client/petstore/javascript-es6/package.json index 0332217891a..427e6b3a506 100644 --- a/samples/client/petstore/javascript-es6/package.json +++ b/samples/client/petstore/javascript-es6/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "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__", - "license": "Unlicense", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "mocha --compilers js:babel-core/register --recursive" diff --git a/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js new file mode 100644 index 00000000000..ed170379f3b --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js @@ -0,0 +1,83 @@ +/** + * 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: 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. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* AnotherFake service. +* @module api/AnotherFakeApi +* @version 1.0.0 +*/ +export default class AnotherFakeApi { + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + /** + * Callback function to receive the result of the testSpecialTags operation. + * @callback module:api/AnotherFakeApi~testSpecialTagsCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @param {module:api/AnotherFakeApi~testSpecialTagsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + testSpecialTags(body, callback) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + +} diff --git a/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js new file mode 100644 index 00000000000..11ece0534a7 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,82 @@ +/** + * 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: 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. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* FakeClassnameTags123 service. +* @module api/FakeClassnameTags123Api +* @version 1.0.0 +*/ +export default class FakeClassnameTags123Api { + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + /** + * Callback function to receive the result of the testClassname operation. + * @callback module:api/FakeClassnameTags123Api~testClassnameCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @param {module:api/FakeClassnameTags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + testClassname(body, callback) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testClassname"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['api_key_query']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + +} diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 9a8ff8e2e42..ebcad866e7a 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -49,8 +49,9 @@ import Tag from './model/Tag'; import User from './model/User'; import Cat from './model/Cat'; import Dog from './model/Dog'; +import AnotherFakeApi from './api/AnotherFakeApi'; import FakeApi from './api/FakeApi'; -import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import FakeClassnameTags123Api from './api/FakeClassnameTags123Api'; import PetApi from './api/PetApi'; import StoreApi from './api/StoreApi'; import UserApi from './api/UserApi'; @@ -310,6 +311,12 @@ export { */ Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi, + /** * The FakeApi service constructor. * @property {module:api/FakeApi} @@ -317,10 +324,10 @@ export { FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api, + FakeClassnameTags123Api, /** * The PetApi service constructor. diff --git a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..f55538a53e7 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * 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: 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. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..10e20e7778a --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * 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: 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. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index 833e2d74828..c668dfd721f 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -70,12 +70,11 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; -api.fakeOuterBooleanSerialize(opts).then(function(data) { +var body = new SwaggerPetstore.Client(); // {Client} client model + +api.testSpecialTags(body).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -90,6 +89,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -98,7 +98,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..e6e6f0bf9f9 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md @@ -0,0 +1,52 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +let body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testSpecialTags(body).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..1595c9b35f4 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md @@ -0,0 +1,57 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +let api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +let apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +let body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testClassname(body).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise-es6/package.json b/samples/client/petstore/javascript-promise-es6/package.json index 0332217891a..427e6b3a506 100644 --- a/samples/client/petstore/javascript-promise-es6/package.json +++ b/samples/client/petstore/javascript-promise-es6/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "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__", - "license": "Unlicense", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "mocha --compilers js:babel-core/register --recursive" diff --git a/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js new file mode 100644 index 00000000000..94185c14bc3 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js @@ -0,0 +1,88 @@ +/** + * 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: 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. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* AnotherFake service. +* @module api/AnotherFakeApi +* @version 1.0.0 +*/ +export default class AnotherFakeApi { + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response + */ + testSpecialTagsWithHttpInfo(body) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + testSpecialTags(body) { + return this.testSpecialTagsWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js new file mode 100644 index 00000000000..89dddfd7a92 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,86 @@ +/** + * 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: 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. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* FakeClassnameTags123 service. +* @module api/FakeClassnameTags123Api +* @version 1.0.0 +*/ +export default class FakeClassnameTags123Api { + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response + */ + testClassnameWithHttpInfo(body) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testClassname"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['api_key_query']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + testClassname(body) { + return this.testClassnameWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 9a8ff8e2e42..ebcad866e7a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -49,8 +49,9 @@ import Tag from './model/Tag'; import User from './model/User'; import Cat from './model/Cat'; import Dog from './model/Dog'; +import AnotherFakeApi from './api/AnotherFakeApi'; import FakeApi from './api/FakeApi'; -import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import FakeClassnameTags123Api from './api/FakeClassnameTags123Api'; import PetApi from './api/PetApi'; import StoreApi from './api/StoreApi'; import UserApi from './api/UserApi'; @@ -310,6 +311,12 @@ export { */ Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi, + /** * The FakeApi service constructor. * @property {module:api/FakeApi} @@ -317,10 +324,10 @@ export { FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api, + FakeClassnameTags123Api, /** * The PetApi service constructor. diff --git a/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..f55538a53e7 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * 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: 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. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..10e20e7778a --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * 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: 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. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 50b4721e60e..35942f17ef6 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -95,12 +95,11 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; -api.fakeOuterBooleanSerialize(opts).then(function(data) { +var body = new SwaggerPetstore.Client(); // {Client} client model + +api.testSpecialTags(body).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -115,6 +114,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -123,7 +123,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..34529644bba --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md @@ -0,0 +1,52 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +var body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testSpecialTags(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..670ed04c196 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md @@ -0,0 +1,57 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); +var defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +var api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +var apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +var body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testClassname(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise/package.json b/samples/client/petstore/javascript-promise/package.json index 881163c02f4..e9678cd1878 100644 --- a/samples/client/petstore/javascript-promise/package.json +++ b/samples/client/petstore/javascript-promise/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "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__", - "license": "Unlicense", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js new file mode 100644 index 00000000000..eabb53763c2 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -0,0 +1,105 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.AnotherFakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * AnotherFake service. + * @module api/AnotherFakeApi + * @version 1.0.0 + */ + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response + */ + this.testSpecialTagsWithHttpInfo = function(body) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testSpecialTags = function(body) { + return this.testSpecialTagsWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js new file mode 100644 index 00000000000..fdae9bbaebd --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,103 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.FakeClassnameTags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * FakeClassnameTags123 service. + * @module api/FakeClassnameTags123Api + * @version 1.0.0 + */ + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response + */ + this.testClassnameWithHttpInfo = function(body) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testClassname"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['api_key_query']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testClassname = function(body) { + return this.testClassnameWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index afc840ce758..480a6d3ead3 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -242,16 +242,21 @@ * @property {module:model/Dog} */ Dog: Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi: AnotherFakeApi, /** * The FakeApi service constructor. * @property {module:api/FakeApi} */ FakeApi: FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api: Fake_classname_tags123Api, + FakeClassnameTags123Api: FakeClassnameTags123Api, /** * The PetApi service constructor. * @property {module:api/PetApi} diff --git a/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..593e828d3cd --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,66 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..06504559511 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,66 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 89263d30f51..402689f894a 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -95,11 +95,10 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() + +var body = new SwaggerPetstore.Client(); // {Client} client model -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; var callback = function(error, data, response) { if (error) { @@ -108,7 +107,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.fakeOuterBooleanSerialize(opts, callback); +api.testSpecialTags(body, callback); ``` @@ -118,6 +117,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -126,7 +126,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript/docs/AnotherFakeApi.md b/samples/client/petstore/javascript/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..1423cbe5056 --- /dev/null +++ b/samples/client/petstore/javascript/docs/AnotherFakeApi.md @@ -0,0 +1,55 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +var body = new SwaggerPetstore.Client(); // Client | client model + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.testSpecialTags(body, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..92d5dec78e6 --- /dev/null +++ b/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md @@ -0,0 +1,60 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); +var defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +var api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +var apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +var body = new SwaggerPetstore.Client(); // Client | client model + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.testClassname(body, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript/package.json b/samples/client/petstore/javascript/package.json index 881163c02f4..e9678cd1878 100644 --- a/samples/client/petstore/javascript/package.json +++ b/samples/client/petstore/javascript/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "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__", - "license": "Unlicense", + "license": "Apache-2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js new file mode 100644 index 00000000000..e8233483e19 --- /dev/null +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -0,0 +1,100 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.AnotherFakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * AnotherFake service. + * @module api/AnotherFakeApi + * @version 1.0.0 + */ + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + /** + * Callback function to receive the result of the testSpecialTags operation. + * @callback module:api/AnotherFakeApi~testSpecialTagsCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @param {module:api/AnotherFakeApi~testSpecialTagsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + this.testSpecialTags = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js new file mode 100644 index 00000000000..4da32026322 --- /dev/null +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,99 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.FakeClassnameTags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * FakeClassnameTags123 service. + * @module api/FakeClassnameTags123Api + * @version 1.0.0 + */ + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + /** + * Callback function to receive the result of the testClassname operation. + * @callback module:api/FakeClassnameTags123Api~testClassnameCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @param {module:api/FakeClassnameTags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + this.testClassname = function(body, callback) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testClassname"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['api_key_query']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index afc840ce758..480a6d3ead3 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -242,16 +242,21 @@ * @property {module:model/Dog} */ Dog: Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi: AnotherFakeApi, /** * The FakeApi service constructor. * @property {module:api/FakeApi} */ FakeApi: FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api: Fake_classname_tags123Api, + FakeClassnameTags123Api: FakeClassnameTags123Api, /** * The PetApi service constructor. * @property {module:api/PetApi} diff --git a/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..593e828d3cd --- /dev/null +++ b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,66 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..06504559511 --- /dev/null +++ b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,66 @@ +/** + * 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: 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); From 1dc3fb4f37248b20078294f9745aa8cbe65d4691 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 8 Oct 2017 17:16:48 +0800 Subject: [PATCH 124/197] remove unused JS files --- .../api/Fake_classname_tags123Api.spec.js | 66 ------------------- .../api/Fake_classname_tags123Api.spec.js | 66 ------------------- .../api/Fake_classname_tags123Api.spec.js | 63 ------------------ .../api/Fake_classname_tags123Api.spec.js | 63 ------------------ 4 files changed, 258 deletions(-) delete mode 100644 samples/client/petstore/javascript-es6/test/api/Fake_classname_tags123Api.spec.js delete mode 100644 samples/client/petstore/javascript-promise-es6/test/api/Fake_classname_tags123Api.spec.js delete mode 100644 samples/client/petstore/javascript-promise/test/api/Fake_classname_tags123Api.spec.js delete mode 100644 samples/client/petstore/javascript/test/api/Fake_classname_tags123Api.spec.js diff --git a/samples/client/petstore/javascript-es6/test/api/Fake_classname_tags123Api.spec.js b/samples/client/petstore/javascript-es6/test/api/Fake_classname_tags123Api.spec.js deleted file mode 100644 index 0b42ab7a57c..00000000000 --- a/samples/client/petstore/javascript-es6/test/api/Fake_classname_tags123Api.spec.js +++ /dev/null @@ -1,66 +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: \" \\ - * - * 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 - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', '../../src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require('../../src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); - } -}(this, function(expect, SwaggerPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new SwaggerPetstore.Fake_classname_tags123Api(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('Fake_classname_tags123Api', function() { - describe('testClassname', function() { - it('should call testClassname successfully', function(done) { - //uncomment below and update the code to test testClassname - //instance.testClassname(function(error) { - // if (error) throw error; - //expect().to.be(); - //}); - done(); - }); - }); - }); - -})); diff --git a/samples/client/petstore/javascript-promise-es6/test/api/Fake_classname_tags123Api.spec.js b/samples/client/petstore/javascript-promise-es6/test/api/Fake_classname_tags123Api.spec.js deleted file mode 100644 index 0b42ab7a57c..00000000000 --- a/samples/client/petstore/javascript-promise-es6/test/api/Fake_classname_tags123Api.spec.js +++ /dev/null @@ -1,66 +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: \" \\ - * - * 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 - * - * Swagger Codegen version: 2.3.0-SNAPSHOT - * - * Do not edit the class manually. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', '../../src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require('../../src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); - } -}(this, function(expect, SwaggerPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new SwaggerPetstore.Fake_classname_tags123Api(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('Fake_classname_tags123Api', function() { - describe('testClassname', function() { - it('should call testClassname successfully', function(done) { - //uncomment below and update the code to test testClassname - //instance.testClassname(function(error) { - // if (error) throw error; - //expect().to.be(); - //}); - done(); - }); - }); - }); - -})); diff --git a/samples/client/petstore/javascript-promise/test/api/Fake_classname_tags123Api.spec.js b/samples/client/petstore/javascript-promise/test/api/Fake_classname_tags123Api.spec.js deleted file mode 100644 index 5bd4bc9d616..00000000000 --- a/samples/client/petstore/javascript-promise/test/api/Fake_classname_tags123Api.spec.js +++ /dev/null @@ -1,63 +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: \" \\ - * - * 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. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', '../../src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require('../../src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); - } -}(this, function(expect, SwaggerPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new SwaggerPetstore.Fake_classname_tags123Api(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('Fake_classname_tags123Api', function() { - describe('testClassname', function() { - it('should call testClassname successfully', function(done) { - //uncomment below and update the code to test testClassname - //instance.testClassname(pet, function(error) { - // if (error) throw error; - //expect().to.be(); - //}); - done(); - }); - }); - }); - -})); diff --git a/samples/client/petstore/javascript/test/api/Fake_classname_tags123Api.spec.js b/samples/client/petstore/javascript/test/api/Fake_classname_tags123Api.spec.js deleted file mode 100644 index 5bd4bc9d616..00000000000 --- a/samples/client/petstore/javascript/test/api/Fake_classname_tags123Api.spec.js +++ /dev/null @@ -1,63 +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: \" \\ - * - * 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. - * - */ - -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. - define(['expect.js', '../../src/index'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require('../../src/index')); - } else { - // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); - } -}(this, function(expect, SwaggerPetstore) { - 'use strict'; - - var instance; - - beforeEach(function() { - instance = new SwaggerPetstore.Fake_classname_tags123Api(); - }); - - var getProperty = function(object, getter, property) { - // Use getter method if present; otherwise, get the property directly. - if (typeof object[getter] === 'function') - return object[getter](); - else - return object[property]; - } - - var setProperty = function(object, setter, property, value) { - // Use setter method if present; otherwise, set the property directly. - if (typeof object[setter] === 'function') - object[setter](value); - else - object[property] = value; - } - - describe('Fake_classname_tags123Api', function() { - describe('testClassname', function() { - it('should call testClassname successfully', function(done) { - //uncomment below and update the code to test testClassname - //instance.testClassname(pet, function(error) { - // if (error) throw error; - //expect().to.be(); - //}); - done(); - }); - }); - }); - -})); From 73b38dd19e1b87d74bf846f30b4e8502d65fe451 Mon Sep 17 00:00:00 2001 From: Lukasz Konopski Date: Sun, 8 Oct 2017 12:25:38 +0200 Subject: [PATCH 125/197] #3904 Inheritance support java client retrofit gson (#4729) * merge with master * remove zoo specific artifact names * fix duplicate doublequote * #3904 add samples for retrofit2 * #3904 clean json field retrieval * #3904 allow non-abstract parent class --- .../io/swagger/codegen/DefaultGenerator.java | 1 + .../codegen/languages/JavaClientCodegen.java | 47 +++++++++++++++++++ .../libraries/retrofit2/ApiClient.mustache | 2 + .../Java/libraries/retrofit2/JSON.mustache | 46 +++++++++++++++++- .../libraries/retrofit2/build.gradle.mustache | 2 + .../libraries/retrofit2/build.sbt.mustache | 1 + .../Java/libraries/retrofit2/pom.mustache | 6 +++ .../petstore/java/retrofit2/build.gradle | 2 + .../client/petstore/java/retrofit2/build.sbt | 1 + .../client/petstore/java/retrofit2/pom.xml | 6 +++ .../java/io/swagger/client/ApiClient.java | 2 + .../src/main/java/io/swagger/client/JSON.java | 43 ++++++++++++++++- 12 files changed, 157 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index ab85cf0c4fe..80033e12699 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -708,6 +708,7 @@ public List generate() { return files; } + private File processTemplateToFile(Map templateData, String templateName, String outputFilename) throws IOException { String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); if (ignoreProcessor.allowsFile(new File(adjustedOutputFilename))) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 84aa2fbee54..33066ebeb92 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -1,5 +1,6 @@ package io.swagger.codegen.languages; +import com.google.common.collect.LinkedListMultimap; import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.GzipFeatures; @@ -432,6 +433,24 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } @SuppressWarnings("unchecked") + @Override + public Map postProcessAllModels(Map objs) { + Map allProcessedModels = super.postProcessAllModels(objs); + if(!additionalProperties.containsKey("gsonFactoryMethod")) { + List allModels = new ArrayList(); + for (String name: allProcessedModels.keySet()) { + Map models = (Map)allProcessedModels.get(name); + try { + allModels.add(((List) models.get("models")).get(0)); + } catch (Exception e){ + e.printStackTrace(); + } + } + additionalProperties.put("parent", modelInheritanceSupportInGson(allModels)); + } + return allProcessedModels; + } + @Override public Map postProcessModelsEnum(Map objs) { objs = super.postProcessModelsEnum(objs); @@ -454,6 +473,34 @@ public Map postProcessModelsEnum(Map objs) { return objs; } + private List> modelInheritanceSupportInGson(List allModels) { + LinkedListMultimap byParent = LinkedListMultimap.create(); + for (Object m : allModels) { + Map entry = (Map) m; + CodegenModel parent = ((CodegenModel)entry.get("model")).parentModel; + if(null!= parent) { + byParent.put(parent, ((CodegenModel)entry.get("model"))); + } + } + List> parentsList = new ArrayList<>(); + for (CodegenModel parentModel : byParent.keySet()) { + List> childrenList = new ArrayList<>(); + Map parent = new HashMap<>(); + parent.put("classname", parentModel.classname); + List childrenModels = byParent.get(parentModel); + for (CodegenModel model : childrenModels) { + Map child = new HashMap<>(); + child.put("name", model.name); + child.put("classname", model.classname); + childrenList.add(child); + } + parent.put("children", childrenList); + parent.put("discriminator", parentModel.discriminator); + parentsList.add(parent); + } + return parentsList; + } + public void setUseRxJava(boolean useRxJava) { this.useRxJava = useRxJava; doNotUseRx = false; diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index f0b5f5c8b8a..66d3056e540 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -2,6 +2,7 @@ package {{invokerPackage}}; import com.google.gson.Gson; import com.google.gson.JsonParseException; +import com.google.gson.JsonElement; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.RequestBody; @@ -39,6 +40,7 @@ import java.time.format.DateTimeFormatter; {{/java8}} import java.util.LinkedHashMap; import java.util.Map; +import java.util.HashMap; public class ApiClient { diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache index 9acd505b763..abab9159d79 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache @@ -9,6 +9,9 @@ import com.google.gson.TypeAdapter; import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; {{#joda}} import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -22,6 +25,8 @@ import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; {{/threetenbp}} +import {{modelPackage}}.*; + import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -34,6 +39,8 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; {{/java8}} import java.util.Date; +import java.util.Map; +import java.util.HashMap; public class JSON { private Gson gson; @@ -48,8 +55,45 @@ public class JSON { private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/jsr310}} + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + {{#parent}} + .registerTypeSelector({{classname}}.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + {{#children}} + classByDiscriminatorValue.put("{{name}}".toUpperCase(), {{classname}}.class); + {{/children}} + classByDiscriminatorValue.put("{{classname}}".toUpperCase(), {{classname}}.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "{{discriminator}}")); + } + }) + {{/parent}} + ; + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + public JSON() { - gson = new GsonBuilder() + gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) {{#joda}} 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 aa27f711b02..bc92925ac00 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 @@ -126,6 +126,7 @@ ext { {{#threetenbp}} threetenbp_version = "1.3.5" {{/threetenbp}} + json_fire_version = "1.8.0" } dependencies { @@ -142,6 +143,7 @@ dependencies { {{/useRxJava2}} 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" {{#joda}} compile "joda-time:joda-time:$jodatime_version" {{/joda}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index c070f3a31e3..5d43e1619d3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -45,6 +45,7 @@ lazy val root = (project in file(".")). {{#threetenbp}} "org.threeten" % "threetenbp" % "1.3.5" % "compile", {{/threetenbp}} + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) 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 6cdce584508..e0e4cddd31c 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 @@ -194,6 +194,11 @@ org.apache.oltu.oauth2.client ${oltu-version} + + io.gsonfire + gson-fire + ${gson-fire-version} + {{#joda}} joda-time @@ -300,6 +305,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} + 1.8.0 1.5.15 {{#usePlayWS}} {{#play24}} diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index 9c7f627e48c..be4a7349272 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -99,6 +99,7 @@ ext { swagger_annotations_version = "1.5.15" junit_version = "4.12" threetenbp_version = "1.3.5" + json_fire_version = "1.8.0" } dependencies { @@ -107,6 +108,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" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index de55c31451b..c7b77d03cb8 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -15,6 +15,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/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index c620f9ff6f9..1f8c0e66234 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -194,6 +194,11 @@ org.apache.oltu.oauth2.client ${oltu-version} + + io.gsonfire + gson-fire + ${gson-fire-version} + org.threeten threetenbp @@ -215,6 +220,7 @@ 1.7 ${java.version} ${java.version} + 1.8.0 1.5.15 2.3.0 1.3.5 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java index 9de69dde1e8..d1a5c2102a8 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java @@ -2,6 +2,7 @@ import com.google.gson.Gson; import com.google.gson.JsonParseException; +import com.google.gson.JsonElement; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.RequestBody; @@ -25,6 +26,7 @@ import java.text.DateFormat; import java.util.LinkedHashMap; import java.util.Map; +import java.util.HashMap; public class ApiClient { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java index 590495331b6..aa07fc781cc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/JSON.java @@ -20,10 +20,15 @@ import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; +import io.swagger.client.model.*; + import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -31,6 +36,8 @@ import java.text.ParseException; import java.text.ParsePosition; import java.util.Date; +import java.util.Map; +import java.util.HashMap; public class JSON { private Gson gson; @@ -39,8 +46,42 @@ public class JSON { private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(Animal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class); + classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class); + classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + ; + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + public JSON() { - gson = new GsonBuilder() + gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) From 41b7950dcd8bb51967fb3f14148b2fe62f204efd Mon Sep 17 00:00:00 2001 From: Sasa Vilic Date: Sun, 8 Oct 2017 12:29:48 +0200 Subject: [PATCH 126/197] Fix class path for DeferredResult (#6452) --- .../main/java/io/swagger/codegen/languages/SpringCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java index d801d980e62..918b681d6ed 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java @@ -310,7 +310,7 @@ public void processOpts() { additionalProperties.put(RESPONSE_WRAPPER, "org.springframework.util.concurrent.ListenableFuture"); break; case "DeferredResult": - additionalProperties.put(RESPONSE_WRAPPER, "org.springframework.web.context.request.DeferredResult"); + additionalProperties.put(RESPONSE_WRAPPER, "org.springframework.web.context.request.async.DeferredResult"); break; case "HystrixCommand": additionalProperties.put(RESPONSE_WRAPPER, "com.netflix.hystrix.HystrixCommand"); From 81e0357561381fe9d274e757e01259d56bd2c467 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 8 Oct 2017 18:38:23 +0800 Subject: [PATCH 127/197] fix NPE reported in #6519 (#6635) --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 6ebda3dccc5..39af1118cfc 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 @@ -2739,11 +2739,19 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { } public boolean isDataTypeBinary(String dataType) { - return dataType.toLowerCase().startsWith("byte"); + if (dataType != null) { + return dataType.toLowerCase().startsWith("byte"); + } else { + return false; + } } public boolean isDataTypeFile(String dataType) { - return dataType.toLowerCase().equals("file"); + if (dataType != null) { + return dataType.toLowerCase().equals("file"); + } else { + return false; + } } /** From 164f5bbb72a19cb730830030fb8f110cd5538e80 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Oct 2017 09:28:31 +0800 Subject: [PATCH 128/197] fix underscore to handle spaces (#6637) --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 2 ++ .../test/java/io/swagger/codegen/CodegenTest.java | 12 ++++++++++++ 2 files changed, 14 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 39af1118cfc..2e8b0ebab5b 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 @@ -3035,6 +3035,8 @@ public static String underscore(String word) { word = word.replaceAll(firstPattern, replacementPattern); word = word.replaceAll(secondPattern, replacementPattern); word = word.replace('-', '_'); + // replace space with underscore + word = word.replace(' ', '_'); word = word.toLowerCase(); return word; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index 18acd4757a9..0fae4eac112 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -25,6 +25,18 @@ public void sanitizeTagTest() { Assert.assertEquals(codegen.sanitizeTag("1foo"), "Class1foo"); } + @Test(description = "test underscore") + public void underscoreNamesTest() { + final DefaultCodegen codegen = new DefaultCodegen(); + + Assert.assertEquals(codegen.underscore("foo"), "foo"); + Assert.assertEquals(codegen.underscore("foo-bar"), "foo_bar"); + Assert.assertEquals(codegen.underscore("foo bar"), "foo_bar"); + + Assert.assertEquals(codegen.underscore("FooBar"), "foo_bar"); + Assert.assertEquals(codegen.underscore("FooBarBaz"), "foo_bar_baz"); + } + @Test(description = "test camelize") public void camelizeNamesTest() { final DefaultCodegen codegen = new DefaultCodegen(); From 07c71e342e9dd7543340779b4c14380e8f4c8f06 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Oct 2017 09:39:05 +0800 Subject: [PATCH 129/197] add link to ada's article --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 65b75e632b6..0bd38854f84 100644 --- a/README.md +++ b/README.md @@ -897,6 +897,7 @@ Presentations/Videos/Tutorials/Books - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) - 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) +- 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez) # Swagger Codegen Core Team From e90a40bfced4cba7c7d425aab6928a34a56d4198 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Oct 2017 10:18:46 +0800 Subject: [PATCH 130/197] use japanese name of taxpon --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bd38854f84..3083d29a0d0 100644 --- a/README.md +++ b/README.md @@ -884,7 +884,7 @@ Presentations/Videos/Tutorials/Books - 2017/05/22 - [Automatically generating your API from a swagger file using gradle](https://www.jcore.com/2017/05/22/automatically-generating-api-using-swagger-and-gradle/) by [Deniz Turan](https://www.jcore.com/author/deniz/) - 2017/06/21 - [Swagger Presentation - Warsaw Ruby Users Group](https://www.youtube.com/watch?v=uCnnDMFQB8U) by [@rafalpetryka](http://github.com/rafalpetryka) - 2017/06/29 - [Making SDKs: the bespoke, the hopeful and the generated](https://devrel.net/developer-experience/making-sdks-bespoke-hopeful-generated) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) at DevXcon 2017 -- 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [Takuro Wada](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) +- 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [和田拓朗](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) - 2017/07/29 - [How Square makes its SDKs](https://medium.com/square-corner-blog/how-square-makes-its-sdks-6a0fd7ea4b2d) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) @@ -892,7 +892,7 @@ Presentations/Videos/Tutorials/Books - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/08 - [Swagger Codegen で自動生成したクライアントSDKを使う(iOS編)](http://blog.techium.jp/entry/2017/09/08/071650) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [Swagger Codegen で自動生成したクライアントSDKを使う(RxSwift 編)](http://blog.techium.jp/entry/2017/09/09/113003) by [kfurue](http://profile.hatena.ne.jp/kfurue/) -- 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [taxpon](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) +- 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [和田拓朗](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) From e6d4362012477d8a13a883e297a066fd36a0bf45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Mon, 9 Oct 2017 10:51:32 -0400 Subject: [PATCH 131/197] Fix for regression in issue: https://github.com/swagger-api/swagger-codegen/issues/6472 (#6480) --- .../languages/AbstractJavaCodegen.java | 22 +++++++++++++++++-- .../public/swagger.json | 4 ++-- .../public/swagger.json | 4 ++-- .../public/swagger.json | 4 ++-- .../public/swagger.json | 4 ++-- .../public/swagger.json | 4 ++-- .../java-play-framework/public/swagger.json | 4 ++-- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index e9b6394be00..7c0dd01be58 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -656,7 +656,16 @@ public String toDefaultValue(Property p) { return null; } - return String.format(pattern, getTypeDeclaration(ap.getItems())); + String typeDeclaration = getTypeDeclaration(ap.getItems()); + Object java8obj = additionalProperties.get("java8"); + if (java8obj != null) { + Boolean java8 = Boolean.valueOf(java8obj.toString()); + if (java8 != null && java8) { + typeDeclaration = ""; + } + } + + return String.format(pattern, typeDeclaration); } else if (p instanceof MapProperty) { final MapProperty ap = (MapProperty) p; final String pattern; @@ -669,7 +678,16 @@ public String toDefaultValue(Property p) { return null; } - return String.format(pattern, String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties()))); + String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties())); + Object java8obj = additionalProperties.get("java8"); + if (java8obj != null) { + Boolean java8 = Boolean.valueOf(java8obj.toString()); + if (java8 != null && java8) { + typeDeclaration = ""; + } + } + + return String.format(pattern, typeDeclaration); } else if (p instanceof IntegerProperty) { IntegerProperty dp = (IntegerProperty) p; if (dp.getDefault() != null) { diff --git a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/java-play-framework/public/swagger.json b/samples/server/petstore/java-play-framework/public/swagger.json index 1c7b9a12eba..bf0a7a26545 100644 --- a/samples/server/petstore/java-play-framework/public/swagger.json +++ b/samples/server/petstore/java-play-framework/public/swagger.json @@ -112,8 +112,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], From 3b134319fa428a938eba535d7da0120ad5ce5a6b Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Oct 2017 18:13:57 +0800 Subject: [PATCH 132/197] add java version to pom in resteasy eap java8 --- .../main/resources/JavaJaxRS/resteasy/eap/pom.mustache | 9 +++++++++ .../src/main/resources/JavaJaxRS/resteasy/pom.mustache | 9 +++++++++ samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml | 9 +++++++++ .../eap-java8/src/gen/java/io/swagger/model/Pet.java | 4 ++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index cf8d6807e2c..e87d2c0df14 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -9,6 +9,15 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + + org.apache.maven.plugins maven-war-plugin diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache index 106f78a60f5..7e040124f4e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -9,6 +9,15 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + + org.apache.maven.plugins maven-war-plugin diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index ffcf0f66e70..1edeb42aa1c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -9,6 +9,15 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.8 + 1.8 + + org.apache.maven.plugins maven-war-plugin diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java index 0e258641f27..ce855066266 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/io/swagger/model/Pet.java @@ -19,8 +19,8 @@ public class Pet { private Long id = null; private Category category = null; private String name = null; - private List photoUrls = new ArrayList(); - private List tags = new ArrayList(); + private List photoUrls = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store From d054a43b658e3fee098c43e38eb432fe94fa5be1 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Oct 2017 23:00:44 +0800 Subject: [PATCH 133/197] update java server samples --- .../petstore/jaxrs-cxf-cdi/swagger.json | 6 +- .../java/io/swagger/api/AnotherFakeApi.java | 35 ++++++++ .../api/impl/AnotherFakeApiServiceImpl.java | 27 ++++++ .../io/swagger/api/AnotherFakeApiTest.java | 88 +++++++++++++++++++ .../petstore/jaxrs-resteasy/eap-joda/pom.xml | 9 ++ .../petstore/jaxrs-resteasy/eap/pom.xml | 9 ++ .../jaxrs-spec-interface/swagger.json | 18 ++-- .../server/petstore/jaxrs-spec/swagger.json | 18 ++-- .../java/io/swagger/api/AnotherFakeApi.java | 50 +++++++++++ .../io/swagger/api/AnotherFakeApiService.java | 25 ++++++ .../main/java/io/swagger/api/Bootstrap.java | 2 +- .../AnotherFakeApiServiceFactory.java | 13 +++ .../api/impl/AnotherFakeApiServiceImpl.java | 29 ++++++ .../java/io/swagger/api/AnotherFakeApi.java | 50 +++++++++++ .../io/swagger/api/AnotherFakeApiService.java | 25 ++++++ .../main/java/io/swagger/api/Bootstrap.java | 2 +- .../AnotherFakeApiServiceFactory.java | 13 +++ .../api/impl/AnotherFakeApiServiceImpl.java | 29 ++++++ .../java/io/swagger/api/AnotherFakeApi.java | 69 +++++++++++++++ .../io/swagger/api/AnotherFakeApiService.java | 21 +++++ .../main/java/io/swagger/api/Bootstrap.java | 2 +- .../AnotherFakeApiServiceFactory.java | 13 +++ .../api/impl/AnotherFakeApiServiceImpl.java | 25 ++++++ .../java/io/swagger/api/AnotherFakeApi.java | 69 +++++++++++++++ .../io/swagger/api/AnotherFakeApiService.java | 21 +++++ .../main/java/io/swagger/api/Bootstrap.java | 2 +- .../AnotherFakeApiServiceFactory.java | 13 +++ .../api/impl/AnotherFakeApiServiceImpl.java | 25 ++++++ .../java/io/swagger/api/AnotherFakeApi.java | 44 ++++++++++ .../swagger/api/AnotherFakeApiController.java | 17 ++++ .../SwaggerDocumentationConfig.java | 2 +- .../model/AdditionalPropertiesClass.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../main/java/io/swagger/model/ArrayTest.java | 6 +- .../java/io/swagger/model/EnumArrays.java | 2 +- .../main/java/io/swagger/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/api/AnotherFakeApi.java | 39 ++++++++ .../swagger/api/AnotherFakeApiController.java | 42 +++++++++ .../SwaggerDocumentationConfig.java | 2 +- .../java/io/swagger/api/AnotherFakeApi.java | 39 ++++++++ .../swagger/api/AnotherFakeApiController.java | 42 +++++++++ .../SwaggerDocumentationConfig.java | 2 +- .../java/io/swagger/api/AnotherFakeApi.java | 43 +++++++++ .../swagger/api/AnotherFakeApiController.java | 44 ++++++++++ .../swagger/api/AnotherFakeApiDelegate.java | 28 ++++++ .../SwaggerDocumentationConfig.java | 2 +- .../model/AdditionalPropertiesClass.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../main/java/io/swagger/model/ArrayTest.java | 6 +- .../java/io/swagger/model/EnumArrays.java | 2 +- .../main/java/io/swagger/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/api/AnotherFakeApi.java | 39 ++++++++ .../swagger/api/AnotherFakeApiController.java | 44 ++++++++++ .../swagger/api/AnotherFakeApiDelegate.java | 24 +++++ .../SwaggerDocumentationConfig.java | 2 +- .../java/io/swagger/api/AnotherFakeApi.java | 42 +++++++++ .../swagger/api/AnotherFakeApiController.java | 42 +++++++++ .../SwaggerDocumentationConfig.java | 2 +- .../java/io/swagger/api/AnotherFakeApi.java | 40 +++++++++ .../swagger/api/AnotherFakeApiController.java | 43 +++++++++ .../SwaggerDocumentationConfig.java | 2 +- .../java/io/swagger/api/AnotherFakeApi.java | 39 ++++++++ .../swagger/api/AnotherFakeApiController.java | 42 +++++++++ .../SwaggerDocumentationConfig.java | 2 +- 70 files changed, 1410 insertions(+), 59 deletions(-) create mode 100644 samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApiController.java diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index a16c8a8a14d..46239b84287 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3accd4f023e --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,35 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Path("/") +@Api(value = "/", description = "") +public interface AnotherFakeApi { + + @PATCH + @Path("/another-fake/dummy") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "To test special tags", tags={ "$another-fake?" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Client testSpecialTags(@Valid Client body); +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java new file mode 100644 index 00000000000..5de97453193 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -0,0 +1,27 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.Client; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.model.wadl.Description; +import org.apache.cxf.jaxrs.model.wadl.DocTarget; + +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; + +public class AnotherFakeApiServiceImpl implements AnotherFakeApi { + public Client testSpecialTags(Client body) { + // TODO: Implement... + + return null; + } + +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..85670e19231 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/io/swagger/api/AnotherFakeApiTest.java @@ -0,0 +1,88 @@ +/** + * 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: 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. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package io.swagger.api; + +import io.swagger.model.Client; +import org.junit.Test; +import org.junit.Before; +import static org.junit.Assert.*; + +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.jaxrs.client.ClientConfiguration; +import org.apache.cxf.jaxrs.client.WebClient; + + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + + private AnotherFakeApi api; + + @Before + public void setup() { + JacksonJsonProvider provider = new JacksonJsonProvider(); + List providers = new ArrayList(); + providers.add(provider); + + api = JAXRSClientFactory.create("http://petstore.swagger.io:80/v2", AnotherFakeApi.class, providers); + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); + + ClientConfiguration config = WebClient.getConfig(client); + } + + + /** + * To test special tags + * + * To test special tags + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testSpecialTagsTest() { + Client body = null; + //Client response = api.testSpecialTags(body); + //assertNotNull(response); + // TODO: test validations + + + } + +} diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index bb8a728d7e4..ca2b969d27c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -9,6 +9,15 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + org.apache.maven.plugins maven-war-plugin diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index 05d529c92e0..0fd778a0928 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -9,6 +9,15 @@ src/main/java + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + org.apache.maven.plugins maven-war-plugin diff --git a/samples/server/petstore/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json index 7c2e6c0cc65..6812fe6e0e8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_query_string", diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 7c2e6c0cc65..6812fe6e0e8 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" + "default" : "$", + "enum" : [ ">", "$" ] } }, { "name" : "enum_query_string", diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..a1d379a5bc1 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,50 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.factories.AnotherFakeApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import com.sun.jersey.multipart.FormDataParam; +import javax.validation.constraints.*; + +import io.swagger.model.Client; + +import java.util.Map; +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/AnotherFake") + + +@io.swagger.annotations.Api(description = "the AnotherFake API") + +public class AnotherFakeApi { + private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testSpecialTags( + @ApiParam(value = "client model" ,required=true) Client body, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testSpecialTags(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java new file mode 100644 index 00000000000..eaec0e3e1ae --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -0,0 +1,25 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public abstract class AnotherFakeApiService { + public abstract Response testSpecialTags(Client body,SecurityContext securityContext) + throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/Bootstrap.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/Bootstrap.java index 5e5532439b7..38a037ef487 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/Bootstrap.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/Bootstrap.java @@ -20,7 +20,7 @@ public void init(ServletConfig config) throws ServletException { .contact(new Contact() .email("apiteam@swagger.io")) .license(new License() - .name("Apache 2.0") + .name("Apache-2.0") .url("http://www.apache.org/licenses/LICENSE-2.0.html")); ServletContext context = config.getServletContext(); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java new file mode 100644 index 00000000000..d44d5c06204 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.impl.AnotherFakeApiServiceImpl; + + +public class AnotherFakeApiServiceFactory { + private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl(); + + public static AnotherFakeApiService getAnotherFakeApi() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java new file mode 100644 index 00000000000..072d33568d4 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -0,0 +1,29 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override + public Response testSpecialTags(Client body, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..e6e3cde0650 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,50 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.factories.AnotherFakeApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import com.sun.jersey.multipart.FormDataParam; +import javax.validation.constraints.*; + +import io.swagger.model.Client; + +import java.util.Map; +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; + +@Path("/another-fake") + + +@io.swagger.annotations.Api(description = "the another-fake API") + +public class AnotherFakeApi { + private final AnotherFakeApiService delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + + @PATCH + @Path("/dummy") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?" }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testSpecialTags( + @ApiParam(value = "client model" ,required=true) Client body, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testSpecialTags(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java new file mode 100644 index 00000000000..eaec0e3e1ae --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -0,0 +1,25 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public abstract class AnotherFakeApiService { + public abstract Response testSpecialTags(Client body,SecurityContext securityContext) + throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/Bootstrap.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/Bootstrap.java index 5e5532439b7..38a037ef487 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/Bootstrap.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/Bootstrap.java @@ -20,7 +20,7 @@ public void init(ServletConfig config) throws ServletException { .contact(new Contact() .email("apiteam@swagger.io")) .license(new License() - .name("Apache 2.0") + .name("Apache-2.0") .url("http://www.apache.org/licenses/LICENSE-2.0.html")); ServletContext context = config.getServletContext(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java new file mode 100644 index 00000000000..d44d5c06204 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.impl.AnotherFakeApiServiceImpl; + + +public class AnotherFakeApiServiceFactory { + private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl(); + + public static AnotherFakeApiService getAnotherFakeApi() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java new file mode 100644 index 00000000000..072d33568d4 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -0,0 +1,29 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import com.sun.jersey.multipart.FormDataParam; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override + public Response testSpecialTags(Client body, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..a671d04db60 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.factories.AnotherFakeApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import io.swagger.model.Client; + +import java.util.Map; +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.servlet.ServletConfig; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/AnotherFake") + + +@io.swagger.annotations.Api(description = "the AnotherFake API") + +public class AnotherFakeApi { + private final AnotherFakeApiService delegate; + + public AnotherFakeApi(@Context ServletConfig servletContext) { + AnotherFakeApiService delegate = null; + + if (servletContext != null) { + String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); + if (implClass != null && !"".equals(implClass.trim())) { + try { + delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + if (delegate == null) { + delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + } + + this.delegate = delegate; + } + + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testSpecialTags(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java new file mode 100644 index 00000000000..ca43c203e82 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -0,0 +1,21 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public abstract class AnotherFakeApiService { + public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/Bootstrap.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/Bootstrap.java index 5e5532439b7..38a037ef487 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/Bootstrap.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/Bootstrap.java @@ -20,7 +20,7 @@ public void init(ServletConfig config) throws ServletException { .contact(new Contact() .email("apiteam@swagger.io")) .license(new License() - .name("Apache 2.0") + .name("Apache-2.0") .url("http://www.apache.org/licenses/LICENSE-2.0.html")); ServletContext context = config.getServletContext(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java new file mode 100644 index 00000000000..d44d5c06204 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.impl.AnotherFakeApiServiceImpl; + + +public class AnotherFakeApiServiceFactory { + private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl(); + + public static AnotherFakeApiService getAnotherFakeApi() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java new file mode 100644 index 00000000000..77b9e358572 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -0,0 +1,25 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override + public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..c79af3fc280 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import io.swagger.model.*; +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.factories.AnotherFakeApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import io.swagger.model.Client; + +import java.util.Map; +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.servlet.ServletConfig; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/another-fake") + + +@io.swagger.annotations.Api(description = "the another-fake API") + +public class AnotherFakeApi { + private final AnotherFakeApiService delegate; + + public AnotherFakeApi(@Context ServletConfig servletContext) { + AnotherFakeApiService delegate = null; + + if (servletContext != null) { + String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); + if (implClass != null && !"".equals(implClass.trim())) { + try { + delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + if (delegate == null) { + delegate = AnotherFakeApiServiceFactory.getAnotherFakeApi(); + } + + this.delegate = delegate; + } + + @PATCH + @Path("/dummy") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + public Response testSpecialTags(@ApiParam(value = "client model" ,required=true) Client body +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testSpecialTags(body,securityContext); + } +} diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java new file mode 100644 index 00000000000..ca43c203e82 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/api/AnotherFakeApiService.java @@ -0,0 +1,21 @@ +package io.swagger.api; + +import io.swagger.api.*; +import io.swagger.model.*; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public abstract class AnotherFakeApiService { + public abstract Response testSpecialTags(Client body,SecurityContext securityContext) throws NotFoundException; +} diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/Bootstrap.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/Bootstrap.java index 5e5532439b7..38a037ef487 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/Bootstrap.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/Bootstrap.java @@ -20,7 +20,7 @@ public void init(ServletConfig config) throws ServletException { .contact(new Contact() .email("apiteam@swagger.io")) .license(new License() - .name("Apache 2.0") + .name("Apache-2.0") .url("http://www.apache.org/licenses/LICENSE-2.0.html")); ServletContext context = config.getServletContext(); diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java new file mode 100644 index 00000000000..d44d5c06204 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/factories/AnotherFakeApiServiceFactory.java @@ -0,0 +1,13 @@ +package io.swagger.api.factories; + +import io.swagger.api.AnotherFakeApiService; +import io.swagger.api.impl.AnotherFakeApiServiceImpl; + + +public class AnotherFakeApiServiceFactory { + private final static AnotherFakeApiService service = new AnotherFakeApiServiceImpl(); + + public static AnotherFakeApiService getAnotherFakeApi() { + return service; + } +} diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java new file mode 100644 index 00000000000..77b9e358572 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -0,0 +1,25 @@ +package io.swagger.api.impl; + +import io.swagger.api.*; +import io.swagger.model.*; + +import io.swagger.model.Client; + +import java.util.List; +import io.swagger.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; + +public class AnotherFakeApiServiceImpl extends AnotherFakeApiService { + @Override + public Response testSpecialTags(Client body, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..be61b2ad26e --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,44 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import java.util.concurrent.CompletableFuture; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + default CompletableFuture> testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); + } + +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..82f8a98cfee --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,17 @@ +package io.swagger.api; + +import org.springframework.stereotype.Controller; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 962607f9340..301e80043ba 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 8b927ffc8bf..974cc69fd3a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -33,7 +33,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; @@ -61,7 +61,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f313d21953d..4b4b1ed37c5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 1378caad6e3..83b4b8a89c6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -29,7 +29,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java index 5be7f764aa1..2546bfd53e1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java @@ -37,7 +37,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; @@ -65,7 +65,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; @@ -94,7 +94,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java index b83bdc9f1d0..f9dc285a7db 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java @@ -114,7 +114,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java index 4202d1248e0..c76210a27a3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java @@ -65,7 +65,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; @@ -94,7 +94,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 443db4d4545..160cb38d9dc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,7 +80,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/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java index 2f4545d717a..406db97bb61 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java @@ -31,7 +31,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") @Valid @@ -168,7 +168,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/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3b14b5b65c4 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,39 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..02fe84a126e --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + + if (accept != null && accept.contains("application/json")) { + return new ResponseEntity(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK); + } + + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3b14b5b65c4 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,39 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..02fe84a126e --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + + if (accept != null && accept.contains("application/json")) { + return new ResponseEntity(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK); + } + + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..53bfedb21b8 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,43 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + default ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..b1b9e947700 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,44 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + private final AnotherFakeApiDelegate delegate; + + @org.springframework.beans.factory.annotation.Autowired + public AnotherFakeApiController(AnotherFakeApiDelegate delegate) { + this.delegate = delegate; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + return delegate.testSpecialTags(body); + } + +} diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java new file mode 100644 index 00000000000..2ff944839dc --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java @@ -0,0 +1,28 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * A delegate to be called by the {@link AnotherFakeApiController}}. + * Should be implemented as a controller but without the {@link org.springframework.stereotype.Controller} annotation. + * Instead, use spring to autowire this class into the {@link AnotherFakeApiController}. + */ + +public interface AnotherFakeApiDelegate { + + /** + * @see AnotherFakeApi#testSpecialTags + */ + default ResponseEntity testSpecialTags(Client body) { + // do some magic! + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 962607f9340..301e80043ba 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 8b927ffc8bf..974cc69fd3a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -33,7 +33,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; @@ -61,7 +61,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f313d21953d..4b4b1ed37c5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 1378caad6e3..83b4b8a89c6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -29,7 +29,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java index 5be7f764aa1..2546bfd53e1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java @@ -37,7 +37,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; @@ -65,7 +65,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; @@ -94,7 +94,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java index b83bdc9f1d0..f9dc285a7db 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java @@ -114,7 +114,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java index 4202d1248e0..c76210a27a3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java @@ -65,7 +65,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; @@ -94,7 +94,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 443db4d4545..160cb38d9dc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,7 +80,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/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java index 2f4545d717a..406db97bb61 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java @@ -31,7 +31,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") @Valid @@ -168,7 +168,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/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3b14b5b65c4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,39 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..b1b9e947700 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,44 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + private final AnotherFakeApiDelegate delegate; + + @org.springframework.beans.factory.annotation.Autowired + public AnotherFakeApiController(AnotherFakeApiDelegate delegate) { + this.delegate = delegate; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + return delegate.testSpecialTags(body); + } + +} diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java new file mode 100644 index 00000000000..b2b85be5817 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApiDelegate.java @@ -0,0 +1,24 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * A delegate to be called by the {@link AnotherFakeApiController}}. + * Should be implemented as a controller but without the {@link org.springframework.stereotype.Controller} annotation. + * Instead, use spring to autowire this class into the {@link AnotherFakeApiController}. + */ + +public interface AnotherFakeApiDelegate { + + /** + * @see AnotherFakeApi#testSpecialTags + */ + ResponseEntity testSpecialTags(Client body); + +} diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..d062a2914d4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,42 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @ApiImplicitParams({ + + }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..02fe84a126e --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + + if (accept != null && accept.contains("application/json")) { + return new ResponseEntity(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK); + } + + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..e629a1e2d31 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,40 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import java.util.Optional; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..6868090b4db --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,43 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Optional; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + + if (accept != null && accept.contains("application/json")) { + return new ResponseEntity(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK); + } + + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java new file mode 100644 index 00000000000..3b14b5b65c4 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -0,0 +1,39 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (2.3.0-SNAPSHOT). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; + +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Api(value = "another-fake", description = "the another-fake API") +public interface AnotherFakeApi { + + @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @RequestMapping(value = "/another-fake/dummy", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.PATCH) + ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; + +} diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApiController.java new file mode 100644 index 00000000000..02fe84a126e --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApiController.java @@ -0,0 +1,42 @@ +package io.swagger.api; + +import io.swagger.model.Client; + +import io.swagger.annotations.*; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@Controller +public class AnotherFakeApiController implements AnotherFakeApi { + private final ObjectMapper objectMapper; + + public AnotherFakeApiController(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + public ResponseEntity testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, + @RequestHeader(value = "Accept", required = false) String accept) throws Exception { + // do some magic! + + if (accept != null && accept.contains("application/json")) { + return new ResponseEntity(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK); + } + + return new ResponseEntity(HttpStatus.OK); + } + +} diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 6a7e8c14be1..01bdae11a8e 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -18,7 +18,7 @@ ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") .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: \" \\") - .license("Apache 2.0") + .license("Apache-2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") From 676af621223de2ca77d2e526e291453b5150b631 Mon Sep 17 00:00:00 2001 From: Jihun Lee Date: Tue, 10 Oct 2017 23:41:18 +0900 Subject: [PATCH 134/197] Updated feign library dependency to io.github.openfeign (#6652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed groupId from “com.netflix.feign” to “io.github.openfeign” from gradle and sbt mustache templates. --- .../resources/Java/libraries/feign/build.gradle.mustache | 6 +++--- .../main/resources/Java/libraries/feign/build.sbt.mustache | 6 +++--- samples/client/petstore/java/feign/build.gradle | 6 +++--- samples/client/petstore/java/feign/build.sbt | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache index f9475efb6fd..0074c0e38a2 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -113,9 +113,9 @@ ext { dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "com.netflix.feign:feign-core:$feign_version" - compile "com.netflix.feign:feign-jackson:$feign_version" - compile "com.netflix.feign:feign-slf4j:$feign_version" + compile "io.github.openfeign:feign-core:$feign_version" + compile "io.github.openfeign:feign-jackson:$feign_version" + compile "io.github.openfeign:feign-slf4j:$feign_version" compile "io.github.openfeign.form:feign-form:$feign_form_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache index c2d771961a0..d745ef7e86d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -10,9 +10,9 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.9" % "compile", - "com.netflix.feign" % "feign-core" % "9.4.0" % "compile", - "com.netflix.feign" % "feign-jackson" % "9.4.0" % "compile", - "com.netflix.feign" % "feign-slf4j" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-core" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.7" % "compile", diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 2a538aa20a4..bacb0517115 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -105,9 +105,9 @@ ext { dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "com.netflix.feign:feign-core:$feign_version" - compile "com.netflix.feign:feign-jackson:$feign_version" - compile "com.netflix.feign:feign-slf4j:$feign_version" + compile "io.github.openfeign:feign-core:$feign_version" + compile "io.github.openfeign:feign-jackson:$feign_version" + compile "io.github.openfeign:feign-slf4j:$feign_version" compile "io.github.openfeign.form:feign-form:$feign_form_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 3037da434d8..fac8ce229a7 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -10,9 +10,9 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.9" % "compile", - "com.netflix.feign" % "feign-core" % "9.4.0" % "compile", - "com.netflix.feign" % "feign-jackson" % "9.4.0" % "compile", - "com.netflix.feign" % "feign-slf4j" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-core" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile", + "io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.7" % "compile", From 1bdb1047383879d845a9c27890c9476ffb2fcdfd Mon Sep 17 00:00:00 2001 From: Graham Johnson Date: Tue, 10 Oct 2017 08:45:47 -0600 Subject: [PATCH 135/197] Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) --- bin/jaxrs-spec-petstore-server-interface.sh | 1 + bin/jaxrs-spec-petstore-server.sh | 3 ++- .../main/resources/JavaJaxRS/spec/model.mustache | 3 +++ .../gen/java/io/swagger/api/RestApplication.java | 9 +++++++++ .../swagger/model/AdditionalPropertiesClass.java | 3 ++- .../src/gen/java/io/swagger/model/Animal.java | 3 ++- .../gen/java/io/swagger/model/AnimalFarm.java | 3 ++- .../swagger/model/ArrayOfArrayOfNumberOnly.java | 3 ++- .../java/io/swagger/model/ArrayOfNumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/ArrayTest.java | 3 ++- .../java/io/swagger/model/Capitalization.java | 3 ++- .../src/gen/java/io/swagger/model/Cat.java | 3 ++- .../src/gen/java/io/swagger/model/Category.java | 3 ++- .../gen/java/io/swagger/model/ClassModel.java | 3 ++- .../src/gen/java/io/swagger/model/Client.java | 3 ++- .../src/gen/java/io/swagger/model/Dog.java | 3 ++- .../gen/java/io/swagger/model/EnumArrays.java | 3 ++- .../src/gen/java/io/swagger/model/EnumClass.java | 1 + .../src/gen/java/io/swagger/model/EnumTest.java | 3 ++- .../gen/java/io/swagger/model/FormatTest.java | 3 ++- .../java/io/swagger/model/HasOnlyReadOnly.java | 3 ++- .../src/gen/java/io/swagger/model/MapTest.java | 3 ++- ...edPropertiesAndAdditionalPropertiesClass.java | 3 ++- .../java/io/swagger/model/Model200Response.java | 3 ++- .../java/io/swagger/model/ModelApiResponse.java | 3 ++- .../gen/java/io/swagger/model/ModelReturn.java | 3 ++- .../src/gen/java/io/swagger/model/Name.java | 3 ++- .../gen/java/io/swagger/model/NumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/Order.java | 3 ++- .../java/io/swagger/model/OuterComposite.java | 3 ++- .../src/gen/java/io/swagger/model/OuterEnum.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 ++- .../gen/java/io/swagger/model/ReadOnlyFirst.java | 3 ++- .../java/io/swagger/model/SpecialModelName.java | 3 ++- .../src/gen/java/io/swagger/model/Tag.java | 3 ++- .../src/gen/java/io/swagger/model/User.java | 3 ++- .../petstore/jaxrs-spec-interface/swagger.json | 16 ++++++++-------- .../swagger/model/AdditionalPropertiesClass.java | 3 ++- .../src/gen/java/io/swagger/model/Animal.java | 3 ++- .../gen/java/io/swagger/model/AnimalFarm.java | 3 ++- .../swagger/model/ArrayOfArrayOfNumberOnly.java | 3 ++- .../java/io/swagger/model/ArrayOfNumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/ArrayTest.java | 3 ++- .../java/io/swagger/model/Capitalization.java | 3 ++- .../src/gen/java/io/swagger/model/Cat.java | 3 ++- .../src/gen/java/io/swagger/model/Category.java | 3 ++- .../gen/java/io/swagger/model/ClassModel.java | 3 ++- .../src/gen/java/io/swagger/model/Client.java | 3 ++- .../src/gen/java/io/swagger/model/Dog.java | 3 ++- .../gen/java/io/swagger/model/EnumArrays.java | 3 ++- .../src/gen/java/io/swagger/model/EnumClass.java | 1 + .../src/gen/java/io/swagger/model/EnumTest.java | 3 ++- .../gen/java/io/swagger/model/FormatTest.java | 3 ++- .../java/io/swagger/model/HasOnlyReadOnly.java | 3 ++- .../src/gen/java/io/swagger/model/MapTest.java | 3 ++- ...edPropertiesAndAdditionalPropertiesClass.java | 3 ++- .../java/io/swagger/model/Model200Response.java | 3 ++- .../java/io/swagger/model/ModelApiResponse.java | 3 ++- .../gen/java/io/swagger/model/ModelReturn.java | 3 ++- .../src/gen/java/io/swagger/model/Name.java | 3 ++- .../gen/java/io/swagger/model/NumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/Order.java | 3 ++- .../java/io/swagger/model/OuterComposite.java | 3 ++- .../src/gen/java/io/swagger/model/OuterEnum.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 ++- .../gen/java/io/swagger/model/ReadOnlyFirst.java | 3 ++- .../java/io/swagger/model/SpecialModelName.java | 3 ++- .../src/gen/java/io/swagger/model/Tag.java | 3 ++- .../src/gen/java/io/swagger/model/User.java | 3 ++- samples/server/petstore/jaxrs-spec/swagger.json | 16 ++++++++-------- 70 files changed, 155 insertions(+), 77 deletions(-) create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java diff --git a/bin/jaxrs-spec-petstore-server-interface.sh b/bin/jaxrs-spec-petstore-server-interface.sh index 3b28a0972f5..d47718f2788 100755 --- a/bin/jaxrs-spec-petstore-server-interface.sh +++ b/bin/jaxrs-spec-petstore-server-interface.sh @@ -28,6 +28,7 @@ fi 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples/server/petstore/jaxrs-spec-interface -DhideGenerationTimestamp=true +-DserializableModel=true -DinterfaceOnly=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server.sh b/bin/jaxrs-spec-petstore-server.sh index 9482e1a8972..5350bab881c 100755 --- a/bin/jaxrs-spec-petstore-server.sh +++ b/bin/jaxrs-spec-petstore-server.sh @@ -27,6 +27,7 @@ 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-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples/server/petstore/jaxrs-spec --DhideGenerationTimestamp=true" +-DhideGenerationTimestamp=true +-DserializableModel=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache index 6dd72bcb4e9..3fb7e3cfb9d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache @@ -2,6 +2,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} {{#useBeanValidation}} import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java new file mode 100644 index 00000000000..2561172aea9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java @@ -0,0 +1,9 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 17c61771f7c..820bb4a2f18 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java index cc18f7fa3a5..f7aef656d44 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import java.util.Objects; -public class Animal { +public class Animal implements Serializable { private @Valid String className = null; private @Valid String color = "red"; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java index a730cb5ffc7..ca03cafd3ef 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,6 +3,7 @@ import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList implements Serializable { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 874660a2ef0..558c55d50e1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,6 +3,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 2a3980fbd37..780c9bf0df8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,6 +3,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java index ec75158891a..f6ef76af0d6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,6 +3,7 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayTest { +public class ArrayTest implements Serializable { private @Valid List arrayOfString = new ArrayList(); private @Valid List> arrayArrayOfInteger = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java index 25bbfd84e38..385c622b0ba 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Capitalization { +public class Capitalization implements Serializable { private @Valid String smallCamel = null; private @Valid String capitalCamel = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java index fc259678da3..f334fcd1914 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Cat extends Animal { +public class Cat extends Animal implements Serializable { private @Valid Boolean declawed = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java index df544c396db..5cee21d0404 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Category { +public class Category implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java index ec28d98861d..faa4cf796cb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model with \"_class\" property") -public class ClassModel { +public class ClassModel implements Serializable { private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java index 57bcea24a47..55a8b4e31c0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Client { +public class Client implements Serializable { private @Valid String client = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java index 529d49d8ce2..e55012815c2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Dog extends Animal { +public class Dog extends Animal implements Serializable { private @Valid String breed = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java index a3bbcc6cd6b..afb80283457 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import java.util.Objects; -public class EnumArrays { +public class EnumArrays implements Serializable { public enum JustSymbolEnum { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java index 4b694360886..13cf0a338e7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java index 4f7283cdbf3..277fcf88e8d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.OuterEnum; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class EnumTest { +public class EnumTest implements Serializable { public enum EnumStringEnum { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java index faead8afb01..64d0e10f9a1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; -public class FormatTest { +public class FormatTest implements Serializable { private @Valid Integer integer = null; private @Valid Integer int32 = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index c07f245e60a..bef66ba21ee 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class HasOnlyReadOnly { +public class HasOnlyReadOnly implements Serializable { private @Valid String bar = null; private @Valid String foo = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java index 638058f9216..ff256f599d4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class MapTest { +public class MapTest implements Serializable { private @Valid Map> mapMapOfString = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0b277958156..d72ca2af084 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -14,7 +15,7 @@ import java.util.Objects; -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid = null; private @Valid Date dateTime = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java index 53d4313dfd1..aedda176fb2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response implements Serializable { private @Valid Integer name = null; private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java index b21d4f89017..da860040d95 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class ModelApiResponse { +public class ModelApiResponse implements Serializable { private @Valid Integer code = null; private @Valid String type = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java index 3e77fb415c7..1e17a101c64 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn implements Serializable { private @Valid Integer _return = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java index 775320ca04f..1c189b6e01d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name implements Serializable { private @Valid Integer name = null; private @Valid Integer snakeCase = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java index 631daa797cc..edff615a50d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class NumberOnly { +public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java index 344d5055c08..d7042477807 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.util.Date; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Order { +public class Order implements Serializable { private @Valid Long id = null; private @Valid Long petId = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java index 28aa1476f3d..c038e105892 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class OuterComposite { +public class OuterComposite implements Serializable { private @Valid BigDecimal myNumber = null; private @Valid String myString = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java index eb4b2679ebe..d682c3f5080 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java index cd025d3bc8b..5bad5ba12d6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java @@ -4,6 +4,7 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; -public class Pet { +public class Pet implements Serializable { private @Valid Long id = null; private @Valid Category category = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 115bbdef056..0617b6904ea 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class ReadOnlyFirst { +public class ReadOnlyFirst implements Serializable { private @Valid String bar = null; private @Valid String baz = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java index 08fe6d01869..9afe1f14834 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class SpecialModelName { +public class SpecialModelName implements Serializable { private @Valid Long specialPropertyName = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java index bd9f74287cd..35c70dd8bbd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Tag { +public class Tag implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java index c872137dcad..ad92725cb41 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class User { +public class User implements Serializable { private @Valid Long id = null; private @Valid String username = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json index 6812fe6e0e8..5b53d7108d0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 17c61771f7c..820bb4a2f18 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java index cc18f7fa3a5..f7aef656d44 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import java.util.Objects; -public class Animal { +public class Animal implements Serializable { private @Valid String className = null; private @Valid String color = "red"; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java index a730cb5ffc7..ca03cafd3ef 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,6 +3,7 @@ import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList implements Serializable { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 874660a2ef0..558c55d50e1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,6 +3,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 2a3980fbd37..780c9bf0df8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,6 +3,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java index ec75158891a..f6ef76af0d6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,6 +3,7 @@ import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class ArrayTest { +public class ArrayTest implements Serializable { private @Valid List arrayOfString = new ArrayList(); private @Valid List> arrayArrayOfInteger = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java index 25bbfd84e38..385c622b0ba 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Capitalization { +public class Capitalization implements Serializable { private @Valid String smallCamel = null; private @Valid String capitalCamel = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index fc259678da3..f334fcd1914 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Cat extends Animal { +public class Cat extends Animal implements Serializable { private @Valid Boolean declawed = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java index df544c396db..5cee21d0404 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Category { +public class Category implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java index ec28d98861d..faa4cf796cb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model with \"_class\" property") -public class ClassModel { +public class ClassModel implements Serializable { private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java index 57bcea24a47..55a8b4e31c0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Client { +public class Client implements Serializable { private @Valid String client = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java index 529d49d8ce2..e55012815c2 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Dog extends Animal { +public class Dog extends Animal implements Serializable { private @Valid String breed = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index a3bbcc6cd6b..afb80283457 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import java.util.Objects; -public class EnumArrays { +public class EnumArrays implements Serializable { public enum JustSymbolEnum { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java index 4b694360886..13cf0a338e7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index 4f7283cdbf3..277fcf88e8d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.OuterEnum; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class EnumTest { +public class EnumTest implements Serializable { public enum EnumStringEnum { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index faead8afb01..64d0e10f9a1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; -public class FormatTest { +public class FormatTest implements Serializable { private @Valid Integer integer = null; private @Valid Integer int32 = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index c07f245e60a..bef66ba21ee 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class HasOnlyReadOnly { +public class HasOnlyReadOnly implements Serializable { private @Valid String bar = null; private @Valid String foo = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 638058f9216..ff256f599d4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -3,6 +3,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import java.util.Objects; -public class MapTest { +public class MapTest implements Serializable { private @Valid Map> mapMapOfString = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0b277958156..d72ca2af084 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -14,7 +15,7 @@ import java.util.Objects; -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid = null; private @Valid Date dateTime = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java index 53d4313dfd1..aedda176fb2 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response implements Serializable { private @Valid Integer name = null; private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java index b21d4f89017..da860040d95 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class ModelApiResponse { +public class ModelApiResponse implements Serializable { private @Valid Integer code = null; private @Valid String type = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java index 3e77fb415c7..1e17a101c64 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn implements Serializable { private @Valid Integer _return = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java index 775320ca04f..1c189b6e01d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name implements Serializable { private @Valid Integer name = null; private @Valid Integer snakeCase = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java index 631daa797cc..edff615a50d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class NumberOnly { +public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index 344d5055c08..d7042477807 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.util.Date; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class Order { +public class Order implements Serializable { private @Valid Long id = null; private @Valid Long petId = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java index 28aa1476f3d..c038e105892 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import java.util.Objects; -public class OuterComposite { +public class OuterComposite implements Serializable { private @Valid BigDecimal myNumber = null; private @Valid String myString = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java index eb4b2679ebe..d682c3f5080 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index cd025d3bc8b..5bad5ba12d6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -4,6 +4,7 @@ import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import java.util.Objects; -public class Pet { +public class Pet implements Serializable { private @Valid Long id = null; private @Valid Category category = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 115bbdef056..0617b6904ea 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class ReadOnlyFirst { +public class ReadOnlyFirst implements Serializable { private @Valid String bar = null; private @Valid String baz = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java index 08fe6d01869..9afe1f14834 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class SpecialModelName { +public class SpecialModelName implements Serializable { private @Valid Long specialPropertyName = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java index bd9f74287cd..35c70dd8bbd 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class Tag { +public class Tag implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java index c872137dcad..ad92725cb41 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import java.util.Objects; -public class User { +public class User implements Serializable { private @Valid Long id = null; private @Valid String username = null; diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 6812fe6e0e8..5b53d7108d0 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", From 02d25f5a14e801b6d7961939778c3275e2d44df9 Mon Sep 17 00:00:00 2001 From: ehyche Date: Tue, 10 Oct 2017 10:53:17 -0400 Subject: [PATCH 136/197] Swift4: Fix inline enum issue (#6640) * Add addiitional files from upstream * Remove mis-added files * Fix compilation issue with Swift4 inline enums. This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6607 The problem was that I was using "datatype" instead of "datatypeWithEnum" in the model.mustache file. When you have a the following model property: "myInlineStringEnum": { "type": "string", "enum": [ "inlineStringEnumValue1", "inlineStringEnumValue2", "inlineStringEnumValue3" ] } Then we were generating: public enum MyInlineStringEnum: String, Codable { case inlinestringenumvalue1 = "inlineStringEnumValue1" case inlinestringenumvalue2 = "inlineStringEnumValue2" case inlinestringenumvalue3 = "inlineStringEnumValue3" } However, when we decode this, we were using type of the enum ("datatype") rather than the enum type itself ("datatypeWithEnum"). So we were generating: myInlineStringEnum = try container.decodeIfPresent(String.self, forKey: "myInlineStringEnum") rather than: myInlineStringEnum = try container.decodeIfPresent(MyInlineStringEnum.self, forKey: "myInlineStringEnum") --- .../src/main/resources/swift4/model.mustache | 4 +- .../src/test/resources/2_0/swift4Test.json | 8 ++++ .../Classes/Swaggers/APIs/Swift4TestAPI.swift | 45 ++++++++++--------- .../Swaggers/Models/AllPrimitives.swift | 10 ++++- .../Classes/Swaggers/Models/ErrorInfo.swift | 2 +- .../Swaggers/Models/GetAllModelsResult.swift | 2 +- ...ModelWithIntAdditionalPropertiesOnly.swift | 2 +- ...ithPropertiesAndAdditionalProperties.swift | 2 +- ...elWithStringAdditionalPropertiesOnly.swift | 2 +- .../Swaggers/Models/VariableNameTest.swift | 2 +- 10 files changed, 49 insertions(+), 30 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swift4/model.mustache b/modules/swagger-codegen/src/main/resources/swift4/model.mustache index 9dedcc85d39..383b229e447 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/model.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/model.mustache @@ -79,12 +79,12 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{ } // Decodable protocol methods - + public {{#parent}}override {{/parent}}required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) {{#vars}} - {{name}} = try container.decode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{#isListContainer}}{{{items.datatype}}}{{/isListContainer}}{{^isListContainer}}{{{datatype}}}{{/isListContainer}}.self, forKey: "{{{baseName}}}") + {{name}} = try container.decode{{#isListContainer}}Array{{/isListContainer}}{{^required}}IfPresent{{/required}}({{#isListContainer}}{{{items.datatype}}}{{/isListContainer}}{{^isListContainer}}{{{datatypeWithEnum}}}{{/isListContainer}}.self, forKey: "{{{baseName}}}") {{/vars}} {{#additionalPropertiesType}} var nonAdditionalPropertyKeys = Set() diff --git a/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json b/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json index cb13dfccb99..d9de56b3d1a 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json +++ b/modules/swagger-codegen/src/test/resources/2_0/swift4Test.json @@ -220,6 +220,14 @@ "items": { "$ref": "#/definitions/StringEnum" } + }, + "myInlineStringEnum": { + "type": "string", + "enum": [ + "inlineStringEnumValue1", + "inlineStringEnumValue2", + "inlineStringEnumValue3" + ] } }, "description": "Object which contains lots of different primitive Swagger types" diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift index 1ea35e3db1f..5e657469a25 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/APIs/Swift4TestAPI.swift @@ -33,26 +33,27 @@ open class Swift4TestAPI { "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], "myStringArray" : [ "myStringArray", "myStringArray" ], "myFile" : "", - "myFloatArray" : [ 2.302136, 2.302136 ], "myBytes" : "myBytes", "myLong" : 1, "myBooleanArray" : [ true, true ], - "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], "myInteger" : 0, - "myString" : "myString", "myBytesArray" : [ "myBytesArray", "myBytesArray" ], "myDouble" : 7.061401241503109, + "myIntegerArray" : [ 6, 6 ], + "myInlineStringEnum" : "inlineStringEnumValue1", + "myFileArray" : [ "", "" ], + "myFloat" : 5.637377, + "myStringEnumArray" : [ null, null ], + "myFloatArray" : [ 2.302136, 2.302136 ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], + "myString" : "myString", "myDate" : "2000-01-23", "myDateArray" : [ "2000-01-23", "2000-01-23" ], "myDateTime" : "2000-01-23T04:56:07.000+00:00", "myLongArray" : [ 5, 5 ], - "myIntegerArray" : [ 6, 6 ], "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "myBoolean" : true, - "myFileArray" : [ "", "" ], "myStringEnum" : { }, - "myFloat" : 5.637377, - "myStringEnumArray" : [ null, null ], "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] }, "myVariableNameTest" : { @@ -63,51 +64,53 @@ open class Swift4TestAPI { "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], "myStringArray" : [ "myStringArray", "myStringArray" ], "myFile" : "", - "myFloatArray" : [ 2.302136, 2.302136 ], "myBytes" : "myBytes", "myLong" : 1, "myBooleanArray" : [ true, true ], - "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], "myInteger" : 0, - "myString" : "myString", "myBytesArray" : [ "myBytesArray", "myBytesArray" ], "myDouble" : 7.061401241503109, + "myIntegerArray" : [ 6, 6 ], + "myInlineStringEnum" : "inlineStringEnumValue1", + "myFileArray" : [ "", "" ], + "myFloat" : 5.637377, + "myStringEnumArray" : [ null, null ], + "myFloatArray" : [ 2.302136, 2.302136 ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], + "myString" : "myString", "myDate" : "2000-01-23", "myDateArray" : [ "2000-01-23", "2000-01-23" ], "myDateTime" : "2000-01-23T04:56:07.000+00:00", "myLongArray" : [ 5, 5 ], - "myIntegerArray" : [ 6, 6 ], "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "myBoolean" : true, - "myFileArray" : [ "", "" ], "myStringEnum" : { }, - "myFloat" : 5.637377, - "myStringEnumArray" : [ null, null ], "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] }, { "myDateTimeArray" : [ "2000-01-23T04:56:07.000+00:00", "2000-01-23T04:56:07.000+00:00" ], "myStringArray" : [ "myStringArray", "myStringArray" ], "myFile" : "", - "myFloatArray" : [ 2.302136, 2.302136 ], "myBytes" : "myBytes", "myLong" : 1, "myBooleanArray" : [ true, true ], - "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], "myInteger" : 0, - "myString" : "myString", "myBytesArray" : [ "myBytesArray", "myBytesArray" ], "myDouble" : 7.061401241503109, + "myIntegerArray" : [ 6, 6 ], + "myInlineStringEnum" : "inlineStringEnumValue1", + "myFileArray" : [ "", "" ], + "myFloat" : 5.637377, + "myStringEnumArray" : [ null, null ], + "myFloatArray" : [ 2.302136, 2.302136 ], + "myDoubleArray" : [ 9.301444243932576, 9.301444243932576 ], + "myString" : "myString", "myDate" : "2000-01-23", "myDateArray" : [ "2000-01-23", "2000-01-23" ], "myDateTime" : "2000-01-23T04:56:07.000+00:00", "myLongArray" : [ 5, 5 ], - "myIntegerArray" : [ 6, 6 ], "myUUID" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "myBoolean" : true, - "myFileArray" : [ "", "" ], "myStringEnum" : { }, - "myFloat" : 5.637377, - "myStringEnumArray" : [ null, null ], "myUUIDArray" : [ "046b6c7f-0b8a-43b9-b35d-6489e6daee91", "046b6c7f-0b8a-43b9-b35d-6489e6daee91" ] } ] }}] diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift index 6d0bf4eca18..3ad6c11c2fb 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift @@ -12,6 +12,11 @@ import Foundation open class AllPrimitives: Codable { + public enum MyInlineStringEnum: String, Codable { + case inlinestringenumvalue1 = "inlineStringEnumValue1" + case inlinestringenumvalue2 = "inlineStringEnumValue2" + case inlinestringenumvalue3 = "inlineStringEnumValue3" + } public var myInteger: Int? public var myIntegerArray: [Int]? public var myLong: Int64? @@ -36,6 +41,7 @@ open class AllPrimitives: Codable { public var myUUIDArray: [UUID]? public var myStringEnum: StringEnum? public var myStringEnumArray: [StringEnum]? + public var myInlineStringEnum: MyInlineStringEnum? // Encodable protocol methods @@ -68,10 +74,11 @@ open class AllPrimitives: Codable { try container.encodeArrayIfPresent(myUUIDArray, forKey: "myUUIDArray") try container.encodeIfPresent(myStringEnum, forKey: "myStringEnum") try container.encodeArrayIfPresent(myStringEnumArray, forKey: "myStringEnumArray") + try container.encodeIfPresent(myInlineStringEnum, forKey: "myInlineStringEnum") } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) @@ -99,6 +106,7 @@ open class AllPrimitives: Codable { myUUIDArray = try container.decodeArrayIfPresent(UUID.self, forKey: "myUUIDArray") myStringEnum = try container.decodeIfPresent(StringEnum.self, forKey: "myStringEnum") myStringEnumArray = try container.decodeArrayIfPresent(StringEnum.self, forKey: "myStringEnumArray") + myInlineStringEnum = try container.decodeIfPresent(MyInlineStringEnum.self, forKey: "myInlineStringEnum") } } diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift index b4713b4c23d..c313ada307f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift @@ -29,7 +29,7 @@ open class ErrorInfo: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift index 6cb8e4ce7d7..9708ce78e06 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift @@ -29,7 +29,7 @@ open class GetAllModelsResult: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift index c258745d8e9..25392820511 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -38,7 +38,7 @@ open class ModelWithIntAdditionalPropertiesOnly: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift index f4aae6cc5e0..67f73da1bd0 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -54,7 +54,7 @@ open class ModelWithPropertiesAndAdditionalProperties: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift index dba82ff7f08..47ad742ae32 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -38,7 +38,7 @@ open class ModelWithStringAdditionalPropertiesOnly: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift index 470de98387e..d2ec9840a37 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift @@ -29,7 +29,7 @@ open class VariableNameTest: Codable { } // Decodable protocol methods - + public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) From dc88ed99aed818a2c2f4bc13e00a4125ef63931e Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Tue, 10 Oct 2017 16:55:50 +0200 Subject: [PATCH 137/197] [angular-typescript] fix using form data (#6574) * #6457: fix sending form params * #6457: fix sending form params using files * #6457: fix sending form params with files for angular 4.3 * #6457: generate samples * #6457: [typescript-angular] fix form data submission in IE/Edge * re-apply [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334) * adapt for HttpClient: [typescript-angular] add customized encoder to use '+' char in query parameter #6306 (#6334) * generate samples * #6457: fix url parameter encoder imports for angular <4.3 * #6457: generate samples --- ...pescript-angular-v4.3-petstore-with-npm.sh | 0 .../typescript-angular-v4.3-with-npm.bat | 10 +++ .../typescript-angular/api.service.mustache | 55 ++++++++++---- .../typescript-angular/encoder.mustache | 29 +++++++- .../default/api/pet.service.ts | 63 ++++++++++------ .../default/api/store.service.ts | 5 -- .../default/api/user.service.ts | 7 +- .../typescript-angular-v2/default/encoder.ts | 5 +- .../npm/api/pet.service.ts | 63 ++++++++++------ .../npm/api/store.service.ts | 5 -- .../npm/api/user.service.ts | 7 +- .../typescript-angular-v2/npm/encoder.ts | 5 +- .../with-interfaces/api/pet.service.ts | 63 ++++++++++------ .../with-interfaces/api/store.service.ts | 5 -- .../with-interfaces/api/user.service.ts | 7 +- .../with-interfaces/encoder.ts | 5 +- .../npm/api/pet.service.ts | 73 +++++++++++++------ .../npm/api/store.service.ts | 15 ++-- .../npm/api/user.service.ts | 29 +++++--- .../typescript-angular-v4.3/npm/encoder.ts | 9 ++- .../npm/api/pet.service.ts | 63 ++++++++++------ .../npm/api/store.service.ts | 5 -- .../npm/api/user.service.ts | 7 +- .../typescript-angular-v4/npm/encoder.ts | 5 +- 24 files changed, 345 insertions(+), 195 deletions(-) mode change 100644 => 100755 bin/typescript-angular-v4.3-petstore-with-npm.sh create mode 100644 bin/windows/typescript-angular-v4.3-with-npm.bat diff --git a/bin/typescript-angular-v4.3-petstore-with-npm.sh b/bin/typescript-angular-v4.3-petstore-with-npm.sh old mode 100644 new mode 100755 diff --git a/bin/windows/typescript-angular-v4.3-with-npm.bat b/bin/windows/typescript-angular-v4.3-with-npm.bat new file mode 100644 index 00000000000..5ad1cbd9b2d --- /dev/null +++ b/bin/windows/typescript-angular-v4.3-with-npm.bat @@ -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 -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -l typescript-angular -o samples\client\petstore\typescript-angular-v4.3\npm --additional-properties ngVersion=4.3 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 56e0e67dce8..ea2b19b7885 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -20,7 +20,12 @@ import { {{classname}} } from '../{{filename}}'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +{{#useHttpClient}} +import { CustomHttpUrlEncodingCodec } from '../encoder'; +{{/useHttpClient}} +{{^useHttpClient}} import { CustomQueryEncoderHelper } from '../encoder'; +{{/useHttpClient}} {{#withInterfaces}} import { {{classname}}Interface } from './{{classname}}Interface'; {{/withInterfaces}} @@ -69,11 +74,6 @@ export class {{classname}} { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - {{^useHttpClient}} {{! not sure why we used to generate a second method here rather than inlining those few lines of code, but let's keep it for now for the sake of backwards compatiblity. }} @@ -121,7 +121,12 @@ export class {{classname}} { {{/allParams}} {{#hasQueryParams}} - let queryParameters = new {{#useHttpClient}}HttpParams{{/useHttpClient}}{{^useHttpClient}}URLSearchParams{{/useHttpClient}}(); + {{#useHttpClient}} + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + {{/useHttpClient}} + {{^useHttpClient}} + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); + {{/useHttpClient}} {{#queryParams}} {{#isListContainer}} if ({{paramName}}) { @@ -207,39 +212,59 @@ export class {{classname}} { '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/consumes}} ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; {{#formParams}} {{#isFile}} + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; {{/isFile}} {{/formParams}} - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { +{{#useHttpClient}} + formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); +{{/useHttpClient}} +{{^useHttpClient}} + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); +{{/useHttpClient}} + } + + + {{#formParams}} {{#isListContainer}} if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - formParams.append('{{baseName}}', element); + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', element){{#useHttpClient}} || formParams{{/useHttpClient}}; }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formParams.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])){{#useHttpClient}} || formParams{{/useHttpClient}}; {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - formParams.set('{{baseName}}', {{paramName}}); + {{#useHttpClient}}formParams = {{/useHttpClient}}formParams.append('{{baseName}}', {{paramName}}){{#useHttpClient}} || formParams{{/useHttpClient}}; } {{/isListContainer}} {{/formParams}} {{/hasFormParams}} {{#useHttpClient}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#bodyParam}}{{paramName}}, {{/bodyParam}}{{#hasFormParams}}formParams, {{/hasFormParams}}{ + return this.httpClient.{{httpMethod}}{{^isResponseFile}}{{/isResponseFile}}(`${this.basePath}{{{path}}}`, {{#bodyParam}}{{paramName}}, {{/bodyParam}} + {{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams, {{/hasFormParams}}{ {{#hasQueryParams}} params: queryParameters, {{/hasQueryParams}} @@ -258,7 +283,7 @@ export class {{classname}} { body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612 {{/bodyParam}} {{#hasFormParams}} - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, {{/hasFormParams}} {{#isResponseFile}} responseType: ResponseContentType.Blob, diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/encoder.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/encoder.mustache index 319f79da15a..c3ac784124a 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/encoder.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/encoder.mustache @@ -1,5 +1,28 @@ -import { QueryEncoder } from "@angular/http"; +{{#useHttpClient}} + import { HttpUrlEncodingCodec } from '@angular/common/http'; +{{/useHttpClient}} +{{^useHttpClient}} + import { QueryEncoder } from '@angular/http'; +{{/useHttpClient}} +{{#useHttpClient}} +/** +* CustomHttpUrlEncodingCodec +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} +{{/useHttpClient}} +{{^useHttpClient}} /** * CustomQueryEncoderHelper * Fix plus sign (+) not encoding, so sent as blank space @@ -14,4 +37,6 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} +{{/useHttpClient}} + diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 481f693424e..11a1b603831 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -60,11 +60,6 @@ export class PetService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * * @summary Add a new pet to the store @@ -282,7 +277,7 @@ export class PetService { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } @@ -321,7 +316,7 @@ export class PetService { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } @@ -442,22 +437,34 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (name !== undefined) { - formParams.set('name', name); + formParams.append('name', name); } if (status !== undefined) { - formParams.set('status', status); + formParams.append('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -494,23 +501,37 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams.append('additionalMetadata', additionalMetadata); } if (file !== undefined) { - formParams.set('file', file); + formParams.append('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index fba4c08d9aa..393d291ba3d 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -59,11 +59,6 @@ export class StoreService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index d7c9ee1510a..f495f1f9d39 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -59,11 +59,6 @@ export class UserService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * This can only be done by the logged in user. * @summary Create user @@ -342,7 +337,7 @@ export class UserService { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (username !== undefined) { queryParameters.set('username', username); } diff --git a/samples/client/petstore/typescript-angular-v2/default/encoder.ts b/samples/client/petstore/typescript-angular-v2/default/encoder.ts index 319f79da15a..6fcda7b246d 100644 --- a/samples/client/petstore/typescript-angular-v2/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/default/encoder.ts @@ -1,4 +1,4 @@ -import { QueryEncoder } from "@angular/http"; + import { QueryEncoder } from '@angular/http'; /** * CustomQueryEncoderHelper @@ -14,4 +14,5 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} + diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 481f693424e..11a1b603831 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -60,11 +60,6 @@ export class PetService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * * @summary Add a new pet to the store @@ -282,7 +277,7 @@ export class PetService { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } @@ -321,7 +316,7 @@ export class PetService { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } @@ -442,22 +437,34 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (name !== undefined) { - formParams.set('name', name); + formParams.append('name', name); } if (status !== undefined) { - formParams.set('status', status); + formParams.append('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -494,23 +501,37 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams.append('additionalMetadata', additionalMetadata); } if (file !== undefined) { - formParams.set('file', file); + formParams.append('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index fba4c08d9aa..393d291ba3d 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -59,11 +59,6 @@ export class StoreService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index d7c9ee1510a..f495f1f9d39 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -59,11 +59,6 @@ export class UserService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * This can only be done by the logged in user. * @summary Create user @@ -342,7 +337,7 @@ export class UserService { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (username !== undefined) { queryParameters.set('username', username); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts index 319f79da15a..6fcda7b246d 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts @@ -1,4 +1,4 @@ -import { QueryEncoder } from "@angular/http"; + import { QueryEncoder } from '@angular/http'; /** * CustomQueryEncoderHelper @@ -14,4 +14,5 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} + diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index b87a0bd2288..8ff5eda659d 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -61,11 +61,6 @@ export class PetService implements PetServiceInterface { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * * @summary Add a new pet to the store @@ -283,7 +278,7 @@ export class PetService implements PetServiceInterface { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } @@ -322,7 +317,7 @@ export class PetService implements PetServiceInterface { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } @@ -443,22 +438,34 @@ export class PetService implements PetServiceInterface { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (name !== undefined) { - formParams.set('name', name); + formParams.append('name', name); } if (status !== undefined) { - formParams.set('status', status); + formParams.append('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -495,23 +502,37 @@ export class PetService implements PetServiceInterface { let consumes: string[] = [ 'multipart/form-data' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams.append('additionalMetadata', additionalMetadata); } if (file !== undefined) { - formParams.set('file', file); + formParams.append('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index d5a468340c4..1297e638d43 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -60,11 +60,6 @@ export class StoreService implements StoreServiceInterface { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 3574e7f2c7e..480d00b3bb6 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -60,11 +60,6 @@ export class UserService implements UserServiceInterface { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * This can only be done by the logged in user. * @summary Create user @@ -343,7 +338,7 @@ export class UserService implements UserServiceInterface { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (username !== undefined) { queryParameters.set('username', username); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts index 319f79da15a..6fcda7b246d 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts @@ -1,4 +1,4 @@ -import { QueryEncoder } from "@angular/http"; + import { QueryEncoder } from '@angular/http'; /** * CustomQueryEncoderHelper @@ -14,4 +14,5 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 9e7e00d1e48..ee44df243de 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -23,7 +23,7 @@ import { Pet } from '../model/pet'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { CustomQueryEncoderHelper } from '../encoder'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; @Injectable() @@ -58,6 +58,7 @@ export class PetService { } + /** * Add a new pet to the store * @@ -78,7 +79,8 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.post(`${this.basePath}/pet`, body, { + return this.httpClient.post(`${this.basePath}/pet`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -108,7 +110,8 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(petId)}`, { + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -124,7 +127,7 @@ export class PetService { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } - let queryParameters = new HttpParams(); + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (status) { queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } @@ -139,7 +142,8 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.get(`${this.basePath}/pet/findByStatus`, { + return this.httpClient.get(`${this.basePath}/pet/findByStatus`, + { params: queryParameters, headers: headers, withCredentials: this.configuration.withCredentials, @@ -156,7 +160,7 @@ export class PetService { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } - let queryParameters = new HttpParams(); + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (tags) { queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } @@ -171,7 +175,8 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.get(`${this.basePath}/pet/findByTags`, { + return this.httpClient.get(`${this.basePath}/pet/findByTags`, + { params: queryParameters, headers: headers, withCredentials: this.configuration.withCredentials, @@ -195,7 +200,8 @@ export class PetService { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } - return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(petId)}`, { + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -221,7 +227,8 @@ export class PetService { headers = headers.set('Authorization', 'Bearer ' + accessToken); } - return this.httpClient.put(`${this.basePath}/pet`, body, { + return this.httpClient.put(`${this.basePath}/pet`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -253,19 +260,28 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + + + if (name !== undefined) { - formParams.set('name', name); + formParams = formParams.append('name', name) || formParams; } if (status !== undefined) { - formParams.set('status', status); + formParams = formParams.append('status', status) || formParams; } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(petId)}`, formParams, { + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -297,20 +313,31 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + + + if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams = formParams.append('additionalMetadata', additionalMetadata) || formParams; } if (file !== undefined) { - formParams.set('file', file); + formParams = formParams.append('file', file) || formParams; } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(petId)}/uploadImage`, formParams, { + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, { headers: headers, withCredentials: this.configuration.withCredentials, }); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index e52b46095ce..f0cf7dbc1cb 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -22,7 +22,7 @@ import { Order } from '../model/order'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { CustomQueryEncoderHelper } from '../encoder'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; @Injectable() @@ -57,6 +57,7 @@ export class StoreService { } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -69,7 +70,8 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, { + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -88,7 +90,8 @@ export class StoreService { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } - return this.httpClient.get(`${this.basePath}/store/inventory`, { + return this.httpClient.get(`${this.basePath}/store/inventory`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -106,7 +109,8 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(orderId)}`, { + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -124,7 +128,8 @@ export class StoreService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/store/order`, body, { + return this.httpClient.post(`${this.basePath}/store/order`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index cc53d7367bc..d67fb448fc3 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -22,7 +22,7 @@ import { User } from '../model/user'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { CustomQueryEncoderHelper } from '../encoder'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; @Injectable() @@ -57,6 +57,7 @@ export class UserService { } + /** * Create user * This can only be done by the logged in user. @@ -69,7 +70,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user`, body, { + return this.httpClient.post(`${this.basePath}/user`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -87,7 +89,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user/createWithArray`, body, { + return this.httpClient.post(`${this.basePath}/user/createWithArray`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -105,7 +108,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.post(`${this.basePath}/user/createWithList`, body, { + return this.httpClient.post(`${this.basePath}/user/createWithList`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -123,7 +127,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(username)}`, { + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -141,7 +146,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(username)}`, { + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -161,7 +167,7 @@ export class UserService { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } - let queryParameters = new HttpParams(); + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (username !== undefined) { queryParameters = queryParameters.set('username', username); } @@ -171,7 +177,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/login`, { + return this.httpClient.get(`${this.basePath}/user/login`, + { params: queryParameters, headers: headers, withCredentials: this.configuration.withCredentials, @@ -186,7 +193,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.get(`${this.basePath}/user/logout`, { + return this.httpClient.get(`${this.basePath}/user/logout`, + { headers: headers, withCredentials: this.configuration.withCredentials, }); @@ -208,7 +216,8 @@ export class UserService { let headers = this.defaultHeaders; - return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(username)}`, body, { + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body, + { headers: headers, withCredentials: this.configuration.withCredentials, }); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts index 319f79da15a..f1c6b78c9c8 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts @@ -1,11 +1,11 @@ -import { QueryEncoder } from "@angular/http"; + import { HttpUrlEncodingCodec } from '@angular/common/http'; /** -* CustomQueryEncoderHelper +* CustomHttpUrlEncodingCodec * Fix plus sign (+) not encoding, so sent as blank space * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 */ -export class CustomQueryEncoderHelper extends QueryEncoder { +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { encodeKey(k: string): string { k = super.encodeKey(k); return k.replace(/\+/gi, '%2B'); @@ -14,4 +14,5 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} + diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 481f693424e..11a1b603831 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -60,11 +60,6 @@ export class PetService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * * @summary Add a new pet to the store @@ -282,7 +277,7 @@ export class PetService { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (status) { queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); } @@ -321,7 +316,7 @@ export class PetService { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (tags) { queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); } @@ -442,22 +437,34 @@ export class PetService { let consumes: string[] = [ 'application/x-www-form-urlencoded' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (name !== undefined) { - formParams.set('name', name); + formParams.append('name', name); } if (status !== undefined) { - formParams.set('status', status); + formParams.append('status', status); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 @@ -494,23 +501,37 @@ export class PetService { let consumes: string[] = [ 'multipart/form-data' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data useForm = canConsumeForm; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + if (useForm) { + formParams = new FormData(); + } else { + // TODO: this fails if a parameter is a file, the api can't consume "multipart/form-data" and a blob is passed. + convertFormParamsToString = true; + formParams = new URLSearchParams('', new CustomQueryEncoderHelper()); + // set the content-type explicitly to avoid having it set to 'text/plain' + headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + + + if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata); + formParams.append('additionalMetadata', additionalMetadata); } if (file !== undefined) { - formParams.set('file', file); + formParams.append('file', file); } let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams.toString(), + body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials:this.configuration.withCredentials }); // https://github.com/swagger-api/swagger-codegen/issues/4037 diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index fba4c08d9aa..393d291ba3d 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -59,11 +59,6 @@ export class StoreService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index d7c9ee1510a..f495f1f9d39 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -59,11 +59,6 @@ export class UserService { } - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } - /** * This can only be done by the logged in user. * @summary Create user @@ -342,7 +337,7 @@ export class UserService { throw new Error('Required parameter password was null or undefined when calling loginUser.'); } - let queryParameters = new URLSearchParams(); + let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); if (username !== undefined) { queryParameters.set('username', username); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts index 319f79da15a..6fcda7b246d 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts @@ -1,4 +1,4 @@ -import { QueryEncoder } from "@angular/http"; + import { QueryEncoder } from '@angular/http'; /** * CustomQueryEncoderHelper @@ -14,4 +14,5 @@ export class CustomQueryEncoderHelper extends QueryEncoder { v = super.encodeValue(v); return v.replace(/\+/gi, '%2B'); } -} \ No newline at end of file +} + From db67840ded582e3cfb199c72a1a4502873b1bb9c Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Tue, 10 Oct 2017 10:01:48 -0500 Subject: [PATCH 138/197] [haskell-http-client] bug fixes; path & newtype generation issues (#6638) * fix path generation/param-substitution issues * fix newtype de-duplication issues * refactoring only * correct version in comments * prevent duplicate MimeTypes * sort parameter newtypes --- .../languages/HaskellHttpClientCodegen.java | 245 +- .../haskell-http-client/API.mustache | 18 +- .../haskell-http-client/Model.mustache | 6 + .../haskell-http-client.cabal.mustache | 10 +- .../partial_header.mustache | 13 +- .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-Client.html | 2 +- .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 10 +- .../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-E.html | 2 +- .../haskell-http-client/docs/doc-index-F.html | 2 +- .../haskell-http-client/docs/doc-index-I.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 | 2 +- .../docs/mini_SwaggerPetstore-MimeTypes.html | 2 +- .../docs/mini_SwaggerPetstore-Model.html | 2 +- .../docs/src/Paths_swagger_petstore.html | 8 +- .../docs/src/SwaggerPetstore.API.html | 2373 +++++++------ .../docs/src/SwaggerPetstore.Client.html | 573 ++-- .../docs/src/SwaggerPetstore.Lens.html | 1119 +++---- .../docs/src/SwaggerPetstore.Logging.html | 217 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 427 +-- .../docs/src/SwaggerPetstore.Model.html | 2940 +++++++++-------- .../docs/src/SwaggerPetstore.html | 41 +- .../lib/SwaggerPetstore.hs | 3 +- .../lib/SwaggerPetstore/API.hs | 99 +- .../lib/SwaggerPetstore/Client.hs | 3 +- .../lib/SwaggerPetstore/Lens.hs | 3 +- .../lib/SwaggerPetstore/Logging.hs | 3 +- .../lib/SwaggerPetstore/MimeTypes.hs | 17 +- .../lib/SwaggerPetstore/Model.hs | 42 +- .../swagger-petstore.cabal | 8 +- .../petstore/haskell-http-client/swagger.json | 2 +- 43 files changed, 4093 insertions(+), 4127 deletions(-) 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 08b009815e2..45f3d08f471 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 @@ -26,7 +26,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.text.WordUtils; import java.util.regex.Matcher; @@ -34,7 +33,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC // source folder where to write the files protected String sourceFolder = "src"; - protected String apiVersion = "0.0.1"; protected String artifactId = "swagger-haskell-http-client"; protected String artifactVersion = "1.0.0"; @@ -67,7 +65,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected Map uniqueParamsByName = new HashMap(); protected Set typeNames = new HashSet(); - protected Map> allMimeTypes = new HashMap>(); protected Map knownMimeDataTypes = new HashMap(); protected Map> modelMimeTypes = new HashMap>(); protected String lastTag = ""; @@ -124,7 +121,6 @@ public HaskellHttpClientCodegen() { ) ); - additionalProperties.put("apiVersion", apiVersion); additionalProperties.put("artifactId", artifactId); additionalProperties.put("artifactVersion", artifactVersion); @@ -398,13 +394,7 @@ public void preprocessSwagger(Swagger swagger) { additionalProperties.put("configType", apiName + "Config"); additionalProperties.put("swaggerVersion", swagger.getSwagger()); - //copy input swagger to output folder - try { - String swaggerJson = Json.pretty(swagger); - FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e.getCause()); - } + WriteInputSwaggerToFile(swagger); super.preprocessSwagger(swagger); } @@ -461,7 +451,6 @@ 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); @@ -486,100 +475,20 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op if(!param.required) { op.vendorExtensions.put("x-hasOptionalParams", true); } - if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) { - String paramNameType = toTypeName("Param", param.paramName); - - if (uniqueParamsByName.containsKey(paramNameType)) { - CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType); - if (lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) { - param.vendorExtensions.put("x-duplicate", true); - } else { - paramNameType = paramNameType + param.dataType; - while (typeNames.contains(paramNameType)) { - paramNameType = generateNextName(paramNameType); - } - uniqueParamsByName.put(paramNameType, param); - } - } else { - while (typeNames.contains(paramNameType)) { - paramNameType = generateNextName(paramNameType); - } - uniqueParamsByName.put(paramNameType, param); - } - param.vendorExtensions.put("x-paramNameType", paramNameType); - typeNames.add(paramNameType); - } - } - if (op.getHasPathParams()) { - String remainingPath = op.path; - for (CodegenParameter param : op.pathParams) { - String[] pieces = remainingPath.split("\\{" + param.baseName + "\\}"); - if (pieces.length == 0) - throw new RuntimeException("paramName {" + param.baseName + "} not in path " + op.path); - if (pieces.length > 2) - throw new RuntimeException("paramName {" + param.baseName + "} found multiple times in path " + op.path); - if (pieces.length == 2) { - param.vendorExtensions.put("x-pathPrefix", pieces[0]); - remainingPath = pieces[1]; - } else { - if (remainingPath.startsWith("{" + param.baseName + "}")) { - remainingPath = pieces[0]; - } else { - param.vendorExtensions.put("x-pathPrefix", pieces[0]); - remainingPath = ""; - } - } - } - op.vendorExtensions.put("x-hasPathParams", true); - if (remainingPath.length() > 0) { - op.vendorExtensions.put("x-pathSuffix", remainingPath); - } - } else { - op.vendorExtensions.put("x-hasPathParams", false); - op.vendorExtensions.put("x-pathSuffix", op.path); - } - for (CodegenParameter param : op.queryParams) { - } - for (CodegenParameter param : op.headerParams) { - } - for (CodegenParameter param : op.bodyParams) { - } - for (CodegenParameter param : op.formParams) { + deduplicateParameter(param); } - if (op.hasConsumes) { - for (Map m : op.consumes) { - processMediaType(op,m); - } - if (isMultipartOperation(op.consumes)) { - op.isMultipart = Boolean.TRUE; - } - } - if (op.hasProduces) { - for (Map m : op.produces) { - processMediaType(op,m); - } - } + processPathExpr(op); - String returnType = op.returnType; - if (returnType == null || returnType.equals("null")) { - if(op.hasProduces) { - returnType = "res"; - op.vendorExtensions.put("x-hasUnknownReturn", true); - } else { - returnType = "NoContent"; - } - } - if (returnType.indexOf(" ") >= 0) { - returnType = "(" + returnType + ")"; - } - op.vendorExtensions.put("x-returnType", returnType); + processProducesConsumes(op); + processReturnType(op); return op; } - + + @Override public List fromSecurity(Map schemes) { List secs = super.fromSecurity(schemes); for(CodegenSecurity sec : secs) { @@ -603,8 +512,26 @@ public Map postProcessOperations(Map objs) { } additionalProperties.put("x-hasUnknownMimeTypes", !unknownMimeTypes.isEmpty()); + + Collections.sort(unknownMimeTypes, new Comparator>() { + @Override + public int compare(Map o1, Map o2) { + return o1.get(MEDIA_TYPE).compareTo(o2.get(MEDIA_TYPE)); + } + }); additionalProperties.put("x-unknownMimeTypes", unknownMimeTypes); - additionalProperties.put("x-allUniqueParams", uniqueParamsByName.values()); + + ArrayList params = new ArrayList<>(uniqueParamsByName.values()); + Collections.sort(params, new Comparator() { + @Override + public int compare(CodegenParameter o1, CodegenParameter o2) { + return + ((String) o1.vendorExtensions.get("x-paramNameType")) + .compareTo( + (String) o2.vendorExtensions.get("x-paramNameType")); + } + }); + additionalProperties.put("x-allUniqueParams", params); return ret; } @@ -687,10 +614,114 @@ public boolean isDataTypeBinary(final String dataType) { return dataType != null && dataType.equals("B.ByteString"); } + //copy input swagger to output folder + private void WriteInputSwaggerToFile(Swagger swagger) { + try { + String swaggerJson = Json.pretty(swagger); + FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); + } catch (IOException e) { + throw new RuntimeException(e.getMessage(), e.getCause()); + } + } + + private void processReturnType(CodegenOperation op) { + String returnType = op.returnType; + if (returnType == null || returnType.equals("null")) { + if(op.hasProduces) { + returnType = "res"; + op.vendorExtensions.put("x-hasUnknownReturn", true); + } else { + returnType = "NoContent"; + } + } + if (returnType.indexOf(" ") >= 0) { + returnType = "(" + returnType + ")"; + } + op.vendorExtensions.put("x-returnType", returnType); + } + + private void processProducesConsumes(CodegenOperation op) { + if (op.hasConsumes) { + for (Map m : op.consumes) { + processMediaType(op,m); + } + if (isMultipartOperation(op.consumes)) { + op.isMultipart = Boolean.TRUE; + } + } + if (op.hasProduces) { + for (Map m : op.produces) { + processMediaType(op,m); + } + } + } + + private void deduplicateParameter(CodegenParameter param) { + if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) { + + String paramNameType = toTypeName("Param", param.paramName); + + if (uniqueParamsByName.containsKey(paramNameType)) { + if(!checkParamForDuplicates(paramNameType, param)) { + paramNameType = paramNameType + param.dataType; + if(!checkParamForDuplicates(paramNameType, param)) { + while (typeNames.contains(paramNameType)) { + paramNameType = generateNextName(paramNameType); + if(checkParamForDuplicates(paramNameType, param)) { + break; + } + } + } + + uniqueParamsByName.put(paramNameType, param); + } + } else { + + while (typeNames.contains(paramNameType)) { + paramNameType = generateNextName(paramNameType); + if(checkParamForDuplicates(paramNameType, param)) { + break; + } + } + + uniqueParamsByName.put(paramNameType, param); + } + + param.vendorExtensions.put("x-paramNameType", paramNameType); + typeNames.add(paramNameType); + } + } + + public Boolean checkParamForDuplicates(String paramNameType, CodegenParameter param) { + CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType); + if (lastParam != null && lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) { + param.vendorExtensions.put("x-duplicate", true); + return true; + } + return false; + } + + // build the parameterized path segments, according to pathParams + private void processPathExpr(CodegenOperation op) { + String xPath = "[\"" + escapeText(op.path) + "\"]"; + if (op.getHasPathParams()) { + for (CodegenParameter param : op.pathParams) { + xPath = xPath.replaceAll("\\{" + param.baseName + "\\}", "\",toPath " + param.paramName + ",\""); + } + xPath = xPath.replaceAll(",\"\",", ","); + xPath = xPath.replaceAll("\"\",", ","); + xPath = xPath.replaceAll(",\"\"", ","); + xPath = xPath.replaceAll("^\\[,", "["); + xPath = xPath.replaceAll(",\\]$", "]"); + } + op.vendorExtensions.put("x-path", xPath); + } + + private void processMediaType(CodegenOperation op, Map m) { String mediaType = m.get(MEDIA_TYPE); - if(StringUtils.isBlank(mediaType)) return; + if (StringUtils.isBlank(mediaType)) return; String mimeType = getMimeDataType(mediaType); typeNames.add(mimeType); @@ -699,8 +730,7 @@ private void processMediaType(CodegenOperation op, Map m) { m.put(MEDIA_IS_JSON, "true"); } - allMimeTypes.put(mediaType, m); - if(!knownMimeDataTypes.containsKey(mediaType) && !unknownMimeTypes.contains(m)) { + if (!knownMimeDataTypes.containsValue(mimeType) && !unknownMimeTypesContainsType(mimeType)) { unknownMimeTypes.add(m); } for (CodegenParameter param : op.allParams) { @@ -712,6 +742,17 @@ private void processMediaType(CodegenOperation op, Map m) { } } + private Boolean unknownMimeTypesContainsType(String mimeType) { + for(Map m : unknownMimeTypes) { + String mimeType0 = m.get(MEDIA_DATA_TYPE); + if(mimeType0 != null && mimeType0.equals(mimeType)) { + return true; + } + } + + return false; + } + public String firstLetterToUpper(String word) { if (word.length() == 0) { return word; 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 e9208e5cc52..d11e8b68a35 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 @@ -88,9 +88,14 @@ import qualified Prelude as P -> {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}} -> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-hasBodyOrFormParam}}contentType{{/vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-hasBodyOrFormParam}}MimeNoContent{{/vendorExtensions.x-hasBodyOrFormParam}} {{vendorExtensions.x-returnType}} {{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}_ {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-paramNameType}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= - _mkRequest "{{httpMethod}}" [{{#pathParams}}{{#vendorExtensions.x-pathPrefix}}"{{.}}",{{/vendorExtensions.x-pathPrefix}}toPath {{{paramName}}}{{#hasMore}},{{/hasMore}}{{/pathParams}}{{#vendorExtensions.x-pathSuffix}}{{#vendorExtensions.x-hasPathParams}},{{/vendorExtensions.x-hasPathParams}}"{{.}}"{{/vendorExtensions.x-pathSuffix}}]{{#allParams}}{{#required}} - {{#isHeaderParam}}`setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}}`setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}}`_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}}`_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}}`addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}}`setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#authMethods}} - `_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#isDeprecated}} + _mkRequest "{{httpMethod}}" {{{vendorExtensions.x-path}}}{{#authMethods}} + `_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#allParams}}{{#required}}{{#isHeaderParam}} + `setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}} + `setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}} + `_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}} + `_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}} + `addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}} + `setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#isDeprecated}} {-# DEPRECATED {{operationId}} "" #-}{{/isDeprecated}} @@ -138,13 +143,6 @@ class HasOptionalParam req param where infixl 2 -&- --- * Request Parameter Types - -{{#x-allUniqueParams}} --- | {{{vendorExtensions.x-paramNameType}}} -newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}}) -{{/x-allUniqueParams}} - -- * {{requestType}} -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. 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 ff7cf6a575e..c40e0e27184 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 @@ -113,6 +113,12 @@ mk{{classname}} {{#requiredVars}}{{name}} {{/requiredVars}}= {{/model}} {{/models}} +-- * Parameter newtypes + +{{#x-allUniqueParams}} +newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}}) +{{/x-allUniqueParams}} + -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) 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 1a347068d2b..729bdb00abe 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 @@ -1,7 +1,3 @@ --- This file has been generated from package.yaml by hpack version 0.17.1. --- --- see: https://github.com/sol/hpack - name: {{package}} version: 0.1.0.0 synopsis: Auto-generated {{package}} API Client @@ -11,10 +7,12 @@ description: . host: {{host}} . base path: {{basePath}} + {{#version}} . - apiVersion: {{apiVersion}} + {{appName}} API version: {{{.}}} + {{/version}} . - swagger version: {{swaggerVersion}} + OpenAPI spec version: {{swaggerVersion}} . {{^hideGenerationTimestamp}}Generated on: {{generatedDate}} . diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache index 7fc0581b639..7c31d3f6fe1 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/partial_header.mustache @@ -1,17 +1,20 @@ {- {{#appName}} - {{{appName}}} + {{{.}}} {{/appName}} - {{#appDescription}} - {{{appDescription}}} + {{#appDescription}} + {{{.}}} {{/appDescription}} + {{#swaggerVersion}} + OpenAPI spec version: {{{.}}} + {{/swaggerVersion}} {{#version}} - OpenAPI spec version: {{{version}}} + {{appName}} API version: {{{.}}} {{/version}} {{#infoEmail}} - Contact: {{{infoEmail}}} + Contact: {{{.}}} {{/infoEmail}} Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) -} 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 4fe2d43c872..4c459fbdcff 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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Consumes TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Consumes TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> contentType

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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 EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

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 EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: PetId

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Status

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

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

:: PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet 
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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> PetId

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

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

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse 
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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: OrderIdText

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

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

:: OrderId

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Username

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res 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 -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

HasOptionalParam UploadFile AdditionalMetadata Source #

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

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam DeletePet ApiKey Source # 
HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

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

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

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

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 EnumHeaderString Source #

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

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

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

HasOptionalParam TestEnumParameters EnumFormString Source #

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

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

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

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

Request Parameter Types

newtype Number Source #

Number

Constructors

Number 

Fields

Instances

newtype Body Source #

Body

Constructors

Body 

Fields

newtype Tags Source #

Tags

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 Name2 Source #

Name2

Constructors

Name2 

Fields

newtype Status Source #

Status

Constructors

Status 

Fields

Instances

newtype Param2 Source #

Param2

Constructors

Param2 

Fields

Instances

newtype PetId Source #

PetId

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 OrderId Source #

OrderId

Constructors

OrderId 

Fields

newtype Username Source #

Username

Constructors

Username 

Fields

newtype Byte Source #

Byte

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 Param Source #

Param

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 File Source #

File

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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

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

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

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

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

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res 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 :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +

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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
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

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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)

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: PetId

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Status

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

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

:: PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet 
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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> PetId

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

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

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse 
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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: OrderIdText

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

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

:: OrderId

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Username

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res 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 -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

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 # 
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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

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

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

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

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

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res 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 :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index 62e7ba42c1e..b7014dadad5 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res Source #

apply all matching AuthMethods in config to request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res Source #

apply all matching AuthMethods in config to request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ 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 1dce441abd5..e037820bcc8 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

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
MimeType MimeXmlCharsetutf8 Source #
application/xml; 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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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 MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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
\ 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 be752dc3ae4..1b951745404 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,8 +1,8 @@ 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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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)

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 # 
\ 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

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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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)

Parameter newtypes

newtype Body Source #

Constructors

Body 

Fields

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

newtype Name2 Source #

Constructors

Name2 

Fields

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

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 # 
\ 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 438715137ec..6a2d3e36fb4 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

addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, 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

addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 eb371e0fefc..f3fdd34d807 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.API, SwaggerPetstore
addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index

-&-SwaggerPetstore.API, SwaggerPetstore
addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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, 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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, 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 9404d98a715..f96d57a9faf 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.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 - B

Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.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-C.html b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html index c3a7f8aa949..646bddf512c 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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 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 344278e3fb8..7e9ba22e7ee 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

EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - E

EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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 ee818dc6d85..68faaa60a48 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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 f3b5b707ff2..4ad3661f4b5 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-N.html b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html index 30a4f2a7fb4..31e7b08e56b 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, 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 f38ecee8517..9c5f5e9f313 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.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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 fbc4848afee..bab1b0511dc 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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.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 e184aed000c..e987b83110d 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.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
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 - S

setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 9690d5db236..c12f179e0e0 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - T

TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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 686bdf75d50..46de12dde75 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

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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, 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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, 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 66b20478cf9..ee514e08183 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

apiVersion: 0.0.1

swagger version: 2.0

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

\ 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

\ 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 index 4a91bbe2842..98718716a50 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

Request Parameter Types

data ApiKey

data Number

data Int32

data Body

data Tags

data Name2

data Status

data Param2

data PetId

data OrderId

data Int64

data Byte

data Param

data File

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

AuthMethods

class AuthMethod a

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

AuthMethods

class AuthMethod a

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ 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 index 88f9b9437e4..4e2ccd9ed50 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html @@ -1,4 +1,4 @@ SwaggerPetstore.MimeTypes

SwaggerPetstore.MimeTypes

Content Negotiation

Mime Types

data MimeXML

data MimeAny

MimeType Class

class MimeType mtype

MimeType Instances

MimeRender Class

class MimeRender mtype x

MimeRender Instances

MimeUnrender Class

class MimeUnrender mtype o

MimeUnrender Instances

Request Consumes

class Consumes req mtype

Request Produces

class Produces req mtype

\ No newline at end of file +

SwaggerPetstore.MimeTypes

Content Negotiation

Mime Types

data MimeXML

data MimeAny

MimeType Class

class MimeType mtype

MimeType Instances

MimeRender Class

class MimeRender mtype x

MimeRender Instances

MimeUnrender Class

class MimeUnrender mtype o

MimeUnrender Instances

Request Consumes

class Consumes req mtype

Request Produces

class Produces req mtype

\ 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 index aab7ca5e3da..d6fd283f561 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

Utils

DateTime Formatting

Date Formatting

data Date

Byte/Binary Formatting

data Binary

\ No newline at end of file +

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

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

Utils

DateTime Formatting

Date Formatting

data Date

Byte/Binary Formatting

data Binary

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index ce8b707ee40..5a97d13ab1b 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 5aa98e37703..d35b3e68321 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 @@ -3,492 +3,492 @@ 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: 1.0.0 + 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 -} - -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE ExistentialQuantification #-} -{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.API where - + +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API where -import SwaggerPetstore.Model as M -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens - -import qualified Data.Aeson as A - -import qualified Data.Time as TI - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Base64 as B64 - -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.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI -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.Set as Set -import qualified Data.Maybe as P -import qualified Data.Proxy as P (Proxy(..)) -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 GHC.Base as P (Alternative) -import qualified Control.Arrow as P (left) - -import qualified Lens.Micro as L - -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 - + +import SwaggerPetstore.Model as M +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens + +import qualified Data.Aeson as A + +import qualified Data.Time as TI + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Base64 as B64 + +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.HttpApiData as WH +import qualified Web.FormUrlEncoded as WH + +import qualified Data.CaseInsensitive as CI +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.Set as Set +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +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 GHC.Base as P (Alternative) +import qualified Control.Arrow as P (left) + +import qualified Lens.Micro as L + +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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestSpecialTags contentType Client -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 - + +-- ** AnotherFake + +-- *** testSpecialTags + +-- | @PATCH \/another-fake\/dummy@ +-- +-- To test special tags +-- +-- To test special tags +-- +testSpecialTags + :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestSpecialTags contentType Client +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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString -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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClientModel contentType Client -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 - + +-- ** Fake + +-- *** fakeOuterBooleanSerialize + +-- | @POST \/fake\/outer\/boolean@ +-- +-- Test serialization of outer boolean types +-- +fakeOuterBooleanSerialize + :: (Consumes FakeOuterBooleanSerialize contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString +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 -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClientModel contentType Client +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 -- ^ request content-type ('MimeType') - -> Number -- ^ "number" - None - -> ParamDouble -- ^ "double" - None - -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None - -> Byte -- ^ "byte" - None - -> SwaggerPetstoreRequest TestEndpointParameters contentType res -testEndpointParameters _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = - _mkRequest "POST" ["/fake"] - `addForm` toForm ("number", number) - `addForm` toForm ("double", double) - `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `addForm` toForm ("byte", byte) - `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) - -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 - + +-- *** 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 -- ^ request content-type ('MimeType') + -> Number -- ^ "number" - None + -> ParamDouble -- ^ "double" - None + -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None + -> Byte -- ^ "byte" - None + -> SwaggerPetstoreRequest TestEndpointParameters contentType res +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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest TestEnumParameters contentType res -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 - + +-- *** testEnumParameters + +-- | @GET \/fake@ +-- +-- To test enum parameters +-- +-- To test enum parameters +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEnumParameters + :: (Consumes TestEnumParameters contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest TestEnumParameters contentType res +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 --- *** testJsonFormData - --- | @GET \/fake\/jsonFormData@ --- --- test json serialization of form data --- + +-- *** testJsonFormData + +-- | @GET \/fake\/jsonFormData@ +-- +-- test json serialization of form data -- -- -testJsonFormData - :: (Consumes TestJsonFormData contentType) - => contentType -- ^ request content-type ('MimeType') - -> Param -- ^ "param" - field1 - -> Param2 -- ^ "param2" - field2 - -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent -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 - +-- +testJsonFormData + :: (Consumes TestJsonFormData contentType) + => contentType -- ^ request content-type ('MimeType') + -> Param -- ^ "param" - field1 + -> Param2 -- ^ "param2" - field2 + -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent +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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClassname contentType Client -testClassname _ body = - _mkRequest "PATCH" ["/fake_classname_test"] - `setBodyParam` body + +-- ** FakeClassnameTags123 + +-- *** testClassname + +-- | @PATCH \/fake_classname_test@ +-- +-- To test class name in snake case +-- +-- AuthMethod: 'AuthApiKeyApiKeyQuery' +-- +testClassname + :: (Consumes TestClassname contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClassname contentType Client +testClassname _ body = + _mkRequest "PATCH" ["/fake_classname_test"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - -data TestClassname - --- | /Body Param/ "body" - client model -instance HasBodyParam TestClassname Client - --- | @application/json@ -instance Consumes TestClassname MimeJSON - --- | @application/json@ -instance Produces TestClassname MimeJSON - + `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 --- + +-- ** 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 -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = - _mkRequest "POST" ["/pet"] - `setBodyParam` body +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +addPet + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest AddPet contentType res +addPet _ body = + _mkRequest "POST" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -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 - + `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 --- + +-- *** deletePet + +-- | @DELETE \/pet\/{petId}@ +-- +-- Deletes a pet -- -- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -deletePet - :: PetId -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] - +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deletePet + :: PetId -- ^ "petId" - Pet id to delete + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +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) +instance HasOptionalParam DeletePet ApiKey where + applyOptionalParam req (ApiKey xs) = + req `setHeader` toHeader ("api_key", xs) -- | @application/xml@ instance Produces DeletePet MimeXML -- | @application/json@ @@ -506,12 +506,12 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByStatus - :: Status -- ^ "status" - Status values that need to be considered for filter + :: Status -- ^ "status" - Status values that need to be considered for filter -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -findPetsByStatus (Status status) = +findPetsByStatus (Status status) = _mkRequest "GET" ["/pet/findByStatus"] - `setQuery` toQueryColl CommaSeparated ("status", Just status) - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -531,12 +531,12 @@ -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByTags - :: Tags -- ^ "tags" - Tags to filter by + :: Tags -- ^ "tags" - Tags to filter by -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -findPetsByTags (Tags tags) = +findPetsByTags (Tags tags) = _mkRequest "GET" ["/pet/findByTags"] - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -558,803 +558,720 @@ -- AuthMethod: 'AuthApiKeyApiKey' -- getPetById - :: PetId -- ^ "petId" - ID of pet to return + :: PetId -- ^ "petId" - ID of pet to return -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -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 +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 +-- *** 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 -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = - _mkRequest "PUT" ["/pet"] - `setBodyParam` body - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -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 +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePet + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => contentType -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest UpdatePet contentType res +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 +-- *** 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 -- ^ request content-type ('MimeType') - -> PetId -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] - - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePetWithForm + :: (Consumes UpdatePetWithForm contentType) + => contentType -- ^ request content-type ('MimeType') + -> PetId -- ^ "petId" - ID of pet that needs to be updated + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +updatePetWithForm _ (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + +data UpdatePetWithForm -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 - +-- | /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 --- *** uploadFile - --- | @POST \/pet\/{petId}\/uploadImage@ +-- | @POST \/pet\/{petId}\/uploadImage@ +-- +-- uploads an image -- --- uploads an image +-- -- --- +-- AuthMethod: 'AuthOAuthPetstoreAuth' -- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -uploadFile - :: (Consumes UploadFile contentType) - => contentType -- ^ request content-type ('MimeType') - -> PetId -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -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 +uploadFile + :: (Consumes UploadFile contentType) + => contentType -- ^ request content-type ('MimeType') + -> PetId -- ^ "petId" - ID of pet to update + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +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 --- | @multipart/form-data@ -instance Consumes UploadFile MimeMultipartFormData +-- | @application/json@ +instance Produces UploadFile MimeJSON --- | @application/json@ -instance Produces UploadFile MimeJSON + +-- ** Store - --- ** 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 - :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -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@ +-- *** 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 + :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +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 -- --- Returns pet inventories by status +-- AuthMethod: 'AuthApiKeyApiKey' -- --- Returns a map of status codes to quantities --- --- AuthMethod: 'AuthApiKeyApiKey' --- -getInventory - :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) -getInventory = - _mkRequest "GET" ["/store/inventory"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) +getInventory + :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) +getInventory = + _mkRequest "GET" ["/store/inventory"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) + +data GetInventory +-- | @application/json@ +instance Produces GetInventory MimeJSON -data GetInventory --- | @application/json@ -instance Produces GetInventory MimeJSON - - --- *** getOrderById - --- | @GET \/store\/order\/{order_id}@ + +-- *** 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 -- --- Find purchase order by ID --- --- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions --- -getOrderById - :: OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -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 -- ^ request content-type ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -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 +getOrderById + :: OrderId -- ^ "orderId" - ID of pet that needs to be fetched + -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order +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 -- ^ request content-type ('MimeType') + -> Order -- ^ "body" - order placed for purchasing the pet + -> SwaggerPetstoreRequest PlaceOrder contentType Order +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 - --- ** 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 -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -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 -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -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 -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -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 - :: Username -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -deleteUser (Username username) = - _mkRequest "DELETE" ["/user/",toPath username] - +-- | @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 -- ^ request content-type ('MimeType') + -> User -- ^ "body" - Created user object + -> SwaggerPetstoreRequest CreateUser contentType res +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 -- ^ request content-type ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +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 -- ^ request content-type ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +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 + :: Username -- ^ "username" - The name that needs to be deleted + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +deleteUser (Username username) = + _mkRequest "DELETE" ["/user/",toPath username] + +data DeleteUser +-- | @application/xml@ +instance Produces DeleteUser MimeXML +-- | @application/json@ +instance Produces DeleteUser MimeJSON -data DeleteUser --- | @application/xml@ -instance Produces DeleteUser MimeXML --- | @application/json@ -instance Produces DeleteUser MimeJSON - - --- *** getUserByName - --- | @GET \/user\/{username}@ --- --- Get user by user name --- --- --- -getUserByName - :: Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -getUserByName (Username username) = - _mkRequest "GET" ["/user/",toPath username] - + +-- *** getUserByName + +-- | @GET \/user\/{username}@ +-- +-- Get user by user name +-- +-- +-- +getUserByName + :: Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + -> SwaggerPetstoreRequest GetUserByName MimeNoContent User +getUserByName (Username username) = + _mkRequest "GET" ["/user/",toPath username] + +data GetUserByName +-- | @application/xml@ +instance Produces GetUserByName MimeXML +-- | @application/json@ +instance Produces GetUserByName MimeJSON + -data GetUserByName --- | @application/xml@ -instance Produces GetUserByName MimeXML --- | @application/json@ -instance Produces GetUserByName MimeJSON - - --- *** loginUser - --- | @GET \/user\/login@ --- --- Logs user into the system --- --- --- -loginUser - :: Username -- ^ "username" - The user name for login - -> Password -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -loginUser (Username username) (Password password) = - _mkRequest "GET" ["/user/login"] - `setQuery` toQuery ("username", Just username) - `setQuery` toQuery ("password", Just password) +-- *** loginUser + +-- | @GET \/user\/login@ +-- +-- Logs user into the system +-- +-- +-- +loginUser + :: Username -- ^ "username" - The user name for login + -> Password -- ^ "password" - The password for login in clear text + -> SwaggerPetstoreRequest LoginUser MimeNoContent Text +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 + -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 - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res -logoutUser = - _mkRequest "GET" ["/user/logout"] +-- *** logoutUser + +-- | @GET \/user\/logout@ +-- +-- Logs out current logged in user session +-- +-- +-- +-- Note: Has 'Produces' instances, but no response schema +-- +logoutUser + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res +logoutUser = + _mkRequest "GET" ["/user/logout"] + +data LogoutUser +-- | @application/xml@ +instance Produces LogoutUser MimeXML +-- | @application/json@ +instance Produces LogoutUser MimeJSON + -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 -- ^ request content-type ('MimeType') - -> Username -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ (Username username) body = - _mkRequest "PUT" ["/user/",toPath username] - - `setBodyParam` body - -data UpdateUser +-- *** 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 -- ^ request content-type ('MimeType') + -> Username -- ^ "username" - name that need to be deleted + -> User -- ^ "body" - Updated user object + -> SwaggerPetstoreRequest UpdateUser contentType res +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 + --- | /Body Param/ "body" - Updated user object -instance HasBodyParam UpdateUser User --- | @application/xml@ -instance Produces UpdateUser MimeXML --- | @application/json@ -instance Produces UpdateUser MimeJSON - - + +-- * HasBodyParam + +-- | Designates the body parameter of a request +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader --- * HasBodyParam +-- * HasOptionalParam --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} - - -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * Request Parameter Types - --- | ApiKey -newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) --- | StatusText -newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) --- | ParamString -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) --- | ParamInteger -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) --- | EnumQueryDouble -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) --- | Number -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) --- | Int32 -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) --- | ParamDate -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) --- | EnumFormString -newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show) --- | Body -newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) --- | Tags -newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) --- | EnumQueryInteger -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) --- | ParamFloat -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) --- | Name2 -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) --- | Password -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) --- | Status -newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show) --- | ParamDouble -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) --- | EnumHeaderString -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) --- | Param2 -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) --- | PetId -newtype PetId = PetId { unPetId :: Integer } 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) --- | EnumQueryString -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) --- | ParamDateTime -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) --- | EnumQueryStringArray -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) --- | PatternWithoutDelimiter -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) --- | Callback -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) --- | Username -newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) --- | Int64 -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) --- | AdditionalMetadata -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) --- | Byte -newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) --- | ParamBinary -newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) --- | EnumFormStringArray -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) --- | EnumHeaderStringArray -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) --- | Param -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) --- | File -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) - --- * SwaggerPetstoreRequest - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest - { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , rParams :: Params -- ^ params of SwaggerPetstoreRequest - , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods - } - deriving (P.Show) +-- | Designates the optional parameters of a request +class HasOptionalParam req param where + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} + +infixl 2 -&- + +-- * SwaggerPetstoreRequest + +-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest + { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest + , rParams :: Params -- ^ params of SwaggerPetstoreRequest + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + +-- | 'rParams' Lens +rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep] +rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes +{-# INLINE rAuthTypesL #-} + +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) + +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) + +-- ** SwaggerPetstoreRequest Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) + +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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"] --- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod -{-# INLINE rMethodL #-} - --- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath -{-# INLINE rUrlPathL #-} - --- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams -{-# INLINE rParamsL #-} +_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst --- | 'rParams' Lens -rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep] -rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes -{-# INLINE rAuthTypesL #-} - --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | 'paramsQuery' Lens -paramsQueryL :: Lens_' Params NH.Query -paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery -{-# INLINE paramsQueryL #-} +addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) --- | 'paramsHeaders' Lens -paramsHeadersL :: Lens_' Params NH.RequestHeaders -paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders -{-# INLINE paramsHeadersL #-} - --- | 'paramsBody' Lens -paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody -{-# INLINE paramsBodyL #-} +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + +_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) + +-- ** Params Utils --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** SwaggerPetstoreRequest Utils +toPath + :: 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] + +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone - -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) - -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & - L.over - (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) +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 + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 where - cifst = CI.mk . P.fst - + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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 -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] - -setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -setQuery req query = - req & - L.over - (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) +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 + {-# 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.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 - cifst = CI.mk . P.fst - -addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) - -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) - -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) - -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + 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 #-} + +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => AuthMethod a where + applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) -_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) - --- ** Params Utils +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod req a@(AuthApiKeyApiKey secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + else req -toPath - :: WH.ToHttpApiData a - => a -> BCL.ByteString -toPath = BB.toLazyByteString . WH.toEncodedUrlPiece +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) -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)] +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + else req -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 - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') - -toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] -toHeaderColl c xs = _toColl c toHeader xs +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + 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) -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) +instance AuthMethod AuthOAuthPetstoreAuth where + applyAuthMethod req a@(AuthOAuthPetstoreAuth secret) = + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + else req -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 - {-# 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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - --- * AuthMethods - --- | Provides a method to apply auth methods to requests -class P.Typeable a => AuthMethod a where - applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res - --- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) - -instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a - --- ** AuthApiKeyApiKey -data AuthApiKeyApiKey = - AuthApiKeyApiKey Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod req a@(AuthApiKeyApiKey secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - else req - --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - 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 req a@(AuthOAuthPetstoreAuth secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - else req - - - \ No newline at end of file + + \ 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 c2683fa528d..f47f1bee7da 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 @@ -3,294 +3,295 @@ 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: 1.0.0 + 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.Client -} - -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE DeriveFoldable #-} -{-# LANGUAGE DeriveTraversable #-} -{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.Client where - -import SwaggerPetstore.Model -import SwaggerPetstore.API -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Logging - -import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A -import qualified Data.Aeson.Types as A -import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Data.Time as TI -import qualified Data.Map as Map -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB -import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH -import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH - -import qualified Control.Exception.Safe as E --- * Config - --- | -data SwaggerPetstoreConfig = SwaggerPetstoreConfig - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance - , configLogContext :: LogContext -- ^ Configures the logger - , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods - } - --- | display the config -instance Show SwaggerPetstoreConfig where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default SwaggerPetstoreConfig --- --- configHost: --- --- @http://petstore.swagger.io:80/v2@ --- --- configUserAgent: --- --- @"swagger-haskell-http-client/1.0.0"@ --- -newConfig :: IO SwaggerPetstoreConfig -newConfig = do - logCxt <- initLogContext - return $ SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io:80/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt - , configAuthMethods = [] - } - --- | updates config use AuthMethod on matching requests -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 } - --- | updates the config to use stderr logging -withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig -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} - --- * Dispatch - --- ** Lbs - --- | send a request returning the raw http response -dispatchLbs - :: (Produces req accept, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- ** Mime - --- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response - } - deriving (Show, Functor, Foldable, Traversable) - --- | pair of unrender/parser error and http response -data MimeError = - MimeError { - mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response - } deriving (Eq, Show) - --- | send a request returning the 'MimeResult' -dispatchMime - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do case mimeUnrender' 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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - 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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- | dispatch an InitRequest -dispatchInitUnsafe - :: NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> 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 - where - 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) - _ -> "<RequestBody>") - 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 - { unInitRequest :: NH.Request - } deriving (Show) - --- | Build an http-client 'Request' record from the supplied config and request -_toInitRequest - :: (MimeType accept, MimeType contentType) - => SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _applyAuthMethods req0 config - & _setContentTypeHeader - & flip _setAcceptHeader accept - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) 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) - --- | apply all matching AuthMethods in config to request -_applyAuthMethods - :: SwaggerPetstoreRequest req contentType res - -> SwaggerPetstoreConfig - -> SwaggerPetstoreRequest req contentType res -_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = - foldl go req as - where - go r (AnyAuthMethod a) = r `applyAuthMethod` a - --- | 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) - --- | 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) - --- ** Logging - --- | Run a block using the configured logger instance -runConfigLog - :: 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 - \ No newline at end of file + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveTraversable #-} +{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.Client where + +import SwaggerPetstore.Model +import SwaggerPetstore.API +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Logging + +import qualified Control.Monad.IO.Class as P +import qualified Data.Aeson as A +import qualified Data.Aeson.Types as A +import qualified Data.Proxy as P (Proxy(..)) +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) +import Web.FormUrlEncoded as WH +import Web.HttpApiData as WH +import Control.Monad.Catch (MonadThrow) + +import qualified Data.Time as TI +import qualified Data.Map as Map +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Text.Printf as T + +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.ByteString.Builder as BB +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Client.TLS as NH +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types.Method as NH +import qualified Network.HTTP.Types as NH +import qualified Network.HTTP.Types.URI as NH + +import qualified Control.Exception.Safe as E +-- * Config + +-- | +data SwaggerPetstoreConfig = SwaggerPetstoreConfig + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods + } + +-- | display the config +instance Show SwaggerPetstoreConfig where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default SwaggerPetstoreConfig +-- +-- configHost: +-- +-- @http://petstore.swagger.io:80/v2@ +-- +-- configUserAgent: +-- +-- @"swagger-haskell-http-client/1.0.0"@ +-- +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io:80/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + , configAuthMethods = [] + } + +-- | updates config use AuthMethod on matching requests +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 } + +-- | updates the config to use stderr logging +withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +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} + +-- * Dispatch + +-- ** Lbs + +-- | send a request returning the raw http response +dispatchLbs + :: (Produces req accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- ** Mime + +-- | pair of decoded http body and http response +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + } + deriving (Show, Functor, Foldable, Traversable) + +-- | pair of unrender/parser error and http response +data MimeError = + MimeError { + mimeError :: String -- ^ unrender/parser error + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + } deriving (Eq, Show) + +-- | send a request returning the 'MimeResult' +dispatchMime + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> 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 + where + 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) + _ -> "<RequestBody>") + 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 + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = do + parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + let req1 = _applyAuthMethods req0 config + & _setContentTypeHeader + & flip _setAcceptHeader accept + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) + reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) + pReq = parsedReq { NH.method = (rMethod req1) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery + } + outReq <- case paramsBody (rParams req1) 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) + +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: SwaggerPetstoreRequest req contentType res + -> SwaggerPetstoreConfig + -> SwaggerPetstoreRequest req contentType res +_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = + foldl go req as + where + go r (AnyAuthMethod a) = r `applyAuthMethod` a + +-- | 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) + +-- | 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) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: 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 + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html index 8b8a1e21917..8457b7f4eaf 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html @@ -3,639 +3,640 @@ 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: 1.0.0 + 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.Lens -} - -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE RecordWildCards #-} -{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.Lens where - -import qualified Data.Aeson as A -import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Data, Typeable) -import qualified Data.Map as Map -import qualified Data.Set as Set -import qualified Data.Time as TI - -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 - -import SwaggerPetstore.Model - --- * 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 - + +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.Lens where + +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Data, Typeable) +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Time as TI + +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 + +import SwaggerPetstore.Model + +-- * 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 --- * AdditionalPropertiesClass - --- | 'additionalPropertiesClassMapProperty' Lens -additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -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 -{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} - + +-- * AdditionalPropertiesClass + +-- | 'additionalPropertiesClassMapProperty' Lens +additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) +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 +{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} --- * Animal - --- | 'animalClassName' Lens -animalClassNameL :: Lens_' Animal (Text) -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 -{-# INLINE animalColorL #-} - + +-- * Animal + +-- | 'animalClassName' Lens +animalClassNameL :: Lens_' Animal (Text) +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 +{-# INLINE animalColorL #-} --- * AnimalFarm - + +-- * AnimalFarm --- * ApiResponse - --- | 'apiResponseCode' Lens -apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -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 -{-# INLINE apiResponseTypeL #-} - --- | 'apiResponseMessage' Lens -apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage -{-# INLINE apiResponseMessageL #-} - + +-- * ApiResponse + +-- | 'apiResponseCode' Lens +apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) +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 +{-# INLINE apiResponseTypeL #-} + +-- | 'apiResponseMessage' Lens +apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +{-# INLINE apiResponseMessageL #-} --- * ArrayOfArrayOfNumberOnly - --- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens -arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) -arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber -{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} - + +-- * ArrayOfArrayOfNumberOnly + +-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens +arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} --- * ArrayOfNumberOnly - --- | 'arrayOfNumberOnlyArrayNumber' Lens -arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) -arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber -{-# INLINE arrayOfNumberOnlyArrayNumberL #-} - + +-- * ArrayOfNumberOnly + +-- | 'arrayOfNumberOnlyArrayNumber' Lens +arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +{-# INLINE arrayOfNumberOnlyArrayNumberL #-} --- * ArrayTest - --- | 'arrayTestArrayOfString' Lens -arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) -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 -{-# INLINE arrayTestArrayArrayOfIntegerL #-} - --- | 'arrayTestArrayArrayOfModel' Lens -arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) -arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel -{-# INLINE arrayTestArrayArrayOfModelL #-} - + +-- * ArrayTest + +-- | 'arrayTestArrayOfString' Lens +arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) +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 +{-# INLINE arrayTestArrayArrayOfIntegerL #-} + +-- | 'arrayTestArrayArrayOfModel' Lens +arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +{-# INLINE arrayTestArrayArrayOfModelL #-} --- * Capitalization - --- | 'capitalizationSmallCamel' Lens -capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) -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 -{-# INLINE capitalizationCapitalCamelL #-} - --- | 'capitalizationSmallSnake' Lens -capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) -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 -{-# INLINE capitalizationCapitalSnakeL #-} - --- | 'capitalizationScaEthFlowPoints' Lens -capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) -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 -{-# INLINE capitalizationAttNameL #-} - + +-- * Capitalization + +-- | 'capitalizationSmallCamel' Lens +capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalCamelL #-} + +-- | 'capitalizationSmallSnake' Lens +capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationCapitalSnakeL #-} + +-- | 'capitalizationScaEthFlowPoints' Lens +capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) +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 +{-# INLINE capitalizationAttNameL #-} --- * Category - --- | 'categoryId' Lens -categoryIdL :: Lens_' Category (Maybe Integer) -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 -{-# INLINE categoryNameL #-} - + +-- * Category + +-- | 'categoryId' Lens +categoryIdL :: Lens_' Category (Maybe Integer) +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 +{-# INLINE categoryNameL #-} --- * ClassModel - --- | 'classModelClass' Lens -classModelClassL :: Lens_' ClassModel (Maybe Text) -classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass -{-# INLINE classModelClassL #-} - + +-- * ClassModel + +-- | 'classModelClass' Lens +classModelClassL :: Lens_' ClassModel (Maybe Text) +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +{-# INLINE classModelClassL #-} --- * Client - --- | 'clientClient' Lens -clientClientL :: Lens_' Client (Maybe Text) -clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient -{-# INLINE clientClientL #-} - + +-- * Client + +-- | 'clientClient' Lens +clientClientL :: Lens_' Client (Maybe Text) +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +{-# INLINE clientClientL #-} --- * EnumArrays - --- | 'enumArraysJustSymbol' Lens -enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text) -enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol -{-# INLINE enumArraysJustSymbolL #-} - --- | 'enumArraysArrayEnum' Lens -enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text]) -enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum -{-# INLINE enumArraysArrayEnumL #-} - + +-- * EnumArrays + +-- | 'enumArraysJustSymbol' Lens +enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text) +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +{-# INLINE enumArraysJustSymbolL #-} + +-- | 'enumArraysArrayEnum' Lens +enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text]) +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +{-# INLINE enumArraysArrayEnumL #-} --- * EnumClass - + +-- * EnumClass --- * EnumTest - --- | 'enumTestEnumString' Lens -enumTestEnumStringL :: Lens_' EnumTest (Maybe Text) -enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString -{-# INLINE enumTestEnumStringL #-} - --- | 'enumTestEnumInteger' Lens -enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int) -enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger -{-# INLINE enumTestEnumIntegerL #-} - --- | 'enumTestEnumNumber' Lens -enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double) -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 -{-# INLINE enumTestOuterEnumL #-} - + +-- * EnumTest + +-- | 'enumTestEnumString' Lens +enumTestEnumStringL :: Lens_' EnumTest (Maybe Text) +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +{-# INLINE enumTestEnumStringL #-} + +-- | 'enumTestEnumInteger' Lens +enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int) +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +{-# INLINE enumTestEnumIntegerL #-} + +-- | 'enumTestEnumNumber' Lens +enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double) +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 +{-# INLINE enumTestOuterEnumL #-} --- * FormatTest - --- | 'formatTestInteger' Lens -formatTestIntegerL :: Lens_' FormatTest (Maybe Int) -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 -{-# INLINE formatTestInt32L #-} - --- | 'formatTestInt64' Lens -formatTestInt64L :: Lens_' FormatTest (Maybe Integer) -formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 -{-# INLINE formatTestInt64L #-} - --- | 'formatTestNumber' Lens -formatTestNumberL :: Lens_' FormatTest (Double) -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 -{-# INLINE formatTestFloatL #-} - --- | 'formatTestDouble' Lens -formatTestDoubleL :: Lens_' FormatTest (Maybe Double) -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 -{-# INLINE formatTestStringL #-} - --- | 'formatTestByte' Lens -formatTestByteL :: Lens_' FormatTest (ByteArray) -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 -{-# INLINE formatTestBinaryL #-} - --- | 'formatTestDate' Lens -formatTestDateL :: Lens_' FormatTest (Date) -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 -{-# INLINE formatTestDateTimeL #-} - --- | 'formatTestUuid' Lens -formatTestUuidL :: Lens_' FormatTest (Maybe Text) -formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid -{-# INLINE formatTestUuidL #-} - --- | 'formatTestPassword' Lens -formatTestPasswordL :: Lens_' FormatTest (Text) -formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword -{-# INLINE formatTestPasswordL #-} - + +-- * FormatTest + +-- | 'formatTestInteger' Lens +formatTestIntegerL :: Lens_' FormatTest (Maybe Int) +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 +{-# INLINE formatTestInt32L #-} + +-- | 'formatTestInt64' Lens +formatTestInt64L :: Lens_' FormatTest (Maybe Integer) +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +{-# INLINE formatTestInt64L #-} + +-- | 'formatTestNumber' Lens +formatTestNumberL :: Lens_' FormatTest (Double) +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 +{-# INLINE formatTestFloatL #-} + +-- | 'formatTestDouble' Lens +formatTestDoubleL :: Lens_' FormatTest (Maybe Double) +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 +{-# INLINE formatTestStringL #-} + +-- | 'formatTestByte' Lens +formatTestByteL :: Lens_' FormatTest (ByteArray) +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 +{-# INLINE formatTestBinaryL #-} + +-- | 'formatTestDate' Lens +formatTestDateL :: Lens_' FormatTest (Date) +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 +{-# INLINE formatTestDateTimeL #-} + +-- | 'formatTestUuid' Lens +formatTestUuidL :: Lens_' FormatTest (Maybe Text) +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +{-# INLINE formatTestUuidL #-} + +-- | 'formatTestPassword' Lens +formatTestPasswordL :: Lens_' FormatTest (Text) +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +{-# INLINE formatTestPasswordL #-} --- * HasOnlyReadOnly - --- | 'hasOnlyReadOnlyBar' Lens -hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) -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 -{-# INLINE hasOnlyReadOnlyFooL #-} - + +-- * HasOnlyReadOnly + +-- | 'hasOnlyReadOnlyBar' Lens +hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) +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 +{-# INLINE hasOnlyReadOnlyFooL #-} --- * MapTest - --- | 'mapTestMapMapOfString' Lens -mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) -mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString -{-# INLINE mapTestMapMapOfStringL #-} - --- | 'mapTestMapOfEnumString' Lens -mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text)) -mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString -{-# INLINE mapTestMapOfEnumStringL #-} - + +-- * MapTest + +-- | 'mapTestMapMapOfString' Lens +mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +{-# INLINE mapTestMapMapOfStringL #-} + +-- | 'mapTestMapOfEnumString' Lens +mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text)) +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +{-# INLINE mapTestMapOfEnumStringL #-} --- * MixedPropertiesAndAdditionalPropertiesClass - --- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens -mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) -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 -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} - --- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens -mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) -mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap -{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} - + +-- * MixedPropertiesAndAdditionalPropertiesClass + +-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens +mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) +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 +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} + +-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens +mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} --- * Model200Response - --- | 'model200ResponseName' Lens -model200ResponseNameL :: Lens_' Model200Response (Maybe Int) -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 -{-# INLINE model200ResponseClassL #-} - + +-- * Model200Response + +-- | 'model200ResponseName' Lens +model200ResponseNameL :: Lens_' Model200Response (Maybe Int) +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 +{-# INLINE model200ResponseClassL #-} --- * ModelList - --- | 'modelList123List' Lens -modelList123ListL :: Lens_' ModelList (Maybe Text) -modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List -{-# INLINE modelList123ListL #-} - + +-- * ModelList + +-- | 'modelList123List' Lens +modelList123ListL :: Lens_' ModelList (Maybe Text) +modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List +{-# INLINE modelList123ListL #-} --- * ModelReturn - --- | 'modelReturnReturn' Lens -modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) -modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn -{-# INLINE modelReturnReturnL #-} - + +-- * ModelReturn + +-- | 'modelReturnReturn' Lens +modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +{-# INLINE modelReturnReturnL #-} --- * Name - --- | 'nameName' Lens -nameNameL :: Lens_' Name (Int) -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 -{-# INLINE nameSnakeCaseL #-} - --- | 'nameProperty' Lens -namePropertyL :: Lens_' Name (Maybe Text) -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 -{-# INLINE name123NumberL #-} - + +-- * Name + +-- | 'nameName' Lens +nameNameL :: Lens_' Name (Int) +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 +{-# INLINE nameSnakeCaseL #-} + +-- | 'nameProperty' Lens +namePropertyL :: Lens_' Name (Maybe Text) +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 +{-# INLINE name123NumberL #-} --- * NumberOnly - --- | 'numberOnlyJustNumber' Lens -numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) -numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber -{-# INLINE numberOnlyJustNumberL #-} - + +-- * NumberOnly + +-- | 'numberOnlyJustNumber' Lens +numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +{-# INLINE numberOnlyJustNumberL #-} --- * Order - --- | 'orderId' Lens -orderIdL :: Lens_' Order (Maybe Integer) -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 -{-# INLINE orderPetIdL #-} - --- | 'orderQuantity' Lens -orderQuantityL :: Lens_' Order (Maybe Int) -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 -{-# INLINE orderShipDateL #-} - --- | 'orderStatus' Lens -orderStatusL :: Lens_' Order (Maybe Text) -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 -{-# INLINE orderCompleteL #-} - + +-- * Order + +-- | 'orderId' Lens +orderIdL :: Lens_' Order (Maybe Integer) +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 +{-# INLINE orderPetIdL #-} + +-- | 'orderQuantity' Lens +orderQuantityL :: Lens_' Order (Maybe Int) +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 +{-# INLINE orderShipDateL #-} + +-- | 'orderStatus' Lens +orderStatusL :: Lens_' Order (Maybe Text) +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 +{-# INLINE orderCompleteL #-} --- * OuterBoolean - + +-- * OuterBoolean --- * OuterComposite - --- | 'outerCompositeMyNumber' Lens -outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber) -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 -{-# INLINE outerCompositeMyStringL #-} - --- | 'outerCompositeMyBoolean' Lens -outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean) -outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean -{-# INLINE outerCompositeMyBooleanL #-} - + +-- * OuterComposite + +-- | 'outerCompositeMyNumber' Lens +outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber) +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 +{-# INLINE outerCompositeMyStringL #-} + +-- | 'outerCompositeMyBoolean' Lens +outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean) +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +{-# INLINE outerCompositeMyBooleanL #-} --- * OuterEnum - + +-- * OuterEnum --- * OuterNumber - + +-- * OuterNumber --- * OuterString - + +-- * OuterString --- * Pet - --- | 'petId' Lens -petIdL :: Lens_' Pet (Maybe Integer) -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 -{-# INLINE petCategoryL #-} - --- | 'petName' Lens -petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName -{-# INLINE petNameL #-} - --- | 'petPhotoUrls' Lens -petPhotoUrlsL :: Lens_' Pet ([Text]) -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 -{-# INLINE petTagsL #-} - --- | 'petStatus' Lens -petStatusL :: Lens_' Pet (Maybe Text) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus -{-# INLINE petStatusL #-} - + +-- * Pet + +-- | 'petId' Lens +petIdL :: Lens_' Pet (Maybe Integer) +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 +{-# INLINE petCategoryL #-} + +-- | 'petName' Lens +petNameL :: Lens_' Pet (Text) +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +{-# INLINE petNameL #-} + +-- | 'petPhotoUrls' Lens +petPhotoUrlsL :: Lens_' Pet ([Text]) +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 +{-# INLINE petTagsL #-} + +-- | 'petStatus' Lens +petStatusL :: Lens_' Pet (Maybe Text) +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +{-# INLINE petStatusL #-} --- * ReadOnlyFirst - --- | 'readOnlyFirstBar' Lens -readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) -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 -{-# INLINE readOnlyFirstBazL #-} - + +-- * ReadOnlyFirst + +-- | 'readOnlyFirstBar' Lens +readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) +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 +{-# INLINE readOnlyFirstBazL #-} --- * SpecialModelName - --- | 'specialModelNameSpecialPropertyName' Lens -specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) -specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName -{-# INLINE specialModelNameSpecialPropertyNameL #-} - + +-- * SpecialModelName + +-- | 'specialModelNameSpecialPropertyName' Lens +specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +{-# INLINE specialModelNameSpecialPropertyNameL #-} --- * Tag - --- | 'tagId' Lens -tagIdL :: Lens_' Tag (Maybe Integer) -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 -{-# INLINE tagNameL #-} - + +-- * Tag + +-- | 'tagId' Lens +tagIdL :: Lens_' Tag (Maybe Integer) +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 +{-# INLINE tagNameL #-} --- * User - --- | 'userId' Lens -userIdL :: Lens_' User (Maybe Integer) -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 -{-# INLINE userUsernameL #-} - --- | 'userFirstName' Lens -userFirstNameL :: Lens_' User (Maybe Text) -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 -{-# INLINE userLastNameL #-} - --- | 'userEmail' Lens -userEmailL :: Lens_' User (Maybe Text) -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 -{-# INLINE userPasswordL #-} - --- | 'userPhone' Lens -userPhoneL :: Lens_' User (Maybe Text) -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 -{-# INLINE userUserStatusL #-} - + +-- * User + +-- | 'userId' Lens +userIdL :: Lens_' User (Maybe Integer) +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 +{-# INLINE userUsernameL #-} + +-- | 'userFirstName' Lens +userFirstNameL :: Lens_' User (Maybe Text) +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 +{-# INLINE userLastNameL #-} + +-- | 'userEmail' Lens +userEmailL :: Lens_' User (Maybe Text) +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 +{-# INLINE userPasswordL #-} + +-- | 'userPhone' Lens +userPhoneL :: Lens_' User (Maybe Text) +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 +{-# INLINE userUserStatusL #-} --- * Cat - --- | 'catClassName' Lens -catClassNameL :: Lens_' Cat (Text) -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 -{-# INLINE catColorL #-} - --- | 'catDeclawed' Lens -catDeclawedL :: Lens_' Cat (Maybe Bool) -catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed -{-# INLINE catDeclawedL #-} - + +-- * Cat + +-- | 'catClassName' Lens +catClassNameL :: Lens_' Cat (Text) +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 +{-# INLINE catColorL #-} + +-- | 'catDeclawed' Lens +catDeclawedL :: Lens_' Cat (Maybe Bool) +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +{-# INLINE catDeclawedL #-} --- * Dog - --- | 'dogClassName' Lens -dogClassNameL :: Lens_' Dog (Text) -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 -{-# INLINE dogColorL #-} - --- | 'dogBreed' Lens -dogBreedL :: Lens_' Dog (Maybe Text) -dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed -{-# INLINE dogBreedL #-} - + +-- * Dog + +-- | 'dogClassName' Lens +dogClassNameL :: Lens_' Dog (Text) +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 +{-# INLINE dogColorL #-} + +-- | 'dogBreed' Lens +dogBreedL :: Lens_' Dog (Maybe Text) +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +{-# INLINE dogBreedL #-} - \ No newline at end of file + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html index 5877ed4c1c7..ea28ef3ce77 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -3,117 +3,118 @@ 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: 1.0.0 + 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.Logging Katip Logging functions -} - -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - -module SwaggerPetstore.Logging where - -import Data.Text (Text) -import GHC.Exts (IsString(..)) - -import qualified Control.Exception.Safe as E -import qualified Control.Monad.IO.Class as P -import qualified Control.Monad.Trans.Reader as P -import qualified Data.Text as T -import qualified Lens.Micro as L -import qualified System.IO as IO - -import qualified Katip as LG - --- * Type Aliases (for compatability) - --- | Runs a Katip logging block with the Log environment -type LogExecWithContext = forall m. P.MonadIO m => - LogContext -> LogExec m - --- | A Katip logging block -type LogExec m = forall a. LG.KatipT m a -> m a - --- | A Katip Log environment -type LogContext = LG.LogEnv - --- | A Katip Log severity -type LogLevel = LG.Severity - --- * default logger - --- | the default log environment -initLogContext :: IO LogContext -initLogContext = LG.initLogEnv "SwaggerPetstore" "dev" - --- | Runs a Katip logging block with the Log environment -runDefaultLogExecWithContext :: LogExecWithContext -runDefaultLogExecWithContext = LG.runKatipT - --- * stdout logger - --- | Runs a Katip logging block with the Log environment -stdoutLoggingExec :: LogExecWithContext -stdoutLoggingExec = runDefaultLogExecWithContext - --- | A Katip Log environment which targets stdout -stdoutLoggingContext :: LogContext -> IO LogContext -stdoutLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 - LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt - --- * stderr logger - --- | Runs a Katip logging block with the Log environment -stderrLoggingExec :: LogExecWithContext -stderrLoggingExec = runDefaultLogExecWithContext - --- | A Katip Log environment which targets stderr -stderrLoggingContext :: LogContext -> IO LogContext -stderrLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 - LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt - --- * Null logger - --- | Disables Katip logging -runNullLogExec :: LogExecWithContext -runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) - --- * Log Msg - --- | Log a katip message -_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () -_log src level msg = do - LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) - --- * Log Exceptions - --- | re-throws exceptions after logging them -logExceptions - :: (LG.Katip m, E.MonadCatch m, Applicative m) - => Text -> m a -> m a -logExceptions src = - E.handle - (\(e :: E.SomeException) -> do - _log src LG.ErrorS ((T.pack . show) e) - E.throw e) - --- * Log Level - -levelInfo :: LogLevel -levelInfo = LG.InfoS - -levelError :: LogLevel -levelError = LG.ErrorS - -levelDebug :: LogLevel -levelDebug = LG.DebugS - - \ No newline at end of file + +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module SwaggerPetstore.Logging where + +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import qualified Katip as LG + +-- * Type Aliases (for compatability) + +-- | Runs a Katip logging block with the Log environment +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m + +-- | A Katip logging block +type LogExec m = forall a. LG.KatipT m a -> m a + +-- | A Katip Log environment +type LogContext = LG.LogEnv + +-- | A Katip Log severity +type LogLevel = LG.Severity + +-- * default logger + +-- | the default log environment +initLogContext :: IO LogContext +initLogContext = LG.initLogEnv "SwaggerPetstore" "dev" + +-- | Runs a Katip logging block with the Log environment +runDefaultLogExecWithContext :: LogExecWithContext +runDefaultLogExecWithContext = LG.runKatipT + +-- * stdout logger + +-- | Runs a Katip logging block with the Log environment +stdoutLoggingExec :: LogExecWithContext +stdoutLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stdout +stdoutLoggingContext :: LogContext -> IO LogContext +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt + +-- * stderr logger + +-- | Runs a Katip logging block with the Log environment +stderrLoggingExec :: LogExecWithContext +stderrLoggingExec = runDefaultLogExecWithContext + +-- | A Katip Log environment which targets stderr +stderrLoggingContext :: LogContext -> IO LogContext +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt + +-- * Null logger + +-- | Disables Katip logging +runNullLogExec :: LogExecWithContext +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) + +-- * Log Msg + +-- | Log a katip message +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) + +-- * Log Exceptions + +-- | re-throws exceptions after logging them +logExceptions + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = + E.handle + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) + +-- * Log Level + +levelInfo :: LogLevel +levelInfo = LG.InfoS + +levelError :: LogLevel +levelError = LG.ErrorS + +levelDebug :: LogLevel +levelDebug = LG.DebugS + + \ 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 2b02c676a81..ac47e939b1a 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 @@ -3,227 +3,228 @@ 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: 1.0.0 + 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.MimeTypes -} - -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.MimeTypes where - -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.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL - + +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.MimeTypes where + +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.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Network.HTTP.Media as ME - -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import qualified Data.Data as P (Typeable) -import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Text as T -import qualified Data.String as P -import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) - -import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) -import qualified Prelude as P - --- * Content Negotiation - --- | A type for responses without content-body. -data NoContent = NoContent - deriving (P.Show, P.Eq) - --- ** Mime Types - -data MimeJSON = MimeJSON deriving (P.Typeable) -data MimeXML = MimeXML deriving (P.Typeable) -data MimePlainText = MimePlainText deriving (P.Typeable) -data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) -data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) -data MimeOctetStream = MimeOctetStream deriving (P.Typeable) -data MimeNoContent = MimeNoContent deriving (P.Typeable) -data MimeAny = MimeAny deriving (P.Typeable) - -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +import qualified Network.HTTP.Media as ME + +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import qualified Data.Data as P (Typeable) +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.String as P +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) + +import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) +import qualified Prelude as P + +-- * Content Negotiation + +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq) + +-- ** Mime Types + +data MimeJSON = MimeJSON deriving (P.Typeable) +data MimeXML = MimeXML deriving (P.Typeable) +data MimePlainText = MimePlainText deriving (P.Typeable) +data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) +data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) +data MimeOctetStream = MimeOctetStream deriving (P.Typeable) +data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) + data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) - --- ** MimeType Class - -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] - Nothing -> [] - - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of - [] -> Nothing - (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 Instances - --- | @application/json; charset=utf-8@ -instance MimeType MimeJSON where - mimeType _ = Just $ P.fromString "application/json" --- | @application/xml; charset=utf-8@ -instance MimeType MimeXML where - mimeType _ = Just $ P.fromString "application/xml" --- | @application/x-www-form-urlencoded@ -instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" --- | @multipart/form-data@ -instance MimeType MimeMultipartFormData where - mimeType _ = Just $ P.fromString "multipart/form-data" --- | @text/plain; charset=utf-8@ -instance MimeType MimePlainText where - mimeType _ = Just $ P.fromString "text/plain" --- | @application/octet-stream@ -instance MimeType MimeOctetStream where - mimeType _ = Just $ P.fromString "application/octet-stream" --- | @"*/*"@ -instance MimeType MimeAny where - mimeType _ = Just $ P.fromString "*/*" -instance MimeType MimeNoContent where - mimeType _ = Nothing - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" - --- | @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 - +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +-- ** MimeType Class + +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] + Nothing -> [] + + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of + [] -> Nothing + (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 Instances + +-- | @application/json; charset=utf-8@ +instance MimeType MimeJSON where + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXML where + mimeType _ = Just $ P.fromString "application/xml" +-- | @application/x-www-form-urlencoded@ +instance MimeType MimeFormUrlEncoded where + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" +-- | @multipart/form-data@ +instance MimeType MimeMultipartFormData where + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ +instance MimeType MimePlainText where + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ +instance MimeType MimeOctetStream where + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" +instance MimeType MimeNoContent where + mimeType _ = Nothing + +-- | @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 + +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" --- ** 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 - + +-- ** 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 --- ** MimeRender Instances - --- | `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 - --- | @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 --- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack - --- | @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 --- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack - -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary - -instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData DateTime 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 - -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString -mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam - --- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty - --- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec --- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec --- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec --- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec - --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined + +-- ** MimeRender Instances + +-- | `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 + +-- | @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 +-- | @BCL.pack@ +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack + +-- | @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 +-- | @BCL.pack@ +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack + +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary + +instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData DateTime 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 + +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam + +-- | @P.Right . P.const NoContent@ +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty + +-- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec +-- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec +-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec +-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec + -- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined - --- ** 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 - --- ** MimeUnrender Instances - --- | @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 --- | @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 --- | @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 --- | @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 - --- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent - --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined + +-- ** 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 + +-- ** MimeUnrender Instances + +-- | @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 +-- | @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 +-- | @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 +-- | @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 + +-- | @P.Right . P.const NoContent@ +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + -- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** Request Consumes - -class MimeType mtype => Consumes req mtype where - --- ** Request Produces - -class MimeType mtype => Produces req mtype where - \ No newline at end of file +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** Request Consumes + +class MimeType mtype => Consumes req mtype where + +-- ** Request Produces + +class MimeType mtype => Produces req mtype where + \ 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 cbb9e734385..377c500d2f9 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 @@ -3,1536 +3,1576 @@ 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: 1.0.0 + 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.Model -} - -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveFoldable #-} -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE TypeFamilies #-} -{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.Model where - -import Data.Aeson ((.:),(.:!),(.:?),(.=)) - -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Base64.Lazy as BL64 -import qualified Data.Data as P (Data, Typeable) -import qualified Data.HashMap.Lazy as HM -import qualified Data.Map as Map -import qualified Data.Set as Set -import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH -import qualified Control.DeepSeq as NF -import qualified Data.Ix as P -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) -import Data.Text (Text) - -import qualified Data.Time as TI -import qualified Data.Time.ISO8601 as TI - -import Control.Applicative ((<|>)) -import Control.Applicative (Alternative) -import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P - + +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.Model where + +import Data.Aeson ((.:),(.:!),(.:?),(.=)) + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Base64.Lazy as BL64 +import qualified Data.Data as P (Data, Typeable) +import qualified Data.HashMap.Lazy as HM +import qualified Data.Map as Map +import qualified Data.Set as Set +import qualified Data.Maybe as P +import qualified Data.Foldable as P +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH +import qualified Control.DeepSeq as NF +import qualified Data.Ix as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Control.Arrow as P (left) +import Data.Text (Text) + +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 as TI + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +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 - + +-- * 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) - + +-- ** 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 - ] - + +-- | 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 - } - - --- ** Animal --- | Animal -data Animal = Animal - { animalClassName :: !(Text) -- ^ /Required/ "className" - , animalColor :: !(Maybe Text) -- ^ "color" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) +mkAdditionalPropertiesClass + :: AdditionalPropertiesClass +mkAdditionalPropertiesClass = + AdditionalPropertiesClass + { additionalPropertiesClassMapProperty = Nothing + , additionalPropertiesClassMapOfMapProperty = Nothing + } + + +-- ** 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 - ] - + +-- | 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) - + +-- | 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 - - --- | ToJSON AnimalFarm -instance A.ToJSON AnimalFarm where - toJSON AnimalFarm = - _omitNulls - [ - ] - + +-- | FromJSON AnimalFarm +instance A.FromJSON AnimalFarm where + parseJSON = A.withObject "AnimalFarm" $ \o -> + pure AnimalFarm + + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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) --- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 '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) - + +-- | 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") - --- | ToJSON ClassModel -instance A.ToJSON ClassModel where - toJSON ClassModel {..} = - _omitNulls - [ "_class" .= classModelClass - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 Text) -- ^ "just_symbol" - , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | 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 Text) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "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 - ] - + +-- | 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 - } - - --- ** EnumClass --- | EnumClass -data EnumClass = EnumClass - { - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) +mkEnumArrays + :: EnumArrays +mkEnumArrays = + EnumArrays + { enumArraysJustSymbol = Nothing + , enumArraysArrayEnum = Nothing + } + + +-- ** EnumClass +-- | EnumClass +data EnumClass = EnumClass + { + } deriving (P.Show,P.Eq,P.Typeable) --- | FromJSON EnumClass -instance A.FromJSON EnumClass where - parseJSON = A.withObject "EnumClass" $ \o -> - pure EnumClass - - --- | ToJSON EnumClass -instance A.ToJSON EnumClass where - toJSON EnumClass = - _omitNulls - [ - ] - + +-- | FromJSON EnumClass +instance A.FromJSON EnumClass where + parseJSON = A.withObject "EnumClass" $ \o -> + pure EnumClass + + +-- | ToJSON EnumClass +instance A.ToJSON EnumClass where + toJSON EnumClass = + _omitNulls + [ + ] --- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) -mkEnumClass - :: EnumClass -mkEnumClass = - EnumClass - { - } - - --- ** EnumTest --- | EnumTest -data EnumTest = EnumTest - { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" - , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" - , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number" - , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) +mkEnumClass + :: EnumClass +mkEnumClass = + EnumClass + { + } + + +-- ** EnumTest +-- | EnumTest +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" + , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe Double) -- ^ "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 EnumTest -instance A.ToJSON EnumTest where - toJSON EnumTest {..} = - _omitNulls - [ "enum_string" .= enumTestEnumString - , "enum_integer" .= enumTestEnumInteger - , "enum_number" .= enumTestEnumNumber - , "outerEnum" .= enumTestOuterEnum - ] - + +-- | 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 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 - } - - --- ** 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 '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) --- | 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 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 - ] - + +-- | 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 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 '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") - --- | ToJSON HasOnlyReadOnly -instance A.ToJSON HasOnlyReadOnly where - toJSON HasOnlyReadOnly {..} = - _omitNulls - [ "bar" .= hasOnlyReadOnlyBar - , "foo" .= hasOnlyReadOnlyFoo - ] - + +-- | 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 + ] --- | 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 Text)) -- ^ "map_of_enum_string" - } 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 Text)) -- ^ "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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 Text) -- ^ "status" - Order Status - , orderComplete :: !(Maybe Bool) -- ^ "complete" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | 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 Text) -- ^ "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 - ] - + +-- | 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 -data OuterBoolean = OuterBoolean - { - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | 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 +data OuterBoolean = OuterBoolean + { + } deriving (P.Show,P.Eq,P.Typeable) --- | FromJSON OuterBoolean -instance A.FromJSON OuterBoolean where - parseJSON = A.withObject "OuterBoolean" $ \o -> - pure OuterBoolean - - --- | ToJSON OuterBoolean -instance A.ToJSON OuterBoolean where - toJSON OuterBoolean = - _omitNulls - [ - ] - + +-- | FromJSON OuterBoolean +instance A.FromJSON OuterBoolean where + parseJSON = A.withObject "OuterBoolean" $ \o -> + pure OuterBoolean + + +-- | ToJSON OuterBoolean +instance A.ToJSON OuterBoolean where + toJSON OuterBoolean = + _omitNulls + [ + ] --- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) -mkOuterBoolean - :: OuterBoolean -mkOuterBoolean = - OuterBoolean - { - } - - --- ** 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) - + +-- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) +mkOuterBoolean + :: OuterBoolean +mkOuterBoolean = + OuterBoolean + { + } + + +-- ** 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 - ] - + +-- | 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 - } - - --- ** OuterEnum --- | OuterEnum -data OuterEnum = OuterEnum - { - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) +mkOuterComposite + :: OuterComposite +mkOuterComposite = + OuterComposite + { outerCompositeMyNumber = Nothing + , outerCompositeMyString = Nothing + , outerCompositeMyBoolean = Nothing + } + + +-- ** OuterEnum +-- | OuterEnum +data OuterEnum = OuterEnum + { + } deriving (P.Show,P.Eq,P.Typeable) --- | FromJSON OuterEnum -instance A.FromJSON OuterEnum where - parseJSON = A.withObject "OuterEnum" $ \o -> - pure OuterEnum - - --- | ToJSON OuterEnum -instance A.ToJSON OuterEnum where - toJSON OuterEnum = - _omitNulls - [ - ] - + +-- | FromJSON OuterEnum +instance A.FromJSON OuterEnum where + parseJSON = A.withObject "OuterEnum" $ \o -> + pure OuterEnum + + +-- | ToJSON OuterEnum +instance A.ToJSON OuterEnum where + toJSON OuterEnum = + _omitNulls + [ + ] --- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) -mkOuterEnum - :: OuterEnum -mkOuterEnum = - OuterEnum - { - } - - --- ** OuterNumber --- | OuterNumber -data OuterNumber = OuterNumber - { - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) +mkOuterEnum + :: OuterEnum +mkOuterEnum = + OuterEnum + { + } + + +-- ** OuterNumber +-- | OuterNumber +data OuterNumber = OuterNumber + { + } deriving (P.Show,P.Eq,P.Typeable) --- | FromJSON OuterNumber -instance A.FromJSON OuterNumber where - parseJSON = A.withObject "OuterNumber" $ \o -> - pure OuterNumber - - --- | ToJSON OuterNumber -instance A.ToJSON OuterNumber where - toJSON OuterNumber = - _omitNulls - [ - ] - + +-- | FromJSON OuterNumber +instance A.FromJSON OuterNumber where + parseJSON = A.withObject "OuterNumber" $ \o -> + pure OuterNumber + + +-- | ToJSON OuterNumber +instance A.ToJSON OuterNumber where + toJSON OuterNumber = + _omitNulls + [ + ] --- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) -mkOuterNumber - :: OuterNumber -mkOuterNumber = - OuterNumber - { - } - - --- ** OuterString --- | OuterString -data OuterString = OuterString - { - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) +mkOuterNumber + :: OuterNumber +mkOuterNumber = + OuterNumber + { + } + + +-- ** OuterString +-- | OuterString +data OuterString = OuterString + { + } deriving (P.Show,P.Eq,P.Typeable) --- | FromJSON OuterString -instance A.FromJSON OuterString where - parseJSON = A.withObject "OuterString" $ \o -> - pure OuterString - - --- | ToJSON OuterString -instance A.ToJSON OuterString where - toJSON OuterString = - _omitNulls - [ - ] - + +-- | FromJSON OuterString +instance A.FromJSON OuterString where + parseJSON = A.withObject "OuterString" $ \o -> + pure OuterString + + +-- | ToJSON OuterString +instance A.ToJSON OuterString where + toJSON OuterString = + _omitNulls + [ + ] --- | Construct a value of type 'OuterString' (by applying it's required fields, if any) -mkOuterString - :: OuterString -mkOuterString = - OuterString - { - } - - --- ** 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 Text) -- ^ "status" - pet status in the store - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'OuterString' (by applying it's required fields, if any) +mkOuterString + :: OuterString +mkOuterString = + OuterString + { + } + + +-- ** 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 Text) -- ^ "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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 - } - - --- ** SpecialModelName --- | SpecialModelName -data SpecialModelName = SpecialModelName - { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) +mkReadOnlyFirst + :: ReadOnlyFirst +mkReadOnlyFirst = + ReadOnlyFirst + { readOnlyFirstBar = Nothing + , readOnlyFirstBaz = Nothing + } + + +-- ** 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 - } - - --- ** Cat --- | Cat -data Cat = Cat - { catClassName :: !(Text) -- ^ /Required/ "className" - , catColor :: !(Maybe Text) -- ^ "color" - , catDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show,P.Eq,P.Typeable) - + +-- | 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 - ] - + +-- | 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) - + +-- | 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 - ] - + +-- | 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 - } - - --- * 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 - where - 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 - --- | Collapse (Just "") to Nothing -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_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 -{-# INLINE _memptyToNothing #-} - --- * DateTime Formatting - -newtype DateTime = DateTime { unDateTime :: TI.UTCTime } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON DateTime where - parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) -instance A.ToJSON DateTime where - 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) -instance P.Show DateTime where - show (DateTime t) = _showDateTime t + +-- | 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 + } + + +-- * 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 :: Text } deriving (P.Eq, P.Show) +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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) --- | @_parseISO8601@ -_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 = - TI.formatISO8601Millis -{-# INLINE _showDateTime #-} - --- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - -newtype Date = Date { unDate :: TI.Day } - deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON Date where - parseJSON = A.withText "Date" (_readDate . T.unpack) -instance A.ToJSON Date where - 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) -instance P.Show Date where - show (Date t) = _showDate t - --- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_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 TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} - --- * Byte/Binary Formatting - - --- | base64 encoded characters -newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON ByteArray where - parseJSON = A.withText "ByteArray" _readByteArray -instance A.ToJSON ByteArray where - toJSON = A.toJSON . _showByteArray -instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray -instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray -instance P.Show ByteArray where - show = T.unpack . _showByteArray - --- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray -_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readByteArray #-} - --- | show base64 encoded characters -_showByteArray :: ByteArray -> Text -_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray -{-# INLINE _showByteArray #-} +-- * 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 + where + 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 + +-- | Collapse (Just "") to Nothing +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_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 +{-# INLINE _memptyToNothing #-} + +-- * DateTime Formatting + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t + +-- | @_parseISO8601@ +_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 = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +-- | parse an ISO8601 date-time string +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t --- | any sequence of octets -newtype Binary = Binary { unBinary :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON Binary where - parseJSON = A.withText "Binary" _readBinaryBase64 -instance A.ToJSON Binary where - toJSON = A.toJSON . _showBinaryBase64 -instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 -instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 -instance P.Show Binary where - show = T.unpack . _showBinaryBase64 - -_readBinaryBase64 :: Monad m => Text -> m Binary -_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readBinaryBase64 #-} +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_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 TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) -_showBinaryBase64 :: Binary -> Text -_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} - \ No newline at end of file +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} + \ No newline at end of file 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 aa1d021477e..1c21d66d229 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -3,28 +3,29 @@ 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: 1.0.0 + 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 -} - -module SwaggerPetstore - ( module SwaggerPetstore.Client - , module SwaggerPetstore.API - , module SwaggerPetstore.Model - , module SwaggerPetstore.MimeTypes - , module SwaggerPetstore.Lens - , module SwaggerPetstore.Logging - ) where - -import SwaggerPetstore.API -import SwaggerPetstore.Client -import SwaggerPetstore.Model -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens -import SwaggerPetstore.Logging - \ No newline at end of file + +module SwaggerPetstore + ( module SwaggerPetstore.Client + , module SwaggerPetstore.API + , module SwaggerPetstore.Model + , module SwaggerPetstore.MimeTypes + , module SwaggerPetstore.Lens + , module SwaggerPetstore.Logging + ) where + +import SwaggerPetstore.API +import SwaggerPetstore.Client +import SwaggerPetstore.Model +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Lens +import SwaggerPetstore.Logging + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index 6e1700d709b..b159772a9e6 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} 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 1ced8a3c753..9f8dd258b6f 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} @@ -233,11 +234,11 @@ testEndpointParameters -> SwaggerPetstoreRequest TestEndpointParameters contentType res 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) - `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) data TestEndpointParameters @@ -410,8 +411,8 @@ testClassname -> SwaggerPetstoreRequest TestClassname contentType Client testClassname _ body = _mkRequest "PATCH" ["/fake_classname_test"] - `setBodyParam` body `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) + `setBodyParam` body data TestClassname @@ -446,8 +447,8 @@ addPet -> SwaggerPetstoreRequest AddPet contentType res addPet _ body = _mkRequest "POST" ["/pet"] - `setBodyParam` body `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setBodyParam` body data AddPet @@ -482,7 +483,6 @@ deletePet -> SwaggerPetstoreRequest DeletePet MimeNoContent res deletePet (PetId petId) = _mkRequest "DELETE" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data DeletePet @@ -510,8 +510,8 @@ findPetsByStatus -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] findPetsByStatus (Status status) = _mkRequest "GET" ["/pet/findByStatus"] - `setQuery` toQueryColl CommaSeparated ("status", Just status) `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus -- | @application/xml@ @@ -535,8 +535,8 @@ findPetsByTags -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] findPetsByTags (Tags tags) = _mkRequest "GET" ["/pet/findByTags"] - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -562,7 +562,6 @@ getPetById -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet getPetById (PetId petId) = _mkRequest "GET" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) data GetPetById @@ -591,8 +590,8 @@ updatePet -> SwaggerPetstoreRequest UpdatePet contentType res updatePet _ body = _mkRequest "PUT" ["/pet"] - `setBodyParam` body `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setBodyParam` body data UpdatePet @@ -629,7 +628,6 @@ updatePetWithForm -> SwaggerPetstoreRequest UpdatePetWithForm contentType res updatePetWithForm _ (PetId petId) = _mkRequest "POST" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UpdatePetWithForm @@ -670,7 +668,6 @@ uploadFile -> SwaggerPetstoreRequest UploadFile contentType ApiResponse uploadFile _ (PetId petId) = _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UploadFile @@ -709,7 +706,6 @@ deleteOrder -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res deleteOrder (OrderIdText orderId) = _mkRequest "DELETE" ["/store/order/",toPath orderId] - data DeleteOrder -- | @application/xml@ @@ -752,7 +748,6 @@ getOrderById -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order getOrderById (OrderId orderId) = _mkRequest "GET" ["/store/order/",toPath orderId] - data GetOrderById -- | @application/xml@ @@ -892,7 +887,6 @@ deleteUser -> SwaggerPetstoreRequest DeleteUser MimeNoContent res deleteUser (Username username) = _mkRequest "DELETE" ["/user/",toPath username] - data DeleteUser -- | @application/xml@ @@ -914,7 +908,6 @@ getUserByName -> SwaggerPetstoreRequest GetUserByName MimeNoContent User getUserByName (Username username) = _mkRequest "GET" ["/user/",toPath username] - data GetUserByName -- | @application/xml@ @@ -987,7 +980,6 @@ updateUser -> SwaggerPetstoreRequest UpdateUser contentType res updateUser _ (Username username) body = _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body data UpdateUser @@ -1027,81 +1019,6 @@ class HasOptionalParam req param where infixl 2 -&- --- * Request Parameter Types - --- | ApiKey -newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) --- | StatusText -newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) --- | ParamString -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) --- | ParamInteger -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) --- | EnumQueryDouble -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) --- | Number -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) --- | Int32 -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) --- | ParamDate -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) --- | EnumFormString -newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show) --- | Body -newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) --- | Tags -newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) --- | EnumQueryInteger -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) --- | ParamFloat -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) --- | Name2 -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) --- | Password -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) --- | Status -newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show) --- | ParamDouble -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) --- | EnumHeaderString -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) --- | Param2 -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) --- | PetId -newtype PetId = PetId { unPetId :: Integer } 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) --- | EnumQueryString -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) --- | ParamDateTime -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) --- | EnumQueryStringArray -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show) --- | PatternWithoutDelimiter -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) --- | Callback -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) --- | Username -newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) --- | Int64 -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) --- | AdditionalMetadata -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) --- | Byte -newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) --- | ParamBinary -newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) --- | EnumFormStringArray -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) --- | EnumHeaderStringArray -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) --- | Param -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) --- | File -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) - -- * SwaggerPetstoreRequest -- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index 51c766bb551..bef09c051a2 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs index 105cb19b0b2..eada883b6e1 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs index 2842b5ee15f..c80e3017cf0 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} 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 1eac4d19189..4b1cdfa9adf 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} @@ -65,8 +66,8 @@ data MimeOctetStream = MimeOctetStream deriving (P.Typeable) data MimeNoContent = MimeNoContent deriving (P.Typeable) data MimeAny = MimeAny deriving (P.Typeable) -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) -- ** MimeType Class @@ -116,16 +117,16 @@ instance MimeType MimeAny where instance MimeType MimeNoContent where mimeType _ = Nothing --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" - -- | @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 +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" + -- ** MimeRender Class @@ -182,8 +183,8 @@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.emp -- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec -- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined -- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined -- ** MimeUnrender Class @@ -216,8 +217,8 @@ 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 --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined -- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined -- ** Request Consumes 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 01b042c2c96..368eb5e7919 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -3,7 +3,8 @@ 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: 1.0.0 + 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) -} @@ -1398,6 +1399,45 @@ mkDog dogClassName = } +-- * 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 :: Text } deriving (P.Eq, P.Show) +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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) + -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index e981b82d4ec..46d075679ea 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -1,7 +1,3 @@ --- This file has been generated from package.yaml by hpack version 0.17.1. --- --- see: https://github.com/sol/hpack - name: swagger-petstore version: 0.1.0.0 synopsis: Auto-generated swagger-petstore API Client @@ -12,9 +8,9 @@ description: . . base path: http://petstore.swagger.io:80/v2 . - apiVersion: 0.0.1 + Swagger Petstore API version: 1.0.0 . - swagger version: 2.0 + OpenAPI spec version: 2.0 . OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md . diff --git a/samples/client/petstore/haskell-http-client/swagger.json b/samples/client/petstore/haskell-http-client/swagger.json index 7c2e6c0cc65..5b53d7108d0 100644 --- a/samples/client/petstore/haskell-http-client/swagger.json +++ b/samples/client/petstore/haskell-http-client/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, From b5a01b51c6fd64a55c8751e3844dc5800345b823 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 11 Oct 2017 20:58:27 +0800 Subject: [PATCH 139/197] comment out swift test due to build image changes --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 7f6cb047984..d063b8780d4 100644 --- a/pom.xml +++ b/pom.xml @@ -860,12 +860,14 @@ samples/client/petstore/typescript-jquery/npm--> samples/client/petstore/typescript-angular-v2/npm samples/client/petstore/typescript-angular-v4/npm + From 30a176126aa3600b6252f80b84040a1ab351c125 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 11 Oct 2017 21:16:53 +0800 Subject: [PATCH 140/197] revise wordings for powershell generator --- .../io/swagger/codegen/languages/PowerShellClientCodegen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PowerShellClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PowerShellClientCodegen.java index dcacc549406..13ca320a0b7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PowerShellClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PowerShellClientCodegen.java @@ -153,7 +153,7 @@ public PowerShellClientCodegen() { cliOptions.clear(); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Client package name (e.g. io.swagger.client).").defaultValue(this.packageName)); cliOptions.add(new CliOption(CodegenConstants.OPTIONAL_PROJECT_GUID, "GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.")); - cliOptions.add(new CliOption("csharpClientPath", "Path to the C# API client generated by Swagger Codegen, e.g. $ScriptDir\\..\\csharp\\SwaggerClient where $ScriptDir is the current directory.").defaultValue(this.csharpClientPath)); + cliOptions.add(new CliOption("csharpClientPath", "Path to the C# API client generated by Swagger Codegen, e.g. $ScriptDir\\..\\csharp\\SwaggerClient where $ScriptDir is the current directory. NOTE: you will need to generate the C# API client separately.").defaultValue(this.csharpClientPath)); } @@ -166,7 +166,7 @@ public String getName() { } public String getHelp() { - return "Generates a PowerShell API client (beta)."; + return "Generates a PowerShell API client (beta). (The dependency C# API client needs to be generated separately."; } public void setPackageName(String packageName) { From 02a053e2b618ea9653b2c4cfef266bb7e8fe2fa8 Mon Sep 17 00:00:00 2001 From: Jumpei Takiyasu Date: Thu, 12 Oct 2017 18:26:57 +0900 Subject: [PATCH 141/197] Update README.md (#6656) Add my slide to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3083d29a0d0..54a5eabd83a 100644 --- a/README.md +++ b/README.md @@ -895,6 +895,7 @@ Presentations/Videos/Tutorials/Books - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [和田拓朗](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) +- 2017/09/28 - [Swagger Codegenで APIクライアントgem 自動生成 #m3kt](https://speakerdeck.com/juntaki/swagger-codegende-apikuraiantogem-zi-dong-sheng-cheng-number-m3kt) by [Jumpei Takiyasu](https://github.com/juntaki) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) - 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) - 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez) From 3bd24c3e5ccae74364235cfc62c11c5ac1c27ce2 Mon Sep 17 00:00:00 2001 From: Javier Velilla Date: Thu, 12 Oct 2017 06:28:00 -0300 Subject: [PATCH 142/197] Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel (#6653) Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. --- .../src/main/resources/Eiffel/api.mustache | 13 +++- .../main/resources/Eiffel/api_client.mustache | 61 ++++++++++++++++++- .../src/main/resources/Eiffel/model.mustache | 5 +- 3 files changed, 73 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Eiffel/api.mustache b/modules/swagger-codegen/src/main/resources/Eiffel/api.mustache index 9c08b336862..53a5edc0698 100644 --- a/modules/swagger-codegen/src/main/resources/Eiffel/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Eiffel/api.mustache @@ -13,7 +13,7 @@ feature -- API Access {{#operation}} - {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}detachable {{{dataType}}}{{/required}}{{#hasMore}}; {{/hasMore}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} + {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{#hasMore}}; {{/hasMore}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} -- {{summary}} -- {{notes}} -- {{#allParams}} @@ -21,6 +21,17 @@ feature -- API Access -- {{/allParams}} -- {{#returnType}} -- Result {{returnType}}{{/returnType}} + require + {{#allParams}} + {{#hasValidation}} + {{#maximum}} + {{{paramName}}}_is_less_or_equal_than: {{{paramName}}} <= {{{maximum}}} + {{/maximum}} + {{#minimum}} + {{{paramName}}}_is_greater_or_equal_than: {{{paramName}}} >= {{{minimum}}} + {{/minimum}} + {{/hasValidation}} + {{/allParams}} local l_path: STRING l_request: API_CLIENT_REQUEST diff --git a/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache b/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache index 9de50417eb9..9958265883a 100644 --- a/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache @@ -135,7 +135,7 @@ feature -- Query Parameter Helpers l_delimiter: STRING l_value: STRING do - if attached {LIST [STRING_32]} a_value as a_list then + if attached {LIST [ANY]} a_value as a_list then -- Collection if a_list.is_empty then -- Return an empty list @@ -150,7 +150,7 @@ feature -- Query Parameter Helpers end if l_format.is_case_insensitive_equal ("multi") then across a_list as ic loop - Result.force ([a_name, ic.item.as_string_8]) + Result.force ([a_name, parameter_to_string (ic.item)]) end else if l_format.is_case_insensitive_equal ("csv") then @@ -166,7 +166,7 @@ feature -- Query Parameter Helpers end across a_list as ic from create l_value.make_empty loop - l_value.append (ic.item) + l_value.append (parameter_to_string (ic.item)) l_value.append (l_delimiter) end l_value.remove_tail (1) @@ -185,6 +185,61 @@ feature -- Query Parameter Helpers end + parameter_to_string (a_param: detachable ANY): STRING + -- return the string representation of the givien object `a_param'. + do + if a_param = Void then + Result := "" + else + if attached {BOOLEAN} a_param as bool then + Result := bool.out + elseif attached {NUMERIC} a_param as num then + if attached {INTEGER_64} num as i64 then + Result := i64.out + elseif attached {INTEGER_32} num as i32 then + Result := i32.out + elseif attached {INTEGER_16} num as i16 then + Result := i16.out + elseif attached {INTEGER_8} num as i8 then + Result := i8.out + elseif attached {NATURAL_64} num as n64 then + Result := n64.out + elseif attached {NATURAL_32} num as n32 then + Result := n32.out + elseif attached {NATURAL_16} num as n16 then + Result := n16.out + elseif attached {NATURAL_8} num as n8 then + Result := n8.out + elseif attached {REAL_64} num as r64 then + Result := r64.out + elseif attached {REAL_32} num as r32 then + Result := r32.out + else + check is_basic_numeric_type: False end + end + Result := num.out + elseif attached {CHARACTER_8} a_param as ch8 then + Result := ch8.out + elseif attached {CHARACTER_32} a_param as ch32 then + Result := ch32.out + elseif attached {POINTER} a_param as ptr then + Result := ptr.to_integer_32.out + elseif attached {DATE} a_param as date then + --TODO improve to support + -- date string As defined by full-date - RFC3339 + Result := date.debug_output + elseif attached {DATE_TIME} a_param as date_time then + -- TODO improve to support + -- dateTime string date-time As defined by date-time - RFC3339 + Result := date_time.date.debug_output + else + -- Unsupported Object type. + Result := "" + end + end + end + + feature -- Status Report is_valid_uri (a_uri: STRING): BOOLEAN diff --git a/modules/swagger-codegen/src/main/resources/Eiffel/model.mustache b/modules/swagger-codegen/src/main/resources/Eiffel/model.mustache index 64f0c64e467..aa5e906c448 100644 --- a/modules/swagger-codegen/src/main/resources/Eiffel/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Eiffel/model.mustache @@ -74,7 +74,7 @@ feature -- Change Element {{#isListContainer}} if attached {{name}} as l_{{name}} then across l_{{name}} as ic loop - Result.append ("%N") + Result.append ("%N {{name}}:") Result.append (ic.item.out) Result.append ("%N") end @@ -82,6 +82,7 @@ feature -- Change Element {{/isListContainer}} {{#isMapContainer}} if attached {{name}} as l_{{name}} then + Result.append ("%N{{name}}:") across l_{{name}} as ic loop Result.append ("%N") Result.append ("key:") @@ -95,7 +96,7 @@ feature -- Change Element {{/isMapContainer}} {{^isContainer}} if attached {{name}} as l_{{name}} then - Result.append ("%N") + Result.append ("%N{{name}}:") Result.append (l_{{name}}.out) Result.append ("%N") end From 590754f4f4dd9a5cf37dee220967dac77fb77f65 Mon Sep 17 00:00:00 2001 From: Yukio Ejiri Date: Thu, 12 Oct 2017 18:31:09 +0900 Subject: [PATCH 143/197] [kotlin] Fix syntax errors on localVariableHeader in api.mustache (#6660) --- .../src/main/resources/kotlin-client/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cae4e8cb62b..9b78ac8f2cb 100644 --- a/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache +++ b/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache @@ -20,7 +20,7 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base 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 = {{^headerParams}}mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}){{/headerParams}}{{#headerParams}}mapOf("{{paramName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}){{/headerParams}} + 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 localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}}, From b716b378c4d9579d25cc31a53d3815ddb8ed94f7 Mon Sep 17 00:00:00 2001 From: ehyche Date: Thu, 12 Oct 2017 05:35:59 -0400 Subject: [PATCH 144/197] Swift4: Add additional initializer for initializing model object with properties. (#6642) * Add addiitional files from upstream * Remove mis-added files * Add additional swift4 initializer for initializing model object with properties. This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6641 It adds an additional initializer which allows model objects to be initialized using the properties. For exxample, if we had this model: "ErrorInfo": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "type": "string" } } }, "description": "Example Error object" }, This we generate an initializer for this model object like this: public init(code: Int?, message: String?, details: [String]?) { self.code = code self.message = message self.details = details } * Add hasVars checks around initializers and re-run all scripts to re-generate --- .../src/main/resources/swift4/model.mustache | 8 + .../swift4/default/PetstoreClient.podspec | 2 +- .../Swaggers/APIs/AnotherfakeAPI.swift | 52 ++ .../Classes/Swaggers/APIs/FakeAPI.swift | 4 +- .../Classes/Swaggers/Extensions.swift | 86 +++ .../Models/AdditionalPropertiesClass.swift | 26 +- .../Classes/Swaggers/Models/Animal.swift | 28 +- .../Classes/Swaggers/Models/ApiResponse.swift | 30 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 22 +- .../Swaggers/Models/ArrayOfNumberOnly.swift | 22 +- .../Classes/Swaggers/Models/ArrayTest.swift | 30 +- .../Swaggers/Models/Capitalization.swift | 42 +- .../Classes/Swaggers/Models/Cat.swift | 22 +- .../Classes/Swaggers/Models/Category.swift | 26 +- .../Classes/Swaggers/Models/ClassModel.swift | 22 +- .../Classes/Swaggers/Models/Client.swift | 22 +- .../Classes/Swaggers/Models/Dog.swift | 22 +- .../Classes/Swaggers/Models/EnumArrays.swift | 26 +- .../Classes/Swaggers/Models/EnumTest.swift | 38 +- .../Classes/Swaggers/Models/FormatTest.swift | 84 ++- .../Swaggers/Models/HasOnlyReadOnly.swift | 26 +- .../Classes/Swaggers/Models/List.swift | 22 +- .../Classes/Swaggers/Models/MapTest.swift | 26 +- ...opertiesAndAdditionalPropertiesClass.swift | 30 +- .../Swaggers/Models/Model200Response.swift | 26 +- .../Classes/Swaggers/Models/Name.swift | 36 +- .../Classes/Swaggers/Models/NumberOnly.swift | 22 +- .../Classes/Swaggers/Models/Order.swift | 42 +- .../Swaggers/Models/OuterBoolean.swift | 23 +- .../Swaggers/Models/OuterComposite.swift | 30 +- .../Classes/Swaggers/Models/OuterNumber.swift | 23 +- .../Classes/Swaggers/Models/OuterString.swift | 23 +- .../Classes/Swaggers/Models/Pet.swift | 46 +- .../Swaggers/Models/ReadOnlyFirst.swift | 26 +- .../Classes/Swaggers/Models/Return.swift | 22 +- .../Swaggers/Models/SpecialModelName.swift | 22 +- .../Classes/Swaggers/Models/Tag.swift | 26 +- .../Classes/Swaggers/Models/User.swift | 50 +- .../petstore/swift4/objcCompatible/.gitignore | 63 ++ .../objcCompatible/.swagger-codegen-ignore | 23 + .../objcCompatible/.swagger-codegen/VERSION | 1 + .../petstore/swift4/objcCompatible/Cartfile | 1 + .../objcCompatible/PetstoreClient.podspec | 13 + .../Classes/Swaggers/APIHelper.swift | 65 ++ .../Classes/Swaggers/APIs.swift | 61 ++ .../Swaggers/APIs/AnotherfakeAPI.swift | 52 ++ .../Classes/Swaggers/APIs/FakeAPI.swift | 450 ++++++++++++++ .../APIs/Fake_classname_tags123API.swift | 54 ++ .../Classes/Swaggers/APIs/PetAPI.swift | 588 ++++++++++++++++++ .../Classes/Swaggers/APIs/StoreAPI.swift | 219 +++++++ .../Classes/Swaggers/APIs/UserAPI.swift | 344 ++++++++++ .../Swaggers/AlamofireImplementations.swift | 417 +++++++++++++ .../Classes/Swaggers/CodableHelper.swift | 55 ++ .../Classes/Swaggers/Configuration.swift | 15 + .../Classes/Swaggers/Extensions.swift | 173 ++++++ .../Swaggers/JSONEncodableEncoding.swift | 54 ++ .../Classes/Swaggers/JSONEncodingHelper.swift | 27 + .../Classes/Swaggers/Models.swift | 36 ++ .../Models/AdditionalPropertiesClass.swift | 42 ++ .../Classes/Swaggers/Models/Animal.swift | 42 ++ .../Classes/Swaggers/Models/AnimalFarm.swift | 11 + .../Classes/Swaggers/Models/ApiResponse.swift | 51 ++ .../Models/ArrayOfArrayOfNumberOnly.swift | 38 ++ .../Swaggers/Models/ArrayOfNumberOnly.swift | 38 ++ .../Classes/Swaggers/Models/ArrayTest.swift | 46 ++ .../Swaggers/Models/Capitalization.swift | 59 ++ .../Classes/Swaggers/Models/Cat.swift | 43 ++ .../Classes/Swaggers/Models/Category.swift | 47 ++ .../Classes/Swaggers/Models/ClassModel.swift | 39 ++ .../Classes/Swaggers/Models/Client.swift | 38 ++ .../Classes/Swaggers/Models/Dog.swift | 38 ++ .../Classes/Swaggers/Models/EnumArrays.swift | 50 ++ .../Classes/Swaggers/Models/EnumClass.swift | 16 + .../Classes/Swaggers/Models/EnumTest.swift | 63 ++ .../Classes/Swaggers/Models/FormatTest.swift | 116 ++++ .../Swaggers/Models/HasOnlyReadOnly.swift | 42 ++ .../Classes/Swaggers/Models/List.swift | 38 ++ .../Classes/Swaggers/Models/MapTest.swift | 46 ++ ...opertiesAndAdditionalPropertiesClass.swift | 46 ++ .../Swaggers/Models/Model200Response.swift | 48 ++ .../Classes/Swaggers/Models/Name.swift | 66 ++ .../Classes/Swaggers/Models/NumberOnly.swift | 43 ++ .../Classes/Swaggers/Models/Order.swift | 84 +++ .../Swaggers/Models/OuterBoolean.swift | 32 + .../Swaggers/Models/OuterComposite.swift | 46 ++ .../Classes/Swaggers/Models/OuterEnum.swift | 16 + .../Classes/Swaggers/Models/OuterNumber.swift | 32 + .../Classes/Swaggers/Models/OuterString.swift | 32 + .../Classes/Swaggers/Models/Pet.swift | 69 ++ .../Swaggers/Models/ReadOnlyFirst.swift | 42 ++ .../Classes/Swaggers/Models/Return.swift | 44 ++ .../Swaggers/Models/SpecialModelName.swift | 43 ++ .../Classes/Swaggers/Models/Tag.swift | 47 ++ .../Classes/Swaggers/Models/User.swift | 77 +++ .../swift4/objcCompatible/git_push.sh | 52 ++ .../swift4/promisekit/PetstoreClient.podspec | 2 +- .../Swaggers/APIs/AnotherfakeAPI.swift | 70 +++ .../Classes/Swaggers/APIs/FakeAPI.swift | 4 +- .../Classes/Swaggers/Extensions.swift | 86 +++ .../Models/AdditionalPropertiesClass.swift | 26 +- .../Classes/Swaggers/Models/Animal.swift | 28 +- .../Classes/Swaggers/Models/ApiResponse.swift | 30 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 22 +- .../Swaggers/Models/ArrayOfNumberOnly.swift | 22 +- .../Classes/Swaggers/Models/ArrayTest.swift | 30 +- .../Swaggers/Models/Capitalization.swift | 42 +- .../Classes/Swaggers/Models/Cat.swift | 22 +- .../Classes/Swaggers/Models/Category.swift | 26 +- .../Classes/Swaggers/Models/ClassModel.swift | 22 +- .../Classes/Swaggers/Models/Client.swift | 22 +- .../Classes/Swaggers/Models/Dog.swift | 22 +- .../Classes/Swaggers/Models/EnumArrays.swift | 26 +- .../Classes/Swaggers/Models/EnumTest.swift | 38 +- .../Classes/Swaggers/Models/FormatTest.swift | 84 ++- .../Swaggers/Models/HasOnlyReadOnly.swift | 26 +- .../Classes/Swaggers/Models/List.swift | 22 +- .../Classes/Swaggers/Models/MapTest.swift | 26 +- ...opertiesAndAdditionalPropertiesClass.swift | 30 +- .../Swaggers/Models/Model200Response.swift | 26 +- .../Classes/Swaggers/Models/Name.swift | 36 +- .../Classes/Swaggers/Models/NumberOnly.swift | 22 +- .../Classes/Swaggers/Models/Order.swift | 42 +- .../Swaggers/Models/OuterBoolean.swift | 23 +- .../Swaggers/Models/OuterComposite.swift | 30 +- .../Classes/Swaggers/Models/OuterNumber.swift | 23 +- .../Classes/Swaggers/Models/OuterString.swift | 23 +- .../Classes/Swaggers/Models/Pet.swift | 46 +- .../Swaggers/Models/ReadOnlyFirst.swift | 26 +- .../Classes/Swaggers/Models/Return.swift | 22 +- .../Swaggers/Models/SpecialModelName.swift | 22 +- .../Classes/Swaggers/Models/Tag.swift | 26 +- .../Classes/Swaggers/Models/User.swift | 50 +- .../swift4/rxswift/PetstoreClient.podspec | 2 +- .../Swaggers/APIs/AnotherfakeAPI.swift | 72 +++ .../Classes/Swaggers/APIs/FakeAPI.swift | 4 +- .../Classes/Swaggers/Extensions.swift | 86 +++ .../Models/AdditionalPropertiesClass.swift | 26 +- .../Classes/Swaggers/Models/Animal.swift | 28 +- .../Classes/Swaggers/Models/ApiResponse.swift | 30 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 22 +- .../Swaggers/Models/ArrayOfNumberOnly.swift | 22 +- .../Classes/Swaggers/Models/ArrayTest.swift | 30 +- .../Swaggers/Models/Capitalization.swift | 42 +- .../Classes/Swaggers/Models/Cat.swift | 22 +- .../Classes/Swaggers/Models/Category.swift | 26 +- .../Classes/Swaggers/Models/ClassModel.swift | 22 +- .../Classes/Swaggers/Models/Client.swift | 22 +- .../Classes/Swaggers/Models/Dog.swift | 22 +- .../Classes/Swaggers/Models/EnumArrays.swift | 26 +- .../Classes/Swaggers/Models/EnumTest.swift | 38 +- .../Classes/Swaggers/Models/FormatTest.swift | 84 ++- .../Swaggers/Models/HasOnlyReadOnly.swift | 26 +- .../Classes/Swaggers/Models/List.swift | 22 +- .../Classes/Swaggers/Models/MapTest.swift | 26 +- ...opertiesAndAdditionalPropertiesClass.swift | 30 +- .../Swaggers/Models/Model200Response.swift | 26 +- .../Classes/Swaggers/Models/Name.swift | 36 +- .../Classes/Swaggers/Models/NumberOnly.swift | 22 +- .../Classes/Swaggers/Models/Order.swift | 42 +- .../Swaggers/Models/OuterBoolean.swift | 23 +- .../Swaggers/Models/OuterComposite.swift | 30 +- .../Classes/Swaggers/Models/OuterNumber.swift | 23 +- .../Classes/Swaggers/Models/OuterString.swift | 23 +- .../Classes/Swaggers/Models/Pet.swift | 46 +- .../Swaggers/Models/ReadOnlyFirst.swift | 26 +- .../Classes/Swaggers/Models/Return.swift | 22 +- .../Swaggers/Models/SpecialModelName.swift | 22 +- .../Classes/Swaggers/Models/Tag.swift | 26 +- .../Classes/Swaggers/Models/User.swift | 50 +- .../Swaggers/AlamofireImplementations.swift | 110 ++++ .../Swaggers/Models/AllPrimitives.swift | 27 + .../Classes/Swaggers/Models/ErrorInfo.swift | 6 + .../Swaggers/Models/GetAllModelsResult.swift | 6 + ...ModelWithIntAdditionalPropertiesOnly.swift | 1 + ...ithPropertiesAndAdditionalProperties.swift | 11 + ...elWithStringAdditionalPropertiesOnly.swift | 1 + .../Swaggers/Models/VariableNameTest.swift | 5 + 177 files changed, 7529 insertions(+), 498 deletions(-) create mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/.gitignore create mode 100644 samples/client/petstore/swift4/objcCompatible/.swagger-codegen-ignore create mode 100644 samples/client/petstore/swift4/objcCompatible/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/swift4/objcCompatible/Cartfile create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/CodableHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/git_push.sh create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift diff --git a/modules/swagger-codegen/src/main/resources/swift4/model.mustache b/modules/swagger-codegen/src/main/resources/swift4/model.mustache index 383b229e447..9cbcca50456 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/model.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/model.mustache @@ -64,6 +64,14 @@ open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{ } {{/additionalPropertiesType}} + {{#hasVars}} + public init({{#vars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/vars}}) { + {{#vars}} + self.{{name}} = {{name}} + {{/vars}} + } + {{/hasVars}} + // Encodable protocol methods public {{#parent}}override {{/parent}}func encode(to encoder: Encoder) throws { diff --git a/samples/client/petstore/swift4/default/PetstoreClient.podspec b/samples/client/petstore/swift4/default/PetstoreClient.podspec index 2671cdda937..7a28d478bf8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/default/PetstoreClient.podspec @@ -9,5 +9,5 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/swagger-api/swagger-codegen' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.5' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift new file mode 100644 index 00000000000..9c135bdce3a --- /dev/null +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift @@ -0,0 +1,52 @@ +// +// AnotherfakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class AnotherfakeAPI { + /** + To test special tags + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index b25de2db763..a111760bee0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -327,7 +327,7 @@ open class FakeAPI { */ public enum EnumQueryInteger_testEnumParameters: Int { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -335,7 +335,7 @@ open class FakeAPI { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift index 202b47449d8..9cac90e08d4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -84,4 +84,90 @@ extension UUID: JSONEncodable { } } +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift index b18644a34e3..57e6d1f76e1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift @@ -8,17 +8,35 @@ import Foundation + open class AdditionalPropertiesClass: Codable { public var mapProperty: [String:String]? public var mapOfMapProperty: [String:[String:String]]? - public init() {} + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapProperty = "map_property" - case mapOfMapProperty = "map_of_map_property" + try container.encodeIfPresent(mapProperty, forKey: "map_property") + try container.encodeIfPresent(mapOfMapProperty, forKey: "map_of_map_property") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapProperty = try container.decodeIfPresent([String:String].self, forKey: "map_property") + mapOfMapProperty = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_of_map_property") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift index 1c0cc68a298..fd48bfb9b4c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Animal.swift @@ -8,17 +8,35 @@ import Foundation + open class Animal: Codable { - public var className: String? + public var className: String public var color: String? - public init() {} + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case className = "className" - case color = "color" + try container.encode(className, forKey: "className") + try container.encodeIfPresent(color, forKey: "color") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + className = try container.decode(String.self, forKey: "className") + color = try container.decodeIfPresent(String.self, forKey: "color") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift index 842755fb3c4..de8b7ec6ebd 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift @@ -8,19 +8,39 @@ import Foundation + open class ApiResponse: Codable { public var code: Int? public var type: String? public var message: String? - public init() {} + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case code = "code" - case type = "type" - case message = "message" + try container.encodeIfPresent(code, forKey: "code") + try container.encodeIfPresent(type, forKey: "type") + try container.encodeIfPresent(message, forKey: "message") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + code = try container.decodeIfPresent(Int.self, forKey: "code") + type = try container.decodeIfPresent(String.self, forKey: "type") + message = try container.decodeIfPresent(String.self, forKey: "message") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift index 9f7ee34099c..0b3c86516c4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init() {} + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" + try container.encodeArrayIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayArrayNumber = try container.decodeArrayIfPresent([Double].self, forKey: "ArrayArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift index fba11ceb708..733fda10ef4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init() {} + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" + try container.encodeArrayIfPresent(arrayNumber, forKey: "ArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayNumber = try container.decodeArrayIfPresent(Double.self, forKey: "ArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift index bdf244f5e0a..fd948816d28 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift @@ -8,19 +8,39 @@ import Foundation + open class ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init() {} + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" + try container.encodeArrayIfPresent(arrayOfString, forKey: "array_of_string") + try container.encodeArrayIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer") + try container.encodeArrayIfPresent(arrayArrayOfModel, forKey: "array_array_of_model") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayOfString = try container.decodeArrayIfPresent(String.self, forKey: "array_of_string") + arrayArrayOfInteger = try container.decodeArrayIfPresent([Int64].self, forKey: "array_array_of_integer") + arrayArrayOfModel = try container.decodeArrayIfPresent([ReadOnlyFirst].self, forKey: "array_array_of_model") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift index a39eda9087c..32ea816610e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift @@ -8,6 +8,7 @@ import Foundation + open class Capitalization: Codable { public var smallCamel: String? @@ -18,16 +19,41 @@ open class Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init() {} + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case smallCamel = "smallCamel" - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME = "ATT_NAME" + try container.encodeIfPresent(smallCamel, forKey: "smallCamel") + try container.encodeIfPresent(capitalCamel, forKey: "CapitalCamel") + try container.encodeIfPresent(smallSnake, forKey: "small_Snake") + try container.encodeIfPresent(capitalSnake, forKey: "Capital_Snake") + try container.encodeIfPresent(sCAETHFlowPoints, forKey: "SCA_ETH_Flow_Points") + try container.encodeIfPresent(ATT_NAME, forKey: "ATT_NAME") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + smallCamel = try container.decodeIfPresent(String.self, forKey: "smallCamel") + capitalCamel = try container.decodeIfPresent(String.self, forKey: "CapitalCamel") + smallSnake = try container.decodeIfPresent(String.self, forKey: "small_Snake") + capitalSnake = try container.decodeIfPresent(String.self, forKey: "Capital_Snake") + sCAETHFlowPoints = try container.decodeIfPresent(String.self, forKey: "SCA_ETH_Flow_Points") + ATT_NAME = try container.decodeIfPresent(String.self, forKey: "ATT_NAME") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift index fdb090535aa..1354abdf4f0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Cat.swift @@ -8,15 +8,31 @@ import Foundation + open class Cat: Animal { public var declawed: Bool? - + public init(declawed: Bool?) { + self.declawed = declawed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case declawed = "declawed" + try container.encodeIfPresent(declawed, forKey: "declawed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + declawed = try container.decodeIfPresent(Bool.self, forKey: "declawed") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift index 684443a0649..4d631bf8273 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Category.swift @@ -8,17 +8,35 @@ import Foundation + open class Category: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift index a3d86c6c6f9..8d80e263370 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing model with \"_class\" property */ + open class ClassModel: Codable { public var _class: String? - public init() {} + public init(_class: String?) { + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _class = "_class" + try container.encodeIfPresent(_class, forKey: "_class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _class = try container.decodeIfPresent(String.self, forKey: "_class") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift index 9d6d71b2367..3a74788606b 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Client.swift @@ -8,15 +8,31 @@ import Foundation + open class Client: Codable { public var client: String? - public init() {} + public init(client: String?) { + self.client = client + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case client = "client" + try container.encodeIfPresent(client, forKey: "client") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + client = try container.decodeIfPresent(String.self, forKey: "client") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift index ffaab37e621..2835af6b0f9 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Dog.swift @@ -8,15 +8,31 @@ import Foundation + open class Dog: Animal { public var breed: String? - + public init(breed: String?) { + self.breed = breed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case breed = "breed" + try container.encodeIfPresent(breed, forKey: "breed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + breed = try container.decodeIfPresent(String.self, forKey: "breed") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift index 9b2e72b9819..bb7960a7577 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -21,12 +22,29 @@ open class EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init() {} + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" + try container.encodeIfPresent(justSymbol, forKey: "just_symbol") + try container.encodeArrayIfPresent(arrayEnum, forKey: "array_enum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justSymbol = try container.decodeIfPresent(String.self, forKey: "just_symbol") + arrayEnum = try container.decodeArrayIfPresent(String.self, forKey: "array_enum") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index 89dad808a5e..023f9a8209c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumTest: Codable { public enum EnumString: String, Codable { @@ -17,25 +18,46 @@ open class EnumTest: Codable { } public enum EnumInteger: Int, Codable { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double, Codable { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init() {} + public init(enumString: EnumString?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum = "outerEnum" + try container.encodeIfPresent(enumString, forKey: "enum_string") + try container.encodeIfPresent(enumInteger, forKey: "enum_integer") + try container.encodeIfPresent(enumNumber, forKey: "enum_number") + try container.encodeIfPresent(outerEnum, forKey: "outerEnum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + enumString = try container.decodeIfPresent(String.self, forKey: "enum_string") + enumInteger = try container.decodeIfPresent(Int.self, forKey: "enum_integer") + enumNumber = try container.decodeIfPresent(Double.self, forKey: "enum_number") + outerEnum = try container.decodeIfPresent(OuterEnum.self, forKey: "outerEnum") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift index d4a1e5f8e52..3423c30d9b9 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift @@ -8,39 +8,79 @@ import Foundation + open class FormatTest: Codable { public var integer: Int? public var int32: Int? public var int64: Int64? - public var number: Double? + public var number: Double public var float: Float? public var double: Double? public var string: String? - public var byte: Data? + public var byte: Data public var binary: Data? - public var date: Date? + public var date: Date public var dateTime: Date? public var uuid: UUID? - public var password: String? - - public init() {} - - - private enum CodingKeys: String, CodingKey { - case integer = "integer" - case int32 = "int32" - case int64 = "int64" - case number = "number" - case float = "float" - case double = "double" - case string = "string" - case byte = "byte" - case binary = "binary" - case date = "date" - case dateTime = "dateTime" - case uuid = "uuid" - case password = "password" + public var password: String + + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: Data?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(integer, forKey: "integer") + try container.encodeIfPresent(int32, forKey: "int32") + try container.encodeIfPresent(int64, forKey: "int64") + try container.encode(number, forKey: "number") + try container.encodeIfPresent(float, forKey: "float") + try container.encodeIfPresent(double, forKey: "double") + try container.encodeIfPresent(string, forKey: "string") + try container.encode(byte, forKey: "byte") + try container.encodeIfPresent(binary, forKey: "binary") + try container.encode(date, forKey: "date") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encode(password, forKey: "password") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + integer = try container.decodeIfPresent(Int.self, forKey: "integer") + int32 = try container.decodeIfPresent(Int.self, forKey: "int32") + int64 = try container.decodeIfPresent(Int64.self, forKey: "int64") + number = try container.decode(Double.self, forKey: "number") + float = try container.decodeIfPresent(Float.self, forKey: "float") + double = try container.decodeIfPresent(Double.self, forKey: "double") + string = try container.decodeIfPresent(String.self, forKey: "string") + byte = try container.decode(Data.self, forKey: "byte") + binary = try container.decodeIfPresent(Data.self, forKey: "binary") + date = try container.decode(Date.self, forKey: "date") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + password = try container.decode(String.self, forKey: "password") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift index f3f4f794975..226ffe44b08 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift @@ -8,17 +8,35 @@ import Foundation + open class HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init() {} + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case foo = "foo" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(foo, forKey: "foo") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + foo = try container.decodeIfPresent(String.self, forKey: "foo") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift index 4062dc0fef9..5f4068ffbeb 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/List.swift @@ -8,15 +8,31 @@ import Foundation + open class List: Codable { public var _123List: String? - public init() {} + public init(_123List: String?) { + self._123List = _123List + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _123List = "123-list" + try container.encodeIfPresent(_123List, forKey: "123-list") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _123List = try container.decodeIfPresent(String.self, forKey: "123-list") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift index 1ccfa4e4e75..36f31fc1a44 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MapTest.swift @@ -8,6 +8,7 @@ import Foundation + open class MapTest: Codable { public enum MapOfEnumString: String, Codable { @@ -17,12 +18,29 @@ open class MapTest: Codable { public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public init() {} + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" + try container.encodeIfPresent(mapMapOfString, forKey: "map_map_of_string") + try container.encodeIfPresent(mapOfEnumString, forKey: "map_of_enum_string") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapMapOfString = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_map_of_string") + mapOfEnumString = try container.decodeIfPresent([String:String].self, forKey: "map_of_enum_string") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 801890006a0..0f475c175d2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -8,19 +8,39 @@ import Foundation + open class MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? public var map: [String:Animal]? - public init() {} + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case uuid = "uuid" - case dateTime = "dateTime" - case map = "map" + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(map, forKey: "map") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + map = try container.decodeIfPresent([String:Animal].self, forKey: "map") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift index 31e32d33583..6c671b5031d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift @@ -9,17 +9,35 @@ import Foundation /** Model for testing model name starting with number */ + open class Model200Response: Codable { public var name: Int? public var _class: String? - public init() {} + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case _class = "class" + try container.encodeIfPresent(name, forKey: "name") + try container.encodeIfPresent(_class, forKey: "class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decodeIfPresent(Int.self, forKey: "name") + _class = try container.decodeIfPresent(String.self, forKey: "class") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift index 3f44a95624f..873b77e3ab2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Name.swift @@ -9,21 +9,43 @@ import Foundation /** Model for testing model name same as property name */ + open class Name: Codable { - public var name: Int? + public var name: Int public var snakeCase: Int? public var property: String? public var _123Number: Int? - public init() {} + public init(name: Int, snakeCase: Int?, property: String?, _123Number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123Number = _123Number + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case snakeCase = "snake_case" - case property = "property" - case _123Number = "123Number" + try container.encode(name, forKey: "name") + try container.encodeIfPresent(snakeCase, forKey: "snake_case") + try container.encodeIfPresent(property, forKey: "property") + try container.encodeIfPresent(_123Number, forKey: "123Number") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decode(Int.self, forKey: "name") + snakeCase = try container.decodeIfPresent(Int.self, forKey: "snake_case") + property = try container.decodeIfPresent(String.self, forKey: "property") + _123Number = try container.decodeIfPresent(Int.self, forKey: "123Number") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift index d3663be1e75..89921c2c9c6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class NumberOnly: Codable { public var justNumber: Double? - public init() {} + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" + try container.encodeIfPresent(justNumber, forKey: "JustNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justNumber = try container.decodeIfPresent(Double.self, forKey: "JustNumber") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift index e9b1a0a8c2f..fee9d6c9192 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Order.swift @@ -8,6 +8,7 @@ import Foundation + open class Order: Codable { public enum Status: String, Codable { @@ -23,16 +24,41 @@ open class Order: Codable { public var status: Status? public var complete: Bool? - public init() {} + public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case petId = "petId" - case quantity = "quantity" - case shipDate = "shipDate" - case status = "status" - case complete = "complete" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(petId, forKey: "petId") + try container.encodeIfPresent(quantity, forKey: "quantity") + try container.encodeIfPresent(shipDate, forKey: "shipDate") + try container.encodeIfPresent(status, forKey: "status") + try container.encodeIfPresent(complete, forKey: "complete") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + petId = try container.decodeIfPresent(Int64.self, forKey: "petId") + quantity = try container.decodeIfPresent(Int.self, forKey: "quantity") + shipDate = try container.decodeIfPresent(Date.self, forKey: "shipDate") + status = try container.decodeIfPresent(String.self, forKey: "status") + complete = try container.decodeIfPresent(Bool.self, forKey: "complete") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift index 3c49ad29400..ce257737983 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterBoolean = Bool + +open class OuterBoolean: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift index b085a27a470..cf46c19e7f1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -8,19 +8,39 @@ import Foundation + open class OuterComposite: Codable { public var myNumber: OuterNumber? public var myString: OuterString? public var myBoolean: OuterBoolean? - public init() {} + public init(myNumber: OuterNumber?, myString: OuterString?, myBoolean: OuterBoolean?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" + try container.encodeIfPresent(myNumber, forKey: "my_number") + try container.encodeIfPresent(myString, forKey: "my_string") + try container.encodeIfPresent(myBoolean, forKey: "my_boolean") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myNumber = try container.decodeIfPresent(OuterNumber.self, forKey: "my_number") + myString = try container.decodeIfPresent(OuterString.self, forKey: "my_string") + myBoolean = try container.decodeIfPresent(OuterBoolean.self, forKey: "my_boolean") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift index f285f4e5e29..3cd67121150 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterNumber = Double + +open class OuterNumber: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift index 9da794627d6..0d9f059b91c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterString = String + +open class OuterString: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift index bf982f538ff..0622c110fd4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Pet.swift @@ -8,6 +8,7 @@ import Foundation + open class Pet: Codable { public enum Status: String, Codable { @@ -17,22 +18,47 @@ open class Pet: Codable { } public var id: Int64? public var category: Category? - public var name: String? - public var photoUrls: [String]? + public var name: String + public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ public var status: Status? - public init() {} + public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case category = "category" - case name = "name" - case photoUrls = "photoUrls" - case tags = "tags" - case status = "status" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(category, forKey: "category") + try container.encode(name, forKey: "name") + try container.encodeArray(photoUrls, forKey: "photoUrls") + try container.encodeArrayIfPresent(tags, forKey: "tags") + try container.encodeIfPresent(status, forKey: "status") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + category = try container.decodeIfPresent(Category.self, forKey: "category") + name = try container.decode(String.self, forKey: "name") + photoUrls = try container.decodeArray(String.self, forKey: "photoUrls") + tags = try container.decodeArrayIfPresent(Tag.self, forKey: "tags") + status = try container.decodeIfPresent(String.self, forKey: "status") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift index 5a09771ea4b..e608e6845b2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift @@ -8,17 +8,35 @@ import Foundation + open class ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init() {} + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case baz = "baz" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(baz, forKey: "baz") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + baz = try container.decodeIfPresent(String.self, forKey: "baz") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift index 22b9e0174a1..6429c137f3a 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Return.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing reserved words */ + open class Return: Codable { public var _return: Int? - public init() {} + public init(_return: Int?) { + self._return = _return + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _return = "return" + try container.encodeIfPresent(_return, forKey: "return") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _return = try container.decodeIfPresent(Int.self, forKey: "return") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift index 8c0a8f79dc6..de8c76fa3a9 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift @@ -8,15 +8,31 @@ import Foundation + open class SpecialModelName: Codable { public var specialPropertyName: Int64? - public init() {} + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" + try container.encodeIfPresent(specialPropertyName, forKey: "$special[property.name]") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + specialPropertyName = try container.decodeIfPresent(Int64.self, forKey: "$special[property.name]") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift index feb6ab7c6cd..ab230b5f899 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/Tag.swift @@ -8,17 +8,35 @@ import Foundation + open class Tag: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift index 8fda8afb40e..17e6af33d5d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/Swaggers/Models/User.swift @@ -8,6 +8,7 @@ import Foundation + open class User: Codable { public var id: Int64? @@ -20,18 +21,47 @@ open class User: Codable { /** User Status */ public var userStatus: Int? - public init() {} + public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case username = "username" - case firstName = "firstName" - case lastName = "lastName" - case email = "email" - case password = "password" - case phone = "phone" - case userStatus = "userStatus" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(username, forKey: "username") + try container.encodeIfPresent(firstName, forKey: "firstName") + try container.encodeIfPresent(lastName, forKey: "lastName") + try container.encodeIfPresent(email, forKey: "email") + try container.encodeIfPresent(password, forKey: "password") + try container.encodeIfPresent(phone, forKey: "phone") + try container.encodeIfPresent(userStatus, forKey: "userStatus") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + username = try container.decodeIfPresent(String.self, forKey: "username") + firstName = try container.decodeIfPresent(String.self, forKey: "firstName") + lastName = try container.decodeIfPresent(String.self, forKey: "lastName") + email = try container.decodeIfPresent(String.self, forKey: "email") + password = try container.decodeIfPresent(String.self, forKey: "password") + phone = try container.decodeIfPresent(String.self, forKey: "phone") + userStatus = try container.decodeIfPresent(Int.self, forKey: "userStatus") + } } + diff --git a/samples/client/petstore/swift4/objcCompatible/.gitignore b/samples/client/petstore/swift4/objcCompatible/.gitignore new file mode 100644 index 00000000000..5e5d5cebcf4 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/.gitignore @@ -0,0 +1,63 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/samples/client/petstore/swift4/objcCompatible/.swagger-codegen-ignore b/samples/client/petstore/swift4/objcCompatible/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/.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/swift4/objcCompatible/.swagger-codegen/VERSION b/samples/client/petstore/swift4/objcCompatible/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/Cartfile b/samples/client/petstore/swift4/objcCompatible/Cartfile new file mode 100644 index 00000000000..3d90db16891 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/Cartfile @@ -0,0 +1 @@ +github "Alamofire/Alamofire" >= 3.1.0 diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec new file mode 100644 index 00000000000..7a28d478bf8 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = 'PetstoreClient' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.version = '0.0.1' + s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.authors = '' + s.license = 'Proprietary' + s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.summary = 'PetstoreClient' + s.source_files = 'PetstoreClient/Classes/**/*.swift' + s.dependency 'Alamofire', '~> 4.5.0' +end diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift new file mode 100644 index 00000000000..b612ff90921 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIHelper.swift @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +class APIHelper { + static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + var destination = [String:Any]() + for (key, nillableValue) in source { + if let value: Any = nillableValue { + destination[key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + var destination = [String:String]() + for (key, nillableValue) in source { + if let value: Any = nillableValue { + destination[key] = "\(value)" + } + } + return destination + } + + static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + var destination = [String:Any]() + let theTrue = NSNumber(value: true as Bool) + let theFalse = NSNumber(value: false as Bool) + for (key, value) in source { + switch value { + case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: + destination[key] = "\(value as! Bool)" as Any? + default: + destination[key] = value + } + } + return destination + } + + + static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { + let returnValues = values + .filter { $0.1 != nil } + .map { (item: (_key: String, _value: Any?)) -> URLQueryItem in + URLQueryItem(name: item._key, value:"\(item._value!)") + } + if returnValues.count == 0 { + return nil + } + return returnValues + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift new file mode 100644 index 00000000000..745d640ec1c --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String:String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + let parameters: [String:Any]? + let isBody: Bool + let method: String + let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift new file mode 100644 index 00000000000..9c135bdce3a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift @@ -0,0 +1,52 @@ +// +// AnotherfakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class AnotherfakeAPI { + /** + To test special tags + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift new file mode 100644 index 00000000000..a111760bee0 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -0,0 +1,450 @@ +// +// FakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: OuterBoolean? = nil, completion: @escaping ((_ data: OuterBoolean?,_ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input boolean as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - examples: [{contentType=application/json, example={ + "my_string" : { }, + "my_number" : { }, + "my_boolean" : { } +}}] + + - parameter body: (body) Input composite as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: OuterNumber? = nil, completion: @escaping ((_ data: OuterNumber?,_ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input number as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: OuterString? = nil, completion: @escaping ((_ data: OuterString?,_ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input string as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: basic + - name: http_basic_test + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: Data? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + To test enum parameters + + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to -efg) + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to -efg) + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + To test enum parameters + - GET /fake + - To test enum parameters + + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to -efg) + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to -efg) + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to -efg) + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) + + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = NSURLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue + ]) + + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + test json serialization of form data + - GET /fake/jsonFormData + - + + - parameter param: (form) field1 + - parameter param2: (form) field2 + + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift new file mode 100644 index 00000000000..35c9e383fa2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/Fake_classname_tags123API.swift @@ -0,0 +1,54 @@ +// +// Fake_classname_tags123API.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class Fake_classname_tags123API { + /** + To test class name in snake case + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + To test class name in snake case + - PATCH /fake_classname_test + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift new file mode 100644 index 00000000000..6a7425564aa --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -0,0 +1,588 @@ +// +// PetAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class PetAPI { + /** + Add a new pet to the store + + - parameter body: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(body: Pet, completion: @escaping ((_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Add a new pet to the store + - POST /pet + - + - OAuth: + - type: oauth2 + - name: petstore_auth + + - parameter body: (body) Pet object that needs to be added to the store + + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Deletes a pet + - DELETE /pet/{petId} + - + - OAuth: + - type: oauth2 + - name: petstore_auth + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + path = path.replacingOccurrences(of: "{petId}", with: "\(petId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example=[ { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}, { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +} ]}] + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example=[ { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}, { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +} ]}] + + - parameter status: (query) Status values that need to be considered for filter + + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "status": status + ]) + + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example=[ { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}, { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +} ]}] + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example=[ { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}, { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +} ]}] + + - parameter tags: (query) Tags to filter by + + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "tags": tags + ]) + + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example={ + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}] + - examples: [{contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}, {contentType=application/json, example={ + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}] + + - parameter petId: (path) ID of pet to return + + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + path = path.replacingOccurrences(of: "{petId}", with: "\(petId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter body: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(body: Pet, completion: @escaping ((_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Update an existing pet + - PUT /pet + - + - OAuth: + - type: oauth2 + - name: petstore_auth + + - parameter body: (body) Pet object that needs to be added to the store + + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - + - OAuth: + - type: oauth2 + - name: petstore_auth + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + path = path.replacingOccurrences(of: "{petId}", with: "\(petId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/json, example={ + "code" : 0, + "type" : "type", + "message" : "message" +}}] + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + path = path.replacingOccurrences(of: "{petId}", with: "\(petId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift new file mode 100644 index 00000000000..756ada76c42 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -0,0 +1,219 @@ +// +// StoreAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + - parameter orderId: (path) ID of the order that needs to be deleted + + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - examples: [{contentType=application/json, example={ + "key" : 0 +}}] + + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - examples: [{contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}, {contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}] + - examples: [{contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}, {contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}] + + - parameter orderId: (path) ID of pet that needs to be fetched + + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + path = path.replacingOccurrences(of: "{order_id}", with: "\(orderId)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter body: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Place an order for a pet + - POST /store/order + - + - examples: [{contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}, {contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}] + - examples: [{contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}, {contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}] + + - parameter body: (body) order placed for purchasing the pet + + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift new file mode 100644 index 00000000000..cbc7bd93258 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/APIs/UserAPI.swift @@ -0,0 +1,344 @@ +// +// UserAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + + + +open class UserAPI { + /** + Create user + + - parameter body: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(body: User, completion: @escaping ((_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Create user + - POST /user + - This can only be done by the logged in user. + + - parameter body: (body) Created user object + + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter body: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithArray + - + + - parameter body: (body) List of user object + + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter body: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithList + - + + - parameter body: (body) List of user object + + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + + - parameter username: (path) The name that needs to be deleted + + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Get user by user name + - GET /user/{username} + - + - examples: [{contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}, {contentType=application/json, example={ + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +}}] + - examples: [{contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}, {contentType=application/json, example={ + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +}}] + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + + /** + Logs user into the system + - GET /user/login + - + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example=""}] + - examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example=""}] + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "username": username, + "password": password + ]) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Logs out current logged in user session + - GET /user/logout + - + + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter body: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + completion(error); + } + } + + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + + - parameter username: (path) name that need to be deleted + - parameter body: (body) Updated user object + + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + var path = "/user/{username}" + path = path.replacingOccurrences(of: "{username}", with: "\(username)", options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift new file mode 100644 index 00000000000..0d294aee4ce --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift @@ -0,0 +1,417 @@ +// AlamofireImplementations.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + managerStore[managerId] = manager + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + break + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + break + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + break + default: + fatalError("Unprocessable value \(v) with key \(k)") + break + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.Error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if (dataResponse.result.isFailure) { + completion( + nil, + ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.Error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.Error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if (dataResponse.result.isFailure) { + completion( + nil, + ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.Error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.Error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.Error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/CodableHelper.swift new file mode 100644 index 00000000000..d56cb0e7348 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/CodableHelper.swift @@ -0,0 +1,55 @@ +// +// CodableHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +open class CodableHelper { + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + decoder.dataDecodingStrategy = .base64 + if #available(iOS 10.0, *) { + decoder.dateDecodingStrategy = .iso8601 + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + if #available(iOS 10.0, *) { + encoder.dateEncodingStrategy = .iso8601 + } + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift new file mode 100644 index 00000000000..c03a10b930c --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift new file mode 100644 index 00000000000..9cac90e08d4 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -0,0 +1,173 @@ +// Extensions.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key as! NSObject] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift new file mode 100644 index 00000000000..472e955ee8e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodableEncoding.swift @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift new file mode 100644 index 00000000000..4cf4ac206af --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/JSONEncodingHelper.swift @@ -0,0 +1,27 @@ +// +// JSONEncodingHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift new file mode 100644 index 00000000000..2c19b321582 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models.swift @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case Error(Int, Data?, Error) +} + +open class Response { + open let statusCode: Int + open let header: [String: String] + open let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for (key, value) in rawHeader { + header[key as! String] = value as? String + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift new file mode 100644 index 00000000000..57e6d1f76e1 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,42 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class AdditionalPropertiesClass: Codable { + + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? + + + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(mapProperty, forKey: "map_property") + try container.encodeIfPresent(mapOfMapProperty, forKey: "map_of_map_property") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapProperty = try container.decodeIfPresent([String:String].self, forKey: "map_property") + mapOfMapProperty = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_of_map_property") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift new file mode 100644 index 00000000000..fd48bfb9b4c --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Animal.swift @@ -0,0 +1,42 @@ +// +// Animal.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Animal: Codable { + + public var className: String + public var color: String? + + + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encode(className, forKey: "className") + try container.encodeIfPresent(color, forKey: "color") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + className = try container.decode(String.self, forKey: "className") + color = try container.decodeIfPresent(String.self, forKey: "color") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift new file mode 100644 index 00000000000..68308364894 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift new file mode 100644 index 00000000000..179d2683331 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift @@ -0,0 +1,51 @@ +// +// ApiResponse.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class ApiResponse: Codable { + + public var code: Int? + public var codeNum: NSNumber? { + get { + return code.map({ return NSNumber(value: $0) }) + } + } + public var type: String? + public var message: String? + + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(code, forKey: "code") + try container.encodeIfPresent(type, forKey: "type") + try container.encodeIfPresent(message, forKey: "message") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + code = try container.decodeIfPresent(Int.self, forKey: "code") + type = try container.decodeIfPresent(String.self, forKey: "type") + message = try container.decodeIfPresent(String.self, forKey: "message") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 00000000000..0b3c86516c4 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,38 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class ArrayOfArrayOfNumberOnly: Codable { + + public var arrayArrayNumber: [[Double]]? + + + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeArrayIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayArrayNumber = try container.decodeArrayIfPresent([Double].self, forKey: "ArrayArrayNumber") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift new file mode 100644 index 00000000000..733fda10ef4 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,38 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class ArrayOfNumberOnly: Codable { + + public var arrayNumber: [Double]? + + + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeArrayIfPresent(arrayNumber, forKey: "ArrayNumber") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayNumber = try container.decodeArrayIfPresent(Double.self, forKey: "ArrayNumber") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift new file mode 100644 index 00000000000..fd948816d28 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift @@ -0,0 +1,46 @@ +// +// ArrayTest.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class ArrayTest: Codable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeArrayIfPresent(arrayOfString, forKey: "array_of_string") + try container.encodeArrayIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer") + try container.encodeArrayIfPresent(arrayArrayOfModel, forKey: "array_array_of_model") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayOfString = try container.decodeArrayIfPresent(String.self, forKey: "array_of_string") + arrayArrayOfInteger = try container.decodeArrayIfPresent([Int64].self, forKey: "array_array_of_integer") + arrayArrayOfModel = try container.decodeArrayIfPresent([ReadOnlyFirst].self, forKey: "array_array_of_model") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift new file mode 100644 index 00000000000..32ea816610e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift @@ -0,0 +1,59 @@ +// +// Capitalization.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Capitalization: Codable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(smallCamel, forKey: "smallCamel") + try container.encodeIfPresent(capitalCamel, forKey: "CapitalCamel") + try container.encodeIfPresent(smallSnake, forKey: "small_Snake") + try container.encodeIfPresent(capitalSnake, forKey: "Capital_Snake") + try container.encodeIfPresent(sCAETHFlowPoints, forKey: "SCA_ETH_Flow_Points") + try container.encodeIfPresent(ATT_NAME, forKey: "ATT_NAME") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + smallCamel = try container.decodeIfPresent(String.self, forKey: "smallCamel") + capitalCamel = try container.decodeIfPresent(String.self, forKey: "CapitalCamel") + smallSnake = try container.decodeIfPresent(String.self, forKey: "small_Snake") + capitalSnake = try container.decodeIfPresent(String.self, forKey: "Capital_Snake") + sCAETHFlowPoints = try container.decodeIfPresent(String.self, forKey: "SCA_ETH_Flow_Points") + ATT_NAME = try container.decodeIfPresent(String.self, forKey: "ATT_NAME") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift new file mode 100644 index 00000000000..95dc0e89fed --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Cat.swift @@ -0,0 +1,43 @@ +// +// Cat.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Cat: Animal { + + public var declawed: Bool? + public var declawedNum: NSNumber? { + get { + return declawed.map({ return NSNumber(value: $0) }) + } + } + + + public init(declawed: Bool?) { + self.declawed = declawed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(declawed, forKey: "declawed") + } + + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + declawed = try container.decodeIfPresent(Bool.self, forKey: "declawed") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift new file mode 100644 index 00000000000..86f3f99f359 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Category.swift @@ -0,0 +1,47 @@ +// +// Category.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Category: Codable { + + public var id: Int64? + public var idNum: NSNumber? { + get { + return id.map({ return NSNumber(value: $0) }) + } + } + public var name: String? + + + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift new file mode 100644 index 00000000000..8d80e263370 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift @@ -0,0 +1,39 @@ +// +// ClassModel.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** Model for testing model with \"_class\" property */ + +open class ClassModel: Codable { + + public var _class: String? + + + public init(_class: String?) { + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(_class, forKey: "_class") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _class = try container.decodeIfPresent(String.self, forKey: "_class") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift new file mode 100644 index 00000000000..3a74788606b --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Client.swift @@ -0,0 +1,38 @@ +// +// Client.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Client: Codable { + + public var client: String? + + + public init(client: String?) { + self.client = client + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(client, forKey: "client") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + client = try container.decodeIfPresent(String.self, forKey: "client") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift new file mode 100644 index 00000000000..2835af6b0f9 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Dog.swift @@ -0,0 +1,38 @@ +// +// Dog.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Dog: Animal { + + public var breed: String? + + + public init(breed: String?) { + self.breed = breed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(breed, forKey: "breed") + } + + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + breed = try container.decodeIfPresent(String.self, forKey: "breed") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift new file mode 100644 index 00000000000..bb7960a7577 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift @@ -0,0 +1,50 @@ +// +// EnumArrays.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class EnumArrays: Codable { + + public enum JustSymbol: String, Codable { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + } + public enum ArrayEnum: String, Codable { + case fish = "fish" + case crab = "crab" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(justSymbol, forKey: "just_symbol") + try container.encodeArrayIfPresent(arrayEnum, forKey: "array_enum") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justSymbol = try container.decodeIfPresent(String.self, forKey: "just_symbol") + arrayEnum = try container.decodeArrayIfPresent(String.self, forKey: "array_enum") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift new file mode 100644 index 00000000000..d0889a3520a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumClass.swift @@ -0,0 +1,16 @@ +// +// EnumClass.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public enum EnumClass: String, Codable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift new file mode 100644 index 00000000000..023f9a8209c --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -0,0 +1,63 @@ +// +// EnumTest.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class EnumTest: Codable { + + public enum EnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumInteger: Int, Codable { + case _1 = 1 + case number1 = -1 + } + public enum EnumNumber: Double, Codable { + case _11 = 1.1 + case number12 = -1.2 + } + public var enumString: EnumString? + public var enumInteger: EnumInteger? + public var enumNumber: EnumNumber? + public var outerEnum: OuterEnum? + + + public init(enumString: EnumString?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(enumString, forKey: "enum_string") + try container.encodeIfPresent(enumInteger, forKey: "enum_integer") + try container.encodeIfPresent(enumNumber, forKey: "enum_number") + try container.encodeIfPresent(outerEnum, forKey: "outerEnum") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + enumString = try container.decodeIfPresent(String.self, forKey: "enum_string") + enumInteger = try container.decodeIfPresent(Int.self, forKey: "enum_integer") + enumNumber = try container.decodeIfPresent(Double.self, forKey: "enum_number") + outerEnum = try container.decodeIfPresent(OuterEnum.self, forKey: "outerEnum") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift new file mode 100644 index 00000000000..a59ece71da9 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift @@ -0,0 +1,116 @@ +// +// FormatTest.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class FormatTest: Codable { + + public var integer: Int? + public var integerNum: NSNumber? { + get { + return integer.map({ return NSNumber(value: $0) }) + } + } + public var int32: Int? + public var int32Num: NSNumber? { + get { + return int32.map({ return NSNumber(value: $0) }) + } + } + public var int64: Int64? + public var int64Num: NSNumber? { + get { + return int64.map({ return NSNumber(value: $0) }) + } + } + public var number: Double + public var numberNum: NSNumber? { + get { + return number.map({ return NSNumber(value: $0) }) + } + } + public var float: Float? + public var floatNum: NSNumber? { + get { + return float.map({ return NSNumber(value: $0) }) + } + } + public var double: Double? + public var doubleNum: NSNumber? { + get { + return double.map({ return NSNumber(value: $0) }) + } + } + public var string: String? + public var byte: Data + public var binary: Data? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: Data?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(integer, forKey: "integer") + try container.encodeIfPresent(int32, forKey: "int32") + try container.encodeIfPresent(int64, forKey: "int64") + try container.encode(number, forKey: "number") + try container.encodeIfPresent(float, forKey: "float") + try container.encodeIfPresent(double, forKey: "double") + try container.encodeIfPresent(string, forKey: "string") + try container.encode(byte, forKey: "byte") + try container.encodeIfPresent(binary, forKey: "binary") + try container.encode(date, forKey: "date") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encode(password, forKey: "password") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + integer = try container.decodeIfPresent(Int.self, forKey: "integer") + int32 = try container.decodeIfPresent(Int.self, forKey: "int32") + int64 = try container.decodeIfPresent(Int64.self, forKey: "int64") + number = try container.decode(Double.self, forKey: "number") + float = try container.decodeIfPresent(Float.self, forKey: "float") + double = try container.decodeIfPresent(Double.self, forKey: "double") + string = try container.decodeIfPresent(String.self, forKey: "string") + byte = try container.decode(Data.self, forKey: "byte") + binary = try container.decodeIfPresent(Data.self, forKey: "binary") + date = try container.decode(Date.self, forKey: "date") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + password = try container.decode(String.self, forKey: "password") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift new file mode 100644 index 00000000000..226ffe44b08 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift @@ -0,0 +1,42 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class HasOnlyReadOnly: Codable { + + public var bar: String? + public var foo: String? + + + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(foo, forKey: "foo") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + foo = try container.decodeIfPresent(String.self, forKey: "foo") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift new file mode 100644 index 00000000000..5f4068ffbeb --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/List.swift @@ -0,0 +1,38 @@ +// +// List.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class List: Codable { + + public var _123List: String? + + + public init(_123List: String?) { + self._123List = _123List + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(_123List, forKey: "123-list") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _123List = try container.decodeIfPresent(String.self, forKey: "123-list") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift new file mode 100644 index 00000000000..36f31fc1a44 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MapTest.swift @@ -0,0 +1,46 @@ +// +// MapTest.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + + + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(mapMapOfString, forKey: "map_map_of_string") + try container.encodeIfPresent(mapOfEnumString, forKey: "map_of_enum_string") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapMapOfString = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_map_of_string") + mapOfEnumString = try container.decodeIfPresent([String:String].self, forKey: "map_of_enum_string") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 00000000000..0f475c175d2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,46 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class MixedPropertiesAndAdditionalPropertiesClass: Codable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String:Animal]? + + + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(map, forKey: "map") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + map = try container.decodeIfPresent([String:Animal].self, forKey: "map") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift new file mode 100644 index 00000000000..770fff458c3 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift @@ -0,0 +1,48 @@ +// +// Model200Response.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** Model for testing model name starting with number */ + +open class Model200Response: Codable { + + public var name: Int? + public var nameNum: NSNumber? { + get { + return name.map({ return NSNumber(value: $0) }) + } + } + public var _class: String? + + + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(name, forKey: "name") + try container.encodeIfPresent(_class, forKey: "class") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decodeIfPresent(Int.self, forKey: "name") + _class = try container.decodeIfPresent(String.self, forKey: "class") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift new file mode 100644 index 00000000000..87d61fd934a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Name.swift @@ -0,0 +1,66 @@ +// +// Name.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** Model for testing model name same as property name */ + +open class Name: Codable { + + public var name: Int + public var nameNum: NSNumber? { + get { + return name.map({ return NSNumber(value: $0) }) + } + } + public var snakeCase: Int? + public var snakeCaseNum: NSNumber? { + get { + return snakeCase.map({ return NSNumber(value: $0) }) + } + } + public var property: String? + public var _123Number: Int? + public var _123NumberNum: NSNumber? { + get { + return _123Number.map({ return NSNumber(value: $0) }) + } + } + + + public init(name: Int, snakeCase: Int?, property: String?, _123Number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123Number = _123Number + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encode(name, forKey: "name") + try container.encodeIfPresent(snakeCase, forKey: "snake_case") + try container.encodeIfPresent(property, forKey: "property") + try container.encodeIfPresent(_123Number, forKey: "123Number") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decode(Int.self, forKey: "name") + snakeCase = try container.decodeIfPresent(Int.self, forKey: "snake_case") + property = try container.decodeIfPresent(String.self, forKey: "property") + _123Number = try container.decodeIfPresent(Int.self, forKey: "123Number") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift new file mode 100644 index 00000000000..70d1c4bc178 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift @@ -0,0 +1,43 @@ +// +// NumberOnly.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class NumberOnly: Codable { + + public var justNumber: Double? + public var justNumberNum: NSNumber? { + get { + return justNumber.map({ return NSNumber(value: $0) }) + } + } + + + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(justNumber, forKey: "JustNumber") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justNumber = try container.decodeIfPresent(Double.self, forKey: "JustNumber") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift new file mode 100644 index 00000000000..cc8e7676973 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Order.swift @@ -0,0 +1,84 @@ +// +// Order.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Order: Codable { + + public enum Status: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var id: Int64? + public var idNum: NSNumber? { + get { + return id.map({ return NSNumber(value: $0) }) + } + } + public var petId: Int64? + public var petIdNum: NSNumber? { + get { + return petId.map({ return NSNumber(value: $0) }) + } + } + public var quantity: Int? + public var quantityNum: NSNumber? { + get { + return quantity.map({ return NSNumber(value: $0) }) + } + } + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? + public var completeNum: NSNumber? { + get { + return complete.map({ return NSNumber(value: $0) }) + } + } + + + public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(petId, forKey: "petId") + try container.encodeIfPresent(quantity, forKey: "quantity") + try container.encodeIfPresent(shipDate, forKey: "shipDate") + try container.encodeIfPresent(status, forKey: "status") + try container.encodeIfPresent(complete, forKey: "complete") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + petId = try container.decodeIfPresent(Int64.self, forKey: "petId") + quantity = try container.decodeIfPresent(Int.self, forKey: "quantity") + shipDate = try container.decodeIfPresent(Date.self, forKey: "shipDate") + status = try container.decodeIfPresent(String.self, forKey: "status") + complete = try container.decodeIfPresent(Bool.self, forKey: "complete") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift new file mode 100644 index 00000000000..ce257737983 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -0,0 +1,32 @@ +// +// OuterBoolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class OuterBoolean: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift new file mode 100644 index 00000000000..cf46c19e7f1 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -0,0 +1,46 @@ +// +// OuterComposite.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class OuterComposite: Codable { + + public var myNumber: OuterNumber? + public var myString: OuterString? + public var myBoolean: OuterBoolean? + + + public init(myNumber: OuterNumber?, myString: OuterString?, myBoolean: OuterBoolean?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(myNumber, forKey: "my_number") + try container.encodeIfPresent(myString, forKey: "my_string") + try container.encodeIfPresent(myBoolean, forKey: "my_boolean") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myNumber = try container.decodeIfPresent(OuterNumber.self, forKey: "my_number") + myString = try container.decodeIfPresent(OuterString.self, forKey: "my_string") + myBoolean = try container.decodeIfPresent(OuterBoolean.self, forKey: "my_boolean") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift new file mode 100644 index 00000000000..d6222d2b1c4 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterEnum.swift @@ -0,0 +1,16 @@ +// +// OuterEnum.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public enum OuterEnum: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift new file mode 100644 index 00000000000..3cd67121150 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -0,0 +1,32 @@ +// +// OuterNumber.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class OuterNumber: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift new file mode 100644 index 00000000000..0d9f059b91c --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -0,0 +1,32 @@ +// +// OuterString.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class OuterString: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift new file mode 100644 index 00000000000..4554246b888 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Pet.swift @@ -0,0 +1,69 @@ +// +// Pet.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Pet: Codable { + + public enum Status: String, Codable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var id: Int64? + public var idNum: NSNumber? { + get { + return id.map({ return NSNumber(value: $0) }) + } + } + public var category: Category? + public var name: String + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + + public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(category, forKey: "category") + try container.encode(name, forKey: "name") + try container.encodeArray(photoUrls, forKey: "photoUrls") + try container.encodeArrayIfPresent(tags, forKey: "tags") + try container.encodeIfPresent(status, forKey: "status") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + category = try container.decodeIfPresent(Category.self, forKey: "category") + name = try container.decode(String.self, forKey: "name") + photoUrls = try container.decodeArray(String.self, forKey: "photoUrls") + tags = try container.decodeArrayIfPresent(Tag.self, forKey: "tags") + status = try container.decodeIfPresent(String.self, forKey: "status") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift new file mode 100644 index 00000000000..e608e6845b2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift @@ -0,0 +1,42 @@ +// +// ReadOnlyFirst.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class ReadOnlyFirst: Codable { + + public var bar: String? + public var baz: String? + + + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(baz, forKey: "baz") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + baz = try container.decodeIfPresent(String.self, forKey: "baz") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift new file mode 100644 index 00000000000..842500cc9e2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Return.swift @@ -0,0 +1,44 @@ +// +// Return.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** Model for testing reserved words */ + +open class Return: Codable { + + public var _return: Int? + public var _returnNum: NSNumber? { + get { + return _return.map({ return NSNumber(value: $0) }) + } + } + + + public init(_return: Int?) { + self._return = _return + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(_return, forKey: "return") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _return = try container.decodeIfPresent(Int.self, forKey: "return") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift new file mode 100644 index 00000000000..3038695b3bd --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift @@ -0,0 +1,43 @@ +// +// SpecialModelName.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class SpecialModelName: Codable { + + public var specialPropertyName: Int64? + public var specialPropertyNameNum: NSNumber? { + get { + return specialPropertyName.map({ return NSNumber(value: $0) }) + } + } + + + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(specialPropertyName, forKey: "$special[property.name]") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + specialPropertyName = try container.decodeIfPresent(Int64.self, forKey: "$special[property.name]") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift new file mode 100644 index 00000000000..ff0a3f30cfd --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/Tag.swift @@ -0,0 +1,47 @@ +// +// Tag.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class Tag: Codable { + + public var id: Int64? + public var idNum: NSNumber? { + get { + return id.map({ return NSNumber(value: $0) }) + } + } + public var name: String? + + + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift new file mode 100644 index 00000000000..dc81aff50a1 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/Swaggers/Models/User.swift @@ -0,0 +1,77 @@ +// +// User.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + + +open class User: Codable { + + public var id: Int64? + public var idNum: NSNumber? { + get { + return id.map({ return NSNumber(value: $0) }) + } + } + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + public var userStatusNum: NSNumber? { + get { + return userStatus.map({ return NSNumber(value: $0) }) + } + } + + + public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(username, forKey: "username") + try container.encodeIfPresent(firstName, forKey: "firstName") + try container.encodeIfPresent(lastName, forKey: "lastName") + try container.encodeIfPresent(email, forKey: "email") + try container.encodeIfPresent(password, forKey: "password") + try container.encodeIfPresent(phone, forKey: "phone") + try container.encodeIfPresent(userStatus, forKey: "userStatus") + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + username = try container.decodeIfPresent(String.self, forKey: "username") + firstName = try container.decodeIfPresent(String.self, forKey: "firstName") + lastName = try container.decodeIfPresent(String.self, forKey: "lastName") + email = try container.decodeIfPresent(String.self, forKey: "email") + password = try container.decodeIfPresent(String.self, forKey: "password") + phone = try container.decodeIfPresent(String.self, forKey: "phone") + userStatus = try container.decodeIfPresent(Int.self, forKey: "userStatus") + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/git_push.sh b/samples/client/petstore/swift4/objcCompatible/git_push.sh new file mode 100644 index 00000000000..ed374619b13 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec index c7fe7969a40..586be868c71 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' - s.dependency 'Alamofire', '~> 4.5' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift new file mode 100644 index 00000000000..c0ef57a2874 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift @@ -0,0 +1,70 @@ +// +// AnotherfakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class AnotherfakeAPI { + /** + To test special tags + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + /** + To test special tags + + - parameter body: (body) client model + - returns: Promise + */ + open class func testSpecialTags( body: Client) -> Promise { + let deferred = Promise.pending() + testSpecialTags(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index faf17cc514d..2716cd9834b 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -439,7 +439,7 @@ open class FakeAPI { */ public enum EnumQueryInteger_testEnumParameters: Int { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -447,7 +447,7 @@ open class FakeAPI { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift index d672b1f7993..31d63e53fe6 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -85,6 +85,92 @@ extension UUID: JSONEncodable { } } +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + extension RequestBuilder { public func execute() -> Promise> { let deferred = Promise>.pending() diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift index b18644a34e3..57e6d1f76e1 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift @@ -8,17 +8,35 @@ import Foundation + open class AdditionalPropertiesClass: Codable { public var mapProperty: [String:String]? public var mapOfMapProperty: [String:[String:String]]? - public init() {} + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapProperty = "map_property" - case mapOfMapProperty = "map_of_map_property" + try container.encodeIfPresent(mapProperty, forKey: "map_property") + try container.encodeIfPresent(mapOfMapProperty, forKey: "map_of_map_property") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapProperty = try container.decodeIfPresent([String:String].self, forKey: "map_property") + mapOfMapProperty = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_of_map_property") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift index 1c0cc68a298..fd48bfb9b4c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Animal.swift @@ -8,17 +8,35 @@ import Foundation + open class Animal: Codable { - public var className: String? + public var className: String public var color: String? - public init() {} + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case className = "className" - case color = "color" + try container.encode(className, forKey: "className") + try container.encodeIfPresent(color, forKey: "color") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + className = try container.decode(String.self, forKey: "className") + color = try container.decodeIfPresent(String.self, forKey: "color") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift index 842755fb3c4..de8b7ec6ebd 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift @@ -8,19 +8,39 @@ import Foundation + open class ApiResponse: Codable { public var code: Int? public var type: String? public var message: String? - public init() {} + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case code = "code" - case type = "type" - case message = "message" + try container.encodeIfPresent(code, forKey: "code") + try container.encodeIfPresent(type, forKey: "type") + try container.encodeIfPresent(message, forKey: "message") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + code = try container.decodeIfPresent(Int.self, forKey: "code") + type = try container.decodeIfPresent(String.self, forKey: "type") + message = try container.decodeIfPresent(String.self, forKey: "message") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift index 9f7ee34099c..0b3c86516c4 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init() {} + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" + try container.encodeArrayIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayArrayNumber = try container.decodeArrayIfPresent([Double].self, forKey: "ArrayArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift index fba11ceb708..733fda10ef4 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init() {} + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" + try container.encodeArrayIfPresent(arrayNumber, forKey: "ArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayNumber = try container.decodeArrayIfPresent(Double.self, forKey: "ArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift index bdf244f5e0a..fd948816d28 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift @@ -8,19 +8,39 @@ import Foundation + open class ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init() {} + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" + try container.encodeArrayIfPresent(arrayOfString, forKey: "array_of_string") + try container.encodeArrayIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer") + try container.encodeArrayIfPresent(arrayArrayOfModel, forKey: "array_array_of_model") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayOfString = try container.decodeArrayIfPresent(String.self, forKey: "array_of_string") + arrayArrayOfInteger = try container.decodeArrayIfPresent([Int64].self, forKey: "array_array_of_integer") + arrayArrayOfModel = try container.decodeArrayIfPresent([ReadOnlyFirst].self, forKey: "array_array_of_model") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift index a39eda9087c..32ea816610e 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift @@ -8,6 +8,7 @@ import Foundation + open class Capitalization: Codable { public var smallCamel: String? @@ -18,16 +19,41 @@ open class Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init() {} + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case smallCamel = "smallCamel" - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME = "ATT_NAME" + try container.encodeIfPresent(smallCamel, forKey: "smallCamel") + try container.encodeIfPresent(capitalCamel, forKey: "CapitalCamel") + try container.encodeIfPresent(smallSnake, forKey: "small_Snake") + try container.encodeIfPresent(capitalSnake, forKey: "Capital_Snake") + try container.encodeIfPresent(sCAETHFlowPoints, forKey: "SCA_ETH_Flow_Points") + try container.encodeIfPresent(ATT_NAME, forKey: "ATT_NAME") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + smallCamel = try container.decodeIfPresent(String.self, forKey: "smallCamel") + capitalCamel = try container.decodeIfPresent(String.self, forKey: "CapitalCamel") + smallSnake = try container.decodeIfPresent(String.self, forKey: "small_Snake") + capitalSnake = try container.decodeIfPresent(String.self, forKey: "Capital_Snake") + sCAETHFlowPoints = try container.decodeIfPresent(String.self, forKey: "SCA_ETH_Flow_Points") + ATT_NAME = try container.decodeIfPresent(String.self, forKey: "ATT_NAME") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift index fdb090535aa..1354abdf4f0 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Cat.swift @@ -8,15 +8,31 @@ import Foundation + open class Cat: Animal { public var declawed: Bool? - + public init(declawed: Bool?) { + self.declawed = declawed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case declawed = "declawed" + try container.encodeIfPresent(declawed, forKey: "declawed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + declawed = try container.decodeIfPresent(Bool.self, forKey: "declawed") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift index 684443a0649..4d631bf8273 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Category.swift @@ -8,17 +8,35 @@ import Foundation + open class Category: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift index a3d86c6c6f9..8d80e263370 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing model with \"_class\" property */ + open class ClassModel: Codable { public var _class: String? - public init() {} + public init(_class: String?) { + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _class = "_class" + try container.encodeIfPresent(_class, forKey: "_class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _class = try container.decodeIfPresent(String.self, forKey: "_class") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift index 9d6d71b2367..3a74788606b 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Client.swift @@ -8,15 +8,31 @@ import Foundation + open class Client: Codable { public var client: String? - public init() {} + public init(client: String?) { + self.client = client + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case client = "client" + try container.encodeIfPresent(client, forKey: "client") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + client = try container.decodeIfPresent(String.self, forKey: "client") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift index ffaab37e621..2835af6b0f9 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Dog.swift @@ -8,15 +8,31 @@ import Foundation + open class Dog: Animal { public var breed: String? - + public init(breed: String?) { + self.breed = breed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case breed = "breed" + try container.encodeIfPresent(breed, forKey: "breed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + breed = try container.decodeIfPresent(String.self, forKey: "breed") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift index 9b2e72b9819..bb7960a7577 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -21,12 +22,29 @@ open class EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init() {} + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" + try container.encodeIfPresent(justSymbol, forKey: "just_symbol") + try container.encodeArrayIfPresent(arrayEnum, forKey: "array_enum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justSymbol = try container.decodeIfPresent(String.self, forKey: "just_symbol") + arrayEnum = try container.decodeArrayIfPresent(String.self, forKey: "array_enum") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index 89dad808a5e..023f9a8209c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumTest: Codable { public enum EnumString: String, Codable { @@ -17,25 +18,46 @@ open class EnumTest: Codable { } public enum EnumInteger: Int, Codable { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double, Codable { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init() {} + public init(enumString: EnumString?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum = "outerEnum" + try container.encodeIfPresent(enumString, forKey: "enum_string") + try container.encodeIfPresent(enumInteger, forKey: "enum_integer") + try container.encodeIfPresent(enumNumber, forKey: "enum_number") + try container.encodeIfPresent(outerEnum, forKey: "outerEnum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + enumString = try container.decodeIfPresent(String.self, forKey: "enum_string") + enumInteger = try container.decodeIfPresent(Int.self, forKey: "enum_integer") + enumNumber = try container.decodeIfPresent(Double.self, forKey: "enum_number") + outerEnum = try container.decodeIfPresent(OuterEnum.self, forKey: "outerEnum") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift index d4a1e5f8e52..3423c30d9b9 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift @@ -8,39 +8,79 @@ import Foundation + open class FormatTest: Codable { public var integer: Int? public var int32: Int? public var int64: Int64? - public var number: Double? + public var number: Double public var float: Float? public var double: Double? public var string: String? - public var byte: Data? + public var byte: Data public var binary: Data? - public var date: Date? + public var date: Date public var dateTime: Date? public var uuid: UUID? - public var password: String? - - public init() {} - - - private enum CodingKeys: String, CodingKey { - case integer = "integer" - case int32 = "int32" - case int64 = "int64" - case number = "number" - case float = "float" - case double = "double" - case string = "string" - case byte = "byte" - case binary = "binary" - case date = "date" - case dateTime = "dateTime" - case uuid = "uuid" - case password = "password" + public var password: String + + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: Data?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(integer, forKey: "integer") + try container.encodeIfPresent(int32, forKey: "int32") + try container.encodeIfPresent(int64, forKey: "int64") + try container.encode(number, forKey: "number") + try container.encodeIfPresent(float, forKey: "float") + try container.encodeIfPresent(double, forKey: "double") + try container.encodeIfPresent(string, forKey: "string") + try container.encode(byte, forKey: "byte") + try container.encodeIfPresent(binary, forKey: "binary") + try container.encode(date, forKey: "date") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encode(password, forKey: "password") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + integer = try container.decodeIfPresent(Int.self, forKey: "integer") + int32 = try container.decodeIfPresent(Int.self, forKey: "int32") + int64 = try container.decodeIfPresent(Int64.self, forKey: "int64") + number = try container.decode(Double.self, forKey: "number") + float = try container.decodeIfPresent(Float.self, forKey: "float") + double = try container.decodeIfPresent(Double.self, forKey: "double") + string = try container.decodeIfPresent(String.self, forKey: "string") + byte = try container.decode(Data.self, forKey: "byte") + binary = try container.decodeIfPresent(Data.self, forKey: "binary") + date = try container.decode(Date.self, forKey: "date") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + password = try container.decode(String.self, forKey: "password") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift index f3f4f794975..226ffe44b08 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift @@ -8,17 +8,35 @@ import Foundation + open class HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init() {} + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case foo = "foo" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(foo, forKey: "foo") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + foo = try container.decodeIfPresent(String.self, forKey: "foo") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift index 4062dc0fef9..5f4068ffbeb 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/List.swift @@ -8,15 +8,31 @@ import Foundation + open class List: Codable { public var _123List: String? - public init() {} + public init(_123List: String?) { + self._123List = _123List + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _123List = "123-list" + try container.encodeIfPresent(_123List, forKey: "123-list") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _123List = try container.decodeIfPresent(String.self, forKey: "123-list") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift index 1ccfa4e4e75..36f31fc1a44 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MapTest.swift @@ -8,6 +8,7 @@ import Foundation + open class MapTest: Codable { public enum MapOfEnumString: String, Codable { @@ -17,12 +18,29 @@ open class MapTest: Codable { public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public init() {} + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" + try container.encodeIfPresent(mapMapOfString, forKey: "map_map_of_string") + try container.encodeIfPresent(mapOfEnumString, forKey: "map_of_enum_string") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapMapOfString = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_map_of_string") + mapOfEnumString = try container.decodeIfPresent([String:String].self, forKey: "map_of_enum_string") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 801890006a0..0f475c175d2 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -8,19 +8,39 @@ import Foundation + open class MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? public var map: [String:Animal]? - public init() {} + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case uuid = "uuid" - case dateTime = "dateTime" - case map = "map" + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(map, forKey: "map") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + map = try container.decodeIfPresent([String:Animal].self, forKey: "map") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift index 31e32d33583..6c671b5031d 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift @@ -9,17 +9,35 @@ import Foundation /** Model for testing model name starting with number */ + open class Model200Response: Codable { public var name: Int? public var _class: String? - public init() {} + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case _class = "class" + try container.encodeIfPresent(name, forKey: "name") + try container.encodeIfPresent(_class, forKey: "class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decodeIfPresent(Int.self, forKey: "name") + _class = try container.decodeIfPresent(String.self, forKey: "class") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift index 3f44a95624f..873b77e3ab2 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Name.swift @@ -9,21 +9,43 @@ import Foundation /** Model for testing model name same as property name */ + open class Name: Codable { - public var name: Int? + public var name: Int public var snakeCase: Int? public var property: String? public var _123Number: Int? - public init() {} + public init(name: Int, snakeCase: Int?, property: String?, _123Number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123Number = _123Number + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case snakeCase = "snake_case" - case property = "property" - case _123Number = "123Number" + try container.encode(name, forKey: "name") + try container.encodeIfPresent(snakeCase, forKey: "snake_case") + try container.encodeIfPresent(property, forKey: "property") + try container.encodeIfPresent(_123Number, forKey: "123Number") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decode(Int.self, forKey: "name") + snakeCase = try container.decodeIfPresent(Int.self, forKey: "snake_case") + property = try container.decodeIfPresent(String.self, forKey: "property") + _123Number = try container.decodeIfPresent(Int.self, forKey: "123Number") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift index d3663be1e75..89921c2c9c6 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class NumberOnly: Codable { public var justNumber: Double? - public init() {} + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" + try container.encodeIfPresent(justNumber, forKey: "JustNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justNumber = try container.decodeIfPresent(Double.self, forKey: "JustNumber") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift index e9b1a0a8c2f..fee9d6c9192 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Order.swift @@ -8,6 +8,7 @@ import Foundation + open class Order: Codable { public enum Status: String, Codable { @@ -23,16 +24,41 @@ open class Order: Codable { public var status: Status? public var complete: Bool? - public init() {} + public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case petId = "petId" - case quantity = "quantity" - case shipDate = "shipDate" - case status = "status" - case complete = "complete" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(petId, forKey: "petId") + try container.encodeIfPresent(quantity, forKey: "quantity") + try container.encodeIfPresent(shipDate, forKey: "shipDate") + try container.encodeIfPresent(status, forKey: "status") + try container.encodeIfPresent(complete, forKey: "complete") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + petId = try container.decodeIfPresent(Int64.self, forKey: "petId") + quantity = try container.decodeIfPresent(Int.self, forKey: "quantity") + shipDate = try container.decodeIfPresent(Date.self, forKey: "shipDate") + status = try container.decodeIfPresent(String.self, forKey: "status") + complete = try container.decodeIfPresent(Bool.self, forKey: "complete") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift index 3c49ad29400..ce257737983 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterBoolean = Bool + +open class OuterBoolean: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift index b085a27a470..cf46c19e7f1 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -8,19 +8,39 @@ import Foundation + open class OuterComposite: Codable { public var myNumber: OuterNumber? public var myString: OuterString? public var myBoolean: OuterBoolean? - public init() {} + public init(myNumber: OuterNumber?, myString: OuterString?, myBoolean: OuterBoolean?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" + try container.encodeIfPresent(myNumber, forKey: "my_number") + try container.encodeIfPresent(myString, forKey: "my_string") + try container.encodeIfPresent(myBoolean, forKey: "my_boolean") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myNumber = try container.decodeIfPresent(OuterNumber.self, forKey: "my_number") + myString = try container.decodeIfPresent(OuterString.self, forKey: "my_string") + myBoolean = try container.decodeIfPresent(OuterBoolean.self, forKey: "my_boolean") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift index f285f4e5e29..3cd67121150 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterNumber = Double + +open class OuterNumber: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift index 9da794627d6..0d9f059b91c 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterString = String + +open class OuterString: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift index bf982f538ff..0622c110fd4 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Pet.swift @@ -8,6 +8,7 @@ import Foundation + open class Pet: Codable { public enum Status: String, Codable { @@ -17,22 +18,47 @@ open class Pet: Codable { } public var id: Int64? public var category: Category? - public var name: String? - public var photoUrls: [String]? + public var name: String + public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ public var status: Status? - public init() {} + public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case category = "category" - case name = "name" - case photoUrls = "photoUrls" - case tags = "tags" - case status = "status" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(category, forKey: "category") + try container.encode(name, forKey: "name") + try container.encodeArray(photoUrls, forKey: "photoUrls") + try container.encodeArrayIfPresent(tags, forKey: "tags") + try container.encodeIfPresent(status, forKey: "status") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + category = try container.decodeIfPresent(Category.self, forKey: "category") + name = try container.decode(String.self, forKey: "name") + photoUrls = try container.decodeArray(String.self, forKey: "photoUrls") + tags = try container.decodeArrayIfPresent(Tag.self, forKey: "tags") + status = try container.decodeIfPresent(String.self, forKey: "status") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift index 5a09771ea4b..e608e6845b2 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift @@ -8,17 +8,35 @@ import Foundation + open class ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init() {} + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case baz = "baz" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(baz, forKey: "baz") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + baz = try container.decodeIfPresent(String.self, forKey: "baz") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift index 22b9e0174a1..6429c137f3a 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Return.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing reserved words */ + open class Return: Codable { public var _return: Int? - public init() {} + public init(_return: Int?) { + self._return = _return + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _return = "return" + try container.encodeIfPresent(_return, forKey: "return") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _return = try container.decodeIfPresent(Int.self, forKey: "return") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift index 8c0a8f79dc6..de8c76fa3a9 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift @@ -8,15 +8,31 @@ import Foundation + open class SpecialModelName: Codable { public var specialPropertyName: Int64? - public init() {} + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" + try container.encodeIfPresent(specialPropertyName, forKey: "$special[property.name]") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + specialPropertyName = try container.decodeIfPresent(Int64.self, forKey: "$special[property.name]") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift index feb6ab7c6cd..ab230b5f899 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/Tag.swift @@ -8,17 +8,35 @@ import Foundation + open class Tag: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift index 8fda8afb40e..17e6af33d5d 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/Swaggers/Models/User.swift @@ -8,6 +8,7 @@ import Foundation + open class User: Codable { public var id: Int64? @@ -20,18 +21,47 @@ open class User: Codable { /** User Status */ public var userStatus: Int? - public init() {} + public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case username = "username" - case firstName = "firstName" - case lastName = "lastName" - case email = "email" - case password = "password" - case phone = "phone" - case userStatus = "userStatus" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(username, forKey: "username") + try container.encodeIfPresent(firstName, forKey: "firstName") + try container.encodeIfPresent(lastName, forKey: "lastName") + try container.encodeIfPresent(email, forKey: "email") + try container.encodeIfPresent(password, forKey: "password") + try container.encodeIfPresent(phone, forKey: "phone") + try container.encodeIfPresent(userStatus, forKey: "userStatus") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + username = try container.decodeIfPresent(String.self, forKey: "username") + firstName = try container.decodeIfPresent(String.self, forKey: "firstName") + lastName = try container.decodeIfPresent(String.self, forKey: "lastName") + email = try container.decodeIfPresent(String.self, forKey: "email") + password = try container.decodeIfPresent(String.self, forKey: "password") + phone = try container.decodeIfPresent(String.self, forKey: "phone") + userStatus = try container.decodeIfPresent(Int.self, forKey: "userStatus") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec index 5591aa3de99..64c4a5e4fea 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'RxSwift', '~> 3.4.1' - s.dependency 'Alamofire', '~> 4.5' + s.dependency 'Alamofire', '~> 4.5.0' end diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift new file mode 100644 index 00000000000..40ee161bd37 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/AnotherfakeAPI.swift @@ -0,0 +1,72 @@ +// +// AnotherfakeAPI.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire +import RxSwift + + + +open class AnotherfakeAPI { + /** + To test special tags + + - parameter body: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error); + } + } + + /** + To test special tags + + - parameter body: (body) client model + - returns: Observable + */ + open class func testSpecialTags(body: Client) -> Observable { + return Observable.create { observer -> Disposable in + testSpecialTags(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + + - parameter body: (body) client model + + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index d5c6beab25e..d045954a7c6 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -451,7 +451,7 @@ open class FakeAPI { */ public enum EnumQueryInteger_testEnumParameters: Int { case _1 = 1 - case numberminus2 = -2 + case number2 = -2 } /** @@ -459,7 +459,7 @@ open class FakeAPI { */ public enum EnumQueryDouble_testEnumParameters: Double { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } /** diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift index 202b47449d8..9cac90e08d4 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Extensions.swift @@ -84,4 +84,90 @@ extension UUID: JSONEncodable { } } +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift index b18644a34e3..57e6d1f76e1 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/AdditionalPropertiesClass.swift @@ -8,17 +8,35 @@ import Foundation + open class AdditionalPropertiesClass: Codable { public var mapProperty: [String:String]? public var mapOfMapProperty: [String:[String:String]]? - public init() {} + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapProperty = "map_property" - case mapOfMapProperty = "map_of_map_property" + try container.encodeIfPresent(mapProperty, forKey: "map_property") + try container.encodeIfPresent(mapOfMapProperty, forKey: "map_of_map_property") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapProperty = try container.decodeIfPresent([String:String].self, forKey: "map_property") + mapOfMapProperty = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_of_map_property") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift index 1c0cc68a298..fd48bfb9b4c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Animal.swift @@ -8,17 +8,35 @@ import Foundation + open class Animal: Codable { - public var className: String? + public var className: String public var color: String? - public init() {} + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case className = "className" - case color = "color" + try container.encode(className, forKey: "className") + try container.encodeIfPresent(color, forKey: "color") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + className = try container.decode(String.self, forKey: "className") + color = try container.decodeIfPresent(String.self, forKey: "color") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift index 842755fb3c4..de8b7ec6ebd 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ApiResponse.swift @@ -8,19 +8,39 @@ import Foundation + open class ApiResponse: Codable { public var code: Int? public var type: String? public var message: String? - public init() {} + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case code = "code" - case type = "type" - case message = "message" + try container.encodeIfPresent(code, forKey: "code") + try container.encodeIfPresent(type, forKey: "type") + try container.encodeIfPresent(message, forKey: "message") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + code = try container.decodeIfPresent(Int.self, forKey: "code") + type = try container.decodeIfPresent(String.self, forKey: "type") + message = try container.decodeIfPresent(String.self, forKey: "message") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift index 9f7ee34099c..0b3c86516c4 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init() {} + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" + try container.encodeArrayIfPresent(arrayArrayNumber, forKey: "ArrayArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayArrayNumber = try container.decodeArrayIfPresent([Double].self, forKey: "ArrayArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift index fba11ceb708..733fda10ef4 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayOfNumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init() {} + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" + try container.encodeArrayIfPresent(arrayNumber, forKey: "ArrayNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayNumber = try container.decodeArrayIfPresent(Double.self, forKey: "ArrayNumber") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift index bdf244f5e0a..fd948816d28 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ArrayTest.swift @@ -8,19 +8,39 @@ import Foundation + open class ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init() {} + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" + try container.encodeArrayIfPresent(arrayOfString, forKey: "array_of_string") + try container.encodeArrayIfPresent(arrayArrayOfInteger, forKey: "array_array_of_integer") + try container.encodeArrayIfPresent(arrayArrayOfModel, forKey: "array_array_of_model") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + arrayOfString = try container.decodeArrayIfPresent(String.self, forKey: "array_of_string") + arrayArrayOfInteger = try container.decodeArrayIfPresent([Int64].self, forKey: "array_array_of_integer") + arrayArrayOfModel = try container.decodeArrayIfPresent([ReadOnlyFirst].self, forKey: "array_array_of_model") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift index a39eda9087c..32ea816610e 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Capitalization.swift @@ -8,6 +8,7 @@ import Foundation + open class Capitalization: Codable { public var smallCamel: String? @@ -18,16 +19,41 @@ open class Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init() {} + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case smallCamel = "smallCamel" - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME = "ATT_NAME" + try container.encodeIfPresent(smallCamel, forKey: "smallCamel") + try container.encodeIfPresent(capitalCamel, forKey: "CapitalCamel") + try container.encodeIfPresent(smallSnake, forKey: "small_Snake") + try container.encodeIfPresent(capitalSnake, forKey: "Capital_Snake") + try container.encodeIfPresent(sCAETHFlowPoints, forKey: "SCA_ETH_Flow_Points") + try container.encodeIfPresent(ATT_NAME, forKey: "ATT_NAME") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + smallCamel = try container.decodeIfPresent(String.self, forKey: "smallCamel") + capitalCamel = try container.decodeIfPresent(String.self, forKey: "CapitalCamel") + smallSnake = try container.decodeIfPresent(String.self, forKey: "small_Snake") + capitalSnake = try container.decodeIfPresent(String.self, forKey: "Capital_Snake") + sCAETHFlowPoints = try container.decodeIfPresent(String.self, forKey: "SCA_ETH_Flow_Points") + ATT_NAME = try container.decodeIfPresent(String.self, forKey: "ATT_NAME") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift index fdb090535aa..1354abdf4f0 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Cat.swift @@ -8,15 +8,31 @@ import Foundation + open class Cat: Animal { public var declawed: Bool? - + public init(declawed: Bool?) { + self.declawed = declawed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case declawed = "declawed" + try container.encodeIfPresent(declawed, forKey: "declawed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + declawed = try container.decodeIfPresent(Bool.self, forKey: "declawed") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift index 684443a0649..4d631bf8273 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Category.swift @@ -8,17 +8,35 @@ import Foundation + open class Category: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift index a3d86c6c6f9..8d80e263370 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ClassModel.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing model with \"_class\" property */ + open class ClassModel: Codable { public var _class: String? - public init() {} + public init(_class: String?) { + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _class = "_class" + try container.encodeIfPresent(_class, forKey: "_class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _class = try container.decodeIfPresent(String.self, forKey: "_class") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift index 9d6d71b2367..3a74788606b 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Client.swift @@ -8,15 +8,31 @@ import Foundation + open class Client: Codable { public var client: String? - public init() {} + public init(client: String?) { + self.client = client + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case client = "client" + try container.encodeIfPresent(client, forKey: "client") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + client = try container.decodeIfPresent(String.self, forKey: "client") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift index ffaab37e621..2835af6b0f9 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Dog.swift @@ -8,15 +8,31 @@ import Foundation + open class Dog: Animal { public var breed: String? - + public init(breed: String?) { + self.breed = breed + } + + // Encodable protocol methods + + public override func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case breed = "breed" + try container.encodeIfPresent(breed, forKey: "breed") } + // Decodable protocol methods + + public override required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + breed = try container.decodeIfPresent(String.self, forKey: "breed") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift index 9b2e72b9819..bb7960a7577 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumArrays.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumArrays: Codable { public enum JustSymbol: String, Codable { @@ -21,12 +22,29 @@ open class EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init() {} + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" + try container.encodeIfPresent(justSymbol, forKey: "just_symbol") + try container.encodeArrayIfPresent(arrayEnum, forKey: "array_enum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justSymbol = try container.decodeIfPresent(String.self, forKey: "just_symbol") + arrayEnum = try container.decodeArrayIfPresent(String.self, forKey: "array_enum") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift index 89dad808a5e..023f9a8209c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/EnumTest.swift @@ -8,6 +8,7 @@ import Foundation + open class EnumTest: Codable { public enum EnumString: String, Codable { @@ -17,25 +18,46 @@ open class EnumTest: Codable { } public enum EnumInteger: Int, Codable { case _1 = 1 - case numberminus1 = -1 + case number1 = -1 } public enum EnumNumber: Double, Codable { case _11 = 1.1 - case numberminus12 = -1.2 + case number12 = -1.2 } public var enumString: EnumString? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init() {} + public init(enumString: EnumString?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum = "outerEnum" + try container.encodeIfPresent(enumString, forKey: "enum_string") + try container.encodeIfPresent(enumInteger, forKey: "enum_integer") + try container.encodeIfPresent(enumNumber, forKey: "enum_number") + try container.encodeIfPresent(outerEnum, forKey: "outerEnum") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + enumString = try container.decodeIfPresent(String.self, forKey: "enum_string") + enumInteger = try container.decodeIfPresent(Int.self, forKey: "enum_integer") + enumNumber = try container.decodeIfPresent(Double.self, forKey: "enum_number") + outerEnum = try container.decodeIfPresent(OuterEnum.self, forKey: "outerEnum") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift index d4a1e5f8e52..3423c30d9b9 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/FormatTest.swift @@ -8,39 +8,79 @@ import Foundation + open class FormatTest: Codable { public var integer: Int? public var int32: Int? public var int64: Int64? - public var number: Double? + public var number: Double public var float: Float? public var double: Double? public var string: String? - public var byte: Data? + public var byte: Data public var binary: Data? - public var date: Date? + public var date: Date public var dateTime: Date? public var uuid: UUID? - public var password: String? - - public init() {} - - - private enum CodingKeys: String, CodingKey { - case integer = "integer" - case int32 = "int32" - case int64 = "int64" - case number = "number" - case float = "float" - case double = "double" - case string = "string" - case byte = "byte" - case binary = "binary" - case date = "date" - case dateTime = "dateTime" - case uuid = "uuid" - case password = "password" + public var password: String + + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: Data?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + try container.encodeIfPresent(integer, forKey: "integer") + try container.encodeIfPresent(int32, forKey: "int32") + try container.encodeIfPresent(int64, forKey: "int64") + try container.encode(number, forKey: "number") + try container.encodeIfPresent(float, forKey: "float") + try container.encodeIfPresent(double, forKey: "double") + try container.encodeIfPresent(string, forKey: "string") + try container.encode(byte, forKey: "byte") + try container.encodeIfPresent(binary, forKey: "binary") + try container.encode(date, forKey: "date") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encode(password, forKey: "password") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + integer = try container.decodeIfPresent(Int.self, forKey: "integer") + int32 = try container.decodeIfPresent(Int.self, forKey: "int32") + int64 = try container.decodeIfPresent(Int64.self, forKey: "int64") + number = try container.decode(Double.self, forKey: "number") + float = try container.decodeIfPresent(Float.self, forKey: "float") + double = try container.decodeIfPresent(Double.self, forKey: "double") + string = try container.decodeIfPresent(String.self, forKey: "string") + byte = try container.decode(Data.self, forKey: "byte") + binary = try container.decodeIfPresent(Data.self, forKey: "binary") + date = try container.decode(Date.self, forKey: "date") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + password = try container.decode(String.self, forKey: "password") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift index f3f4f794975..226ffe44b08 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/HasOnlyReadOnly.swift @@ -8,17 +8,35 @@ import Foundation + open class HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init() {} + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case foo = "foo" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(foo, forKey: "foo") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + foo = try container.decodeIfPresent(String.self, forKey: "foo") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift index 4062dc0fef9..5f4068ffbeb 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/List.swift @@ -8,15 +8,31 @@ import Foundation + open class List: Codable { public var _123List: String? - public init() {} + public init(_123List: String?) { + self._123List = _123List + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _123List = "123-list" + try container.encodeIfPresent(_123List, forKey: "123-list") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _123List = try container.decodeIfPresent(String.self, forKey: "123-list") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift index 1ccfa4e4e75..36f31fc1a44 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MapTest.swift @@ -8,6 +8,7 @@ import Foundation + open class MapTest: Codable { public enum MapOfEnumString: String, Codable { @@ -17,12 +18,29 @@ open class MapTest: Codable { public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public init() {} + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" + try container.encodeIfPresent(mapMapOfString, forKey: "map_map_of_string") + try container.encodeIfPresent(mapOfEnumString, forKey: "map_of_enum_string") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + mapMapOfString = try container.decodeIfPresent([String:[String:String]].self, forKey: "map_map_of_string") + mapOfEnumString = try container.decodeIfPresent([String:String].self, forKey: "map_of_enum_string") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 801890006a0..0f475c175d2 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -8,19 +8,39 @@ import Foundation + open class MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? public var map: [String:Animal]? - public init() {} + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case uuid = "uuid" - case dateTime = "dateTime" - case map = "map" + try container.encodeIfPresent(uuid, forKey: "uuid") + try container.encodeIfPresent(dateTime, forKey: "dateTime") + try container.encodeIfPresent(map, forKey: "map") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + uuid = try container.decodeIfPresent(UUID.self, forKey: "uuid") + dateTime = try container.decodeIfPresent(Date.self, forKey: "dateTime") + map = try container.decodeIfPresent([String:Animal].self, forKey: "map") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift index 31e32d33583..6c671b5031d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Model200Response.swift @@ -9,17 +9,35 @@ import Foundation /** Model for testing model name starting with number */ + open class Model200Response: Codable { public var name: Int? public var _class: String? - public init() {} + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case _class = "class" + try container.encodeIfPresent(name, forKey: "name") + try container.encodeIfPresent(_class, forKey: "class") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decodeIfPresent(Int.self, forKey: "name") + _class = try container.decodeIfPresent(String.self, forKey: "class") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift index 3f44a95624f..873b77e3ab2 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Name.swift @@ -9,21 +9,43 @@ import Foundation /** Model for testing model name same as property name */ + open class Name: Codable { - public var name: Int? + public var name: Int public var snakeCase: Int? public var property: String? public var _123Number: Int? - public init() {} + public init(name: Int, snakeCase: Int?, property: String?, _123Number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123Number = _123Number + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case name = "name" - case snakeCase = "snake_case" - case property = "property" - case _123Number = "123Number" + try container.encode(name, forKey: "name") + try container.encodeIfPresent(snakeCase, forKey: "snake_case") + try container.encodeIfPresent(property, forKey: "property") + try container.encodeIfPresent(_123Number, forKey: "123Number") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + name = try container.decode(Int.self, forKey: "name") + snakeCase = try container.decodeIfPresent(Int.self, forKey: "snake_case") + property = try container.decodeIfPresent(String.self, forKey: "property") + _123Number = try container.decodeIfPresent(Int.self, forKey: "123Number") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift index d3663be1e75..89921c2c9c6 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/NumberOnly.swift @@ -8,15 +8,31 @@ import Foundation + open class NumberOnly: Codable { public var justNumber: Double? - public init() {} + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" + try container.encodeIfPresent(justNumber, forKey: "JustNumber") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + justNumber = try container.decodeIfPresent(Double.self, forKey: "JustNumber") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift index e9b1a0a8c2f..fee9d6c9192 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Order.swift @@ -8,6 +8,7 @@ import Foundation + open class Order: Codable { public enum Status: String, Codable { @@ -23,16 +24,41 @@ open class Order: Codable { public var status: Status? public var complete: Bool? - public init() {} + public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case petId = "petId" - case quantity = "quantity" - case shipDate = "shipDate" - case status = "status" - case complete = "complete" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(petId, forKey: "petId") + try container.encodeIfPresent(quantity, forKey: "quantity") + try container.encodeIfPresent(shipDate, forKey: "shipDate") + try container.encodeIfPresent(status, forKey: "status") + try container.encodeIfPresent(complete, forKey: "complete") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + petId = try container.decodeIfPresent(Int64.self, forKey: "petId") + quantity = try container.decodeIfPresent(Int.self, forKey: "quantity") + shipDate = try container.decodeIfPresent(Date.self, forKey: "shipDate") + status = try container.decodeIfPresent(String.self, forKey: "status") + complete = try container.decodeIfPresent(Bool.self, forKey: "complete") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift index 3c49ad29400..ce257737983 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterBoolean = Bool + +open class OuterBoolean: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift index b085a27a470..cf46c19e7f1 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -8,19 +8,39 @@ import Foundation + open class OuterComposite: Codable { public var myNumber: OuterNumber? public var myString: OuterString? public var myBoolean: OuterBoolean? - public init() {} + public init(myNumber: OuterNumber?, myString: OuterString?, myBoolean: OuterBoolean?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" + try container.encodeIfPresent(myNumber, forKey: "my_number") + try container.encodeIfPresent(myString, forKey: "my_string") + try container.encodeIfPresent(myBoolean, forKey: "my_boolean") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + myNumber = try container.decodeIfPresent(OuterNumber.self, forKey: "my_number") + myString = try container.decodeIfPresent(OuterString.self, forKey: "my_string") + myBoolean = try container.decodeIfPresent(OuterBoolean.self, forKey: "my_boolean") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift index f285f4e5e29..3cd67121150 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterNumber = Double + +open class OuterNumber: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift index 9da794627d6..0d9f059b91c 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -8,4 +8,25 @@ import Foundation -public typealias OuterString = String + +open class OuterString: Codable { + + + + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + } +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift index bf982f538ff..0622c110fd4 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Pet.swift @@ -8,6 +8,7 @@ import Foundation + open class Pet: Codable { public enum Status: String, Codable { @@ -17,22 +18,47 @@ open class Pet: Codable { } public var id: Int64? public var category: Category? - public var name: String? - public var photoUrls: [String]? + public var name: String + public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ public var status: Status? - public init() {} + public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case category = "category" - case name = "name" - case photoUrls = "photoUrls" - case tags = "tags" - case status = "status" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(category, forKey: "category") + try container.encode(name, forKey: "name") + try container.encodeArray(photoUrls, forKey: "photoUrls") + try container.encodeArrayIfPresent(tags, forKey: "tags") + try container.encodeIfPresent(status, forKey: "status") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + category = try container.decodeIfPresent(Category.self, forKey: "category") + name = try container.decode(String.self, forKey: "name") + photoUrls = try container.decodeArray(String.self, forKey: "photoUrls") + tags = try container.decodeArrayIfPresent(Tag.self, forKey: "tags") + status = try container.decodeIfPresent(String.self, forKey: "status") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift index 5a09771ea4b..e608e6845b2 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/ReadOnlyFirst.swift @@ -8,17 +8,35 @@ import Foundation + open class ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init() {} + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case bar = "bar" - case baz = "baz" + try container.encodeIfPresent(bar, forKey: "bar") + try container.encodeIfPresent(baz, forKey: "baz") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + bar = try container.decodeIfPresent(String.self, forKey: "bar") + baz = try container.decodeIfPresent(String.self, forKey: "baz") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift index 22b9e0174a1..6429c137f3a 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Return.swift @@ -9,15 +9,31 @@ import Foundation /** Model for testing reserved words */ + open class Return: Codable { public var _return: Int? - public init() {} + public init(_return: Int?) { + self._return = _return + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case _return = "return" + try container.encodeIfPresent(_return, forKey: "return") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + _return = try container.decodeIfPresent(Int.self, forKey: "return") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift index 8c0a8f79dc6..de8c76fa3a9 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/SpecialModelName.swift @@ -8,15 +8,31 @@ import Foundation + open class SpecialModelName: Codable { public var specialPropertyName: Int64? - public init() {} + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" + try container.encodeIfPresent(specialPropertyName, forKey: "$special[property.name]") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + specialPropertyName = try container.decodeIfPresent(Int64.self, forKey: "$special[property.name]") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift index feb6ab7c6cd..ab230b5f899 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/Tag.swift @@ -8,17 +8,35 @@ import Foundation + open class Tag: Codable { public var id: Int64? public var name: String? - public init() {} + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case name = "name" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(name, forKey: "name") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + name = try container.decodeIfPresent(String.self, forKey: "name") + } } + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift index 8fda8afb40e..17e6af33d5d 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/Swaggers/Models/User.swift @@ -8,6 +8,7 @@ import Foundation + open class User: Codable { public var id: Int64? @@ -20,18 +21,47 @@ open class User: Codable { /** User Status */ public var userStatus: Int? - public init() {} + public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) - private enum CodingKeys: String, CodingKey { - case id = "id" - case username = "username" - case firstName = "firstName" - case lastName = "lastName" - case email = "email" - case password = "password" - case phone = "phone" - case userStatus = "userStatus" + try container.encodeIfPresent(id, forKey: "id") + try container.encodeIfPresent(username, forKey: "username") + try container.encodeIfPresent(firstName, forKey: "firstName") + try container.encodeIfPresent(lastName, forKey: "lastName") + try container.encodeIfPresent(email, forKey: "email") + try container.encodeIfPresent(password, forKey: "password") + try container.encodeIfPresent(phone, forKey: "phone") + try container.encodeIfPresent(userStatus, forKey: "userStatus") } + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + id = try container.decodeIfPresent(Int64.self, forKey: "id") + username = try container.decodeIfPresent(String.self, forKey: "username") + firstName = try container.decodeIfPresent(String.self, forKey: "firstName") + lastName = try container.decodeIfPresent(String.self, forKey: "lastName") + email = try container.decodeIfPresent(String.self, forKey: "email") + password = try container.decodeIfPresent(String.self, forKey: "password") + phone = try container.decodeIfPresent(String.self, forKey: "phone") + userStatus = try container.decodeIfPresent(Int.self, forKey: "userStatus") + } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/AlamofireImplementations.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/AlamofireImplementations.swift index b9d2a2727de..0d294aee4ce 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/AlamofireImplementations.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/AlamofireImplementations.swift @@ -142,6 +142,56 @@ open class AlamofireRequestBuilder: RequestBuilder { nil ) }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.Error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.Error(400, dataResponse.data, error)) + } + return + }) case is Void.Type: validatedRequest.responseData(completionHandler: { (voidResponse) in cleanupRequest() @@ -191,6 +241,66 @@ open class AlamofireRequestBuilder: RequestBuilder { } return httpHeaders } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = NSURLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL } public enum AlamofireDecodableRequestBuilderError: Error { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift index 3ad6c11c2fb..b637b2013a5 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/AllPrimitives.swift @@ -44,6 +44,33 @@ open class AllPrimitives: Codable { public var myInlineStringEnum: MyInlineStringEnum? + public init(myInteger: Int?, myIntegerArray: [Int]?, myLong: Int64?, myLongArray: [Int64]?, myFloat: Float?, myFloatArray: [Float]?, myDouble: Double?, myDoubleArray: [Double]?, myString: String?, myStringArray: [String]?, myBytes: Data?, myBytesArray: [Data]?, myBoolean: Bool?, myBooleanArray: [Bool]?, myDate: Date?, myDateArray: [Date]?, myDateTime: Date?, myDateTimeArray: [Date]?, myFile: URL?, myFileArray: [URL]?, myUUID: UUID?, myUUIDArray: [UUID]?, myStringEnum: StringEnum?, myStringEnumArray: [StringEnum]?) { + self.myInteger = myInteger + self.myIntegerArray = myIntegerArray + self.myLong = myLong + self.myLongArray = myLongArray + self.myFloat = myFloat + self.myFloatArray = myFloatArray + self.myDouble = myDouble + self.myDoubleArray = myDoubleArray + self.myString = myString + self.myStringArray = myStringArray + self.myBytes = myBytes + self.myBytesArray = myBytesArray + self.myBoolean = myBoolean + self.myBooleanArray = myBooleanArray + self.myDate = myDate + self.myDateArray = myDateArray + self.myDateTime = myDateTime + self.myDateTimeArray = myDateTimeArray + self.myFile = myFile + self.myFileArray = myFileArray + self.myUUID = myUUID + self.myUUIDArray = myUUIDArray + self.myStringEnum = myStringEnum + self.myStringEnumArray = myStringEnumArray + } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift index c313ada307f..141efe2646f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ErrorInfo.swift @@ -17,6 +17,12 @@ open class ErrorInfo: Codable { public var details: [String]? + public init(code: Int?, message: String?, details: [String]?) { + self.code = code + self.message = message + self.details = details + } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift index 9708ce78e06..846ae99e358 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/GetAllModelsResult.swift @@ -17,6 +17,12 @@ open class GetAllModelsResult: Codable { public var myVariableNameTest: VariableNameTest? + public init(myPrimitiveArray: [AllPrimitives]?, myPrimitive: AllPrimitives?, myVariableNameTest: VariableNameTest?) { + self.myPrimitiveArray = myPrimitiveArray + self.myPrimitive = myPrimitive + self.myVariableNameTest = myVariableNameTest + } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift index 25392820511..5e42dbc1cb4 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -28,6 +28,7 @@ open class ModelWithIntAdditionalPropertiesOnly: Codable { } } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift index 67f73da1bd0..05b4140268f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -36,6 +36,17 @@ open class ModelWithPropertiesAndAdditionalProperties: Codable { } } + public init(myIntegerReq: Int, myIntegerOpt: Int?, myPrimitiveReq: AllPrimitives, myPrimitiveOpt: AllPrimitives?, myStringArrayReq: [String], myStringArrayOpt: [String]?, myPrimitiveArrayReq: [AllPrimitives], myPrimitiveArrayOpt: [AllPrimitives]?) { + self.myIntegerReq = myIntegerReq + self.myIntegerOpt = myIntegerOpt + self.myPrimitiveReq = myPrimitiveReq + self.myPrimitiveOpt = myPrimitiveOpt + self.myStringArrayReq = myStringArrayReq + self.myStringArrayOpt = myStringArrayOpt + self.myPrimitiveArrayReq = myPrimitiveArrayReq + self.myPrimitiveArrayOpt = myPrimitiveArrayOpt + } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift index 47ad742ae32..e38a59df6e4 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -28,6 +28,7 @@ open class ModelWithStringAdditionalPropertiesOnly: Codable { } } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { diff --git a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift index d2ec9840a37..188943c9efa 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/Swaggers/Models/VariableNameTest.swift @@ -18,6 +18,11 @@ open class VariableNameTest: Codable { public var _for: String? + public init(exampleName: String?, _for: String?) { + self.exampleName = exampleName + self._for = _for + } + // Encodable protocol methods public func encode(to encoder: Encoder) throws { From 5ffdee4479a762b4dee45c2a2e8d7c38a03acf52 Mon Sep 17 00:00:00 2001 From: naelrashdeen Date: Thu, 12 Oct 2017 11:40:11 +0200 Subject: [PATCH 145/197] [PHP][Symfony] Generate valid PHP code (#6578) Fixes #5985 We were experiencing syntax issues when generating the Petstore example. See some of the examples below: StoreApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Order; **use maparray<string,int>;** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; UserApiInterface.php public function createUsersWithArrayInput(**User[]** $body); public function createUsersWithListInput(User[] $body); As far as I know, it is not possible to use array of objects in this way. PetApiInterface.php namespace Swagger\Server\Api; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Swagger\Server\Model\Pet; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Swagger\Server\Model\ApiResponse; **use string[];** use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; public function findPetsByStatus(string[] $status); public function findPetsByTags(string[] $tags); --- .../languages/SymfonyServerCodegen.java | 166 +++++++++++++----- .../main/resources/php-symfony/api.mustache | 6 +- .../php-symfony/api_controller.mustache | 6 +- .../main/resources/php-symfony/model.mustache | 3 +- .../php-symfony/model_generic.mustache | 2 +- .../options/SymfonyServerOptionsProvider.java | 1 + 6 files changed, 134 insertions(+), 50 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java index 05d4ba7ddd6..87ce66f16a7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java @@ -19,6 +19,7 @@ public class SymfonyServerCodegen extends AbstractPhpCodegen implements CodegenC public static final String BUNDLE_NAME = "bundleName"; public static final String COMPOSER_VENDOR_NAME = "composerVendorName"; public static final String COMPOSER_PROJECT_NAME = "composerProjectName"; + public static final String PHP_LEGACY_SUPPORT = "phpLegacySupport"; public static final Map SYMFONY_EXCEPTIONS; protected String testsPackage; protected String apiTestsPackage; @@ -32,6 +33,9 @@ public class SymfonyServerCodegen extends AbstractPhpCodegen implements CodegenC protected String bundleAlias; protected String controllerDirName = "Controller"; protected String controllerPackage; + protected Boolean phpLegacySupport = Boolean.TRUE; + + protected HashSet typeHintable; static { SYMFONY_EXCEPTIONS = new HashMap<>(); @@ -74,36 +78,44 @@ public SymfonyServerCodegen() { embeddedTemplateDir = templateDir = "php-symfony"; setReservedWordsLowerCase( - Arrays.asList( - // local variables used in api methods (endpoints) - "resourcePath", "httpBody", "queryParams", "headerParams", - "formParams", "_header_accept", "_tempBody", - - // PHP reserved words - "__halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "unset", "use", "var", "while", "xor") + Arrays.asList( + // local variables used in api methods (endpoints) + "resourcePath", "httpBody", "queryParams", "headerParams", + "formParams", "_header_accept", "_tempBody", + + // PHP reserved words + "__halt_compiler", "abstract", "and", "array", "as", "break", "callable", "case", "catch", "class", "clone", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "empty", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "eval", "exit", "extends", "final", "for", "foreach", "function", "global", "goto", "if", "implements", "include", "include_once", "instanceof", "insteadof", "interface", "isset", "list", "namespace", "new", "or", "print", "private", "protected", "public", "require", "require_once", "return", "static", "switch", "throw", "trait", "try", "unset", "use", "var", "while", "xor" + ) ); // ref: http://php.net/manual/en/language.types.intro.php languageSpecificPrimitives = new HashSet( - Arrays.asList( - "bool", - "boolean", - "int", - "integer", - "double", - "float", - "string", - "object", - "DateTime", - "mixed", - "number", - "void", - "byte") + Arrays.asList( + "bool", + "int", + "double", + "float", + "string", + "object", + "mixed", + "number", + "void", + "byte", + "array" + ) ); - instantiationTypes.put("array", "array"); - instantiationTypes.put("map", "map"); + //instantiationTypes.put("array", "array"); + //instantiationTypes.put("map", "map"); + + defaultIncludes = new HashSet( + Arrays.asList( + "\\DateTime", + "\\SplFileObject" + ) + ); + variableNamingConvention = "camelCase"; // provide primitives to mustache template List sortedLanguageSpecificPrimitives= new ArrayList(languageSpecificPrimitives); @@ -124,7 +136,7 @@ public SymfonyServerCodegen() { typeMapping.put("Date", "\\DateTime"); typeMapping.put("DateTime", "\\DateTime"); typeMapping.put("file", "\\SplFileObject"); - typeMapping.put("map", "map"); + typeMapping.put("map", "array"); typeMapping.put("array", "array"); typeMapping.put("list", "array"); typeMapping.put("object", "object"); @@ -137,6 +149,7 @@ public SymfonyServerCodegen() { cliOptions.add(new CliOption(COMPOSER_PROJECT_NAME, "The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client. IMPORTANT NOTE (2016/03): composerProjectName will be deprecated and replaced by gitRepoId in the next swagger-codegen release")); cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated") .defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(PHP_LEGACY_SUPPORT, "Should the generated code be compatible with PHP 5.x?").defaultValue(Boolean.TRUE.toString())); } public String getBundleName() { @@ -150,6 +163,9 @@ public void setBundleName(String bundleName) { this.bundleAlias = snakeCase(bundleName).replaceAll("([A-Z]+)", "\\_$1").toLowerCase(); } + public void setPhpLegacySupport(Boolean support) { + this.phpLegacySupport = support; + } public String controllerFileFolder() { return (outputFolder + File.separator + toPackagePath(controllerPackage, srcBasePath)); @@ -218,6 +234,12 @@ public void processOpts() { additionalProperties.put(COMPOSER_VENDOR_NAME, composerVendorName); } + if (additionalProperties.containsKey(PHP_LEGACY_SUPPORT)) { + this.setPhpLegacySupport(Boolean.valueOf((String) additionalProperties.get(PHP_LEGACY_SUPPORT))); + } else { + additionalProperties.put(PHP_LEGACY_SUPPORT, phpLegacySupport); + } + additionalProperties.put("escapedInvokerPackage", invokerPackage.replace("\\", "\\\\")); additionalProperties.put("controllerPackage", controllerPackage); additionalProperties.put("apiTestsPackage", apiTestsPackage); @@ -264,26 +286,48 @@ public void processOpts() { supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml")); supportingFiles.add(new SupportingFile(".php_cs", getPackagePath(), ".php_cs")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", getPackagePath(), "git_push.sh")); + + // Type-hintable primitive types + // ref: http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration + if (phpLegacySupport) { + typeHintable = new HashSet( + Arrays.asList( + "array" + ) + ); + } else { + typeHintable = new HashSet( + Arrays.asList( + "array", + "bool", + "float", + "int", + "string" + ) + ); + } } @Override public Map postProcessOperations(Map objs) { objs = super.postProcessOperations(objs); + Map operations = (Map) objs.get("operations"); operations.put("controllerName", toControllerName((String) operations.get("pathPrefix"))); operations.put("symfonyService", toSymfonyService((String) operations.get("pathPrefix"))); HashSet authMethods = new HashSet<>(); - HashSet imports = new HashSet<>(); List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + // Loop through all input parameters to determine, whether we have to import something to + // make the input type available. for (CodegenParameter param : op.allParams) { - final String simpleName = extractSimpleName(param.dataType); - param.vendorExtensions.put("x-simpleName", simpleName); - final boolean isScalarType = typeMapping.containsValue(param.dataType); - param.vendorExtensions.put("x-parameterType", isScalarType ? null : simpleName); - if (!isScalarType) { - imports.add(param.dataType); + // Determine if the paramter type is supported as a type hint and make it available + // to the templating engine + String typeHint = getTypeHint(param.dataType); + if (!typeHint.isEmpty()) { + param.vendorExtensions.put("x-parameterType", typeHint); } } @@ -296,11 +340,9 @@ public Map postProcessOperations(Map objs) { if (response.dataType != null) { final String dataType = extractSimpleName(response.dataType); response.vendorExtensions.put("x-simpleName", dataType); - imports.add(response.dataType.replaceFirst("\\[\\]$", "")); - } - - if (exception != null) { - imports.add(exception); + // if (!typeMapping.containsValue(dataType)) { + // imports.add(response.dataType.replaceFirst("\\[\\]$", "")); + // } } } @@ -310,7 +352,6 @@ public Map postProcessOperations(Map objs) { } } - operations.put("imports", new ArrayList<>(imports)); operations.put("authMethods", authMethods); return objs; @@ -397,13 +438,13 @@ public String getTypeDeclaration(Property p) { if (p instanceof MapProperty) { MapProperty mp = (MapProperty) p; Property inner = mp.getAdditionalProperties(); - return getSwaggerType(p) + "array"; + return getTypeDeclaration(inner) + "[]"; } - + if (p instanceof RefProperty) { return getTypeDeclaration(getPropertyTypeDeclaration(p)); } - + return getPropertyTypeDeclaration(p); } @@ -429,6 +470,21 @@ public String getTypeDeclaration(String name) { return super.getTypeDeclaration(name); } + /** + * Return the fully-qualified "Model" name for import + * + * @param name the name of the "Model" + * @return the fully-qualified "Model" name for import + */ + @Override + public String toModelImport(String name) { + if ("".equals(modelPackage())) { + return name; + } else { + return modelPackage() + "\\" + name; + } + } + public String toApiName(String name) { if (name.isEmpty()) { return "DefaultApiInterface"; @@ -451,4 +507,34 @@ protected String toSymfonyService(String name) { return prefix + name; } + + protected String getTypeHint(String type) { + // Type hint array types + if (type.endsWith("[]")) { + return "array"; + } + + // Check if the type is a native type that is type hintable in PHP + if (typeHintable.contains(type)) { + return type; + } + + // Default includes are referenced by their fully-qualified class name (including namespace) + if (defaultIncludes.contains(type)) { + return type; + } + + // Model classes are assumed to be imported and we reference them by their class name + if (isModelClass(type)) { + // This parameter is an instance of a model + return extractSimpleName(type); + } + + // PHP does not support type hinting for this parameter data type + return ""; + } + + protected Boolean isModelClass(String type) { + return Boolean.valueOf(type.contains(modelPackage())); + } } diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache index 0caef2cfc6d..b3985a9489a 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache @@ -18,7 +18,7 @@ namespace {{apiPackage}}; -{{#operations}}{{#imports}}use {{this}}; +{{#operations}}{{#imports}}use {{import}}; {{/imports}} /** @@ -56,7 +56,7 @@ interface {{classname}} * {{/description}} {{#allParams}} - * @param {{vendorExtensions.x-simpleName}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * {{#responses}} @@ -64,7 +64,7 @@ interface {{classname}} * @throws {{vendorExtensions.x-symfonyExceptionSimple}} {{message}} {{/vendorExtensions.x-symfonyExceptionSimple}} {{^vendorExtensions.x-symfonyExceptionSimple}} - * @return {{^dataType}}void{{/dataType}}{{#dataType}}{{vendorExtensions.x-simpleName}}{{/dataType}} {{message}} + * @return {{^dataType}}void{{/dataType}}{{#dataType}}{{dataType}}{{/dataType}} {{message}} * {{/vendorExtensions.x-symfonyExceptionSimple}} {{/responses}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache index c78a507203e..8fb9efb5ed7 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache @@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; use {{apiPackage}}\{{classname}}; -{{#imports}}use {{this}}; +{{#imports}}use {{import}}; {{/imports}} /** @@ -179,11 +179,9 @@ class {{controllerName}} extends Controller return new Response('', 204); {{/returnType}} {{#responses}} - {{#vendorExtensions.x-symfonyExceptionSimple}} - } catch ({{vendorExtensions.x-symfonyExceptionSimple}} $exception) { + } catch (HttpException $exception) { // {{message}} return $this->createErrorResponse($exception); - {{/vendorExtensions.x-symfonyExceptionSimple}} {{/responses}} } catch (Exception $fallthrough) { return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache index 52b0934530d..6e865578075 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache @@ -20,9 +20,8 @@ */ namespace {{modelPackage}}; -{{^isEnum}} -use \ArrayAccess; +{{^isEnum}} {{#useStatements}}use {{this}}; {{/useStatements}} {{/isEnum}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache index 165a96adc06..8e72f968406 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache @@ -1,4 +1,4 @@ -class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}implements ModelInterface, ArrayAccess +class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}implements ModelInterface, \ArrayAccess { const DISCRIMINATOR = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SymfonyServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SymfonyServerOptionsProvider.java index 4e975100f5e..ddb7d6ef387 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SymfonyServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SymfonyServerOptionsProvider.java @@ -49,6 +49,7 @@ public Map createOptions() { .put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE) .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .put(SymfonyServerCodegen.PHP_LEGACY_SUPPORT, "true") .build(); } From 278bcfe96b83ad98065c444c775580aaf8dd3242 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 12 Oct 2017 18:27:56 +0800 Subject: [PATCH 146/197] add Edubits to swift tech comm --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 54a5eabd83a..cd51336054b 100644 --- a/README.md +++ b/README.md @@ -1077,7 +1077,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) @jimschubert (2017/09) | -| Swift | @jgavris (2017/07) @ehyche (2017/08) | +| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | From e9f49abfee90b94ce40a868c12a2a0b803b8f203 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 12 Oct 2017 19:31:36 +0800 Subject: [PATCH 147/197] add back petstore test (#6663) --- .../src/IO.Swagger.Test/Api/PetApiTests.cs | 266 ++++++++++++++---- 1 file changed, 204 insertions(+), 62 deletions(-) diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs index a512676b08c..37f6cb91a35 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -1,25 +1,3 @@ -/* - * 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: 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. - */ - using System; using System.IO; using System.Collections.Generic; @@ -47,6 +25,45 @@ public class PetApiTests { private PetApi instance; + private long petId = 11088; + + /// + /// Create a Pet object + /// + private Pet createPet() + { + // create pet + Pet p = new Pet(Name: "Csharp test", PhotoUrls: new List { "http://petstore.com/csharp_test" }); + p.Id = petId; + //p.Name = "Csharp test"; + p.Status = Pet.StatusEnum.Available; + // create Category object + Category category = new Category(); + category.Id = 56; + category.Name = "sample category name2"; + List photoUrls = new List(new String[] {"sample photoUrls"}); + // create Tag object + Tag tag = new Tag(); + tag.Id = petId; + tag.Name = "csharp sample tag name1"; + List tags = new List(new Tag[] {tag}); + p.Tags = tags; + p.Category = category; + p.PhotoUrls = photoUrls; + + return p; + } + + /// + /// Convert string to byte array + /// + private byte[] GetBytes(string str) + { + byte[] bytes = new byte[str.Length * sizeof(char)]; + System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); + return bytes; + } + /// /// Setup before each unit test /// @@ -54,6 +71,13 @@ public class PetApiTests public void Init() { instance = new PetApi(); + + // create pet + Pet p = createPet(); + + // add pet before testing + PetApi petApi = new PetApi("http://petstore.swagger.io/v2/"); + petApi.AddPet (p); } /// @@ -62,7 +86,9 @@ public void Init() [TearDown] public void Cleanup() { - + // remove the pet after testing + PetApi petApi = new PetApi (); + petApi.DeletePet(petId, "test key"); } /// @@ -71,8 +97,7 @@ public void Cleanup() [Test] public void InstanceTest() { - // TODO uncomment below to test 'IsInstanceOfType' PetApi - //Assert.IsInstanceOfType(typeof(PetApi), instance, "instance is a PetApi"); + Assert.IsInstanceOf(instance); } @@ -82,10 +107,9 @@ public void InstanceTest() [Test] public void AddPetTest() { - // TODO uncomment below to test the method and replace null with proper value - //Pet body = null; - //instance.AddPet(body); - + // create pet + Pet p = createPet(); + instance.AddPet(p); } /// @@ -94,11 +118,7 @@ public void AddPetTest() [Test] public void DeletePetTest() { - // TODO uncomment below to test the method and replace null with proper value - //long? petId = null; - //string apiKey = null; - //instance.DeletePet(petId, apiKey); - + // no need to test as it'c covered by Cleanup() already } /// @@ -107,10 +127,15 @@ public void DeletePetTest() [Test] public void FindPetsByStatusTest() { - // TODO uncomment below to test the method and replace null with proper value - //List status = null; - //var response = instance.FindPetsByStatus(status); - //Assert.IsInstanceOf> (response, "response is List"); + PetApi petApi = new PetApi (); + List tagsList = new List(new String[] {"available"}); + + List listPet = petApi.FindPetsByTags (tagsList); + foreach (Pet pet in listPet) // Loop through List with foreach. + { + Assert.IsInstanceOf(pet); + Assert.AreEqual ("csharp sample tag name1", pet.Tags[0]); + } } /// @@ -119,10 +144,9 @@ public void FindPetsByStatusTest() [Test] public void FindPetsByTagsTest() { - // TODO uncomment below to test the method and replace null with proper value - //List tags = null; - //var response = instance.FindPetsByTags(tags); - //Assert.IsInstanceOf> (response, "response is List"); + List tags = new List(new String[] {"pet"}); + var response = instance.FindPetsByTags(tags); + Assert.IsInstanceOf>(response); } /// @@ -131,22 +155,96 @@ public void FindPetsByTagsTest() [Test] public void GetPetByIdTest() { - // TODO uncomment below to test the method and replace null with proper value - //long? petId = null; - //var response = instance.GetPetById(petId); - //Assert.IsInstanceOf (response, "response is Pet"); + // set timeout to 10 seconds + Configuration c1 = new Configuration(); + c1.Timeout = 10000; + c1.UserAgent = "TEST_USER_AGENT"; + + PetApi petApi = new PetApi (c1); + Pet response = petApi.GetPetById (petId); + Assert.IsInstanceOf(response); + + Assert.AreEqual ("Csharp test", response.Name); + Assert.AreEqual (Pet.StatusEnum.Available, response.Status); + + Assert.IsInstanceOf>(response.Tags); + Assert.AreEqual (petId, response.Tags [0].Id); + Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name); + + Assert.IsInstanceOf>(response.PhotoUrls); + Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]); + + Assert.IsInstanceOf(response.Category); + Assert.AreEqual (56, response.Category.Id); + Assert.AreEqual ("sample category name2", response.Category.Name); } + + /// + /// Test GetPetByIdAsync + /// + [Test ()] + public void TestGetPetByIdAsync () + { + PetApi petApi = new PetApi (); + var task = petApi.GetPetByIdAsync (petId); + Pet response = task.Result; + Assert.IsInstanceOf(response); + + Assert.AreEqual ("Csharp test", response.Name); + Assert.AreEqual (Pet.StatusEnum.Available, response.Status); + + Assert.IsInstanceOf>(response.Tags); + Assert.AreEqual (petId, response.Tags [0].Id); + Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name); + + Assert.IsInstanceOf>(response.PhotoUrls); + Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]); + + Assert.IsInstanceOf(response.Category); + Assert.AreEqual (56, response.Category.Id); + Assert.AreEqual ("sample category name2", response.Category.Name); + } + /// + /// Test GetPetByIdAsyncWithHttpInfo + /// + [Test ()] + public void TestGetPetByIdAsyncWithHttpInfo () + { + PetApi petApi = new PetApi (); + var task = petApi.GetPetByIdAsyncWithHttpInfo (petId); + + Assert.AreEqual (200, task.Result.StatusCode); + Assert.IsTrue (task.Result.Headers.ContainsKey("Content-Type")); + Assert.AreEqual (task.Result.Headers["Content-Type"], "application/json"); + + Pet response = task.Result.Data; + Assert.IsInstanceOf(response); + + Assert.AreEqual ("Csharp test", response.Name); + Assert.AreEqual (Pet.StatusEnum.Available, response.Status); + + Assert.IsInstanceOf>(response.Tags); + Assert.AreEqual (petId, response.Tags [0].Id); + Assert.AreEqual ("csharp sample tag name1", response.Tags [0].Name); + + Assert.IsInstanceOf>(response.PhotoUrls); + Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]); + + Assert.IsInstanceOf(response.Category); + Assert.AreEqual (56, response.Category.Id); + Assert.AreEqual ("sample category name2", response.Category.Name); + } + /// /// Test UpdatePet /// [Test] public void UpdatePetTest() { - // TODO uncomment below to test the method and replace null with proper value - //Pet body = null; - //instance.UpdatePet(body); - + // create pet + Pet p = createPet(); + instance.UpdatePet(p); } /// @@ -155,12 +253,24 @@ public void UpdatePetTest() [Test] public void UpdatePetWithFormTest() { - // TODO uncomment below to test the method and replace null with proper value - //long? petId = null; - //string name = null; - //string status = null; - //instance.UpdatePetWithForm(petId, name, status); - + PetApi petApi = new PetApi(); + petApi.UpdatePetWithForm (petId, "new form name", "pending"); + + Pet response = petApi.GetPetById (petId); + Assert.IsInstanceOf(response); + Assert.IsInstanceOf(response.Category); + Assert.IsInstanceOf>(response.Tags); + + Assert.AreEqual ("new form name", response.Name); + Assert.AreEqual (Pet.StatusEnum.Pending, response.Status); + + Assert.AreEqual (petId, response.Tags [0].Id); + Assert.AreEqual (56, response.Category.Id); + + // test optional parameter + petApi.UpdatePetWithForm (petId, "new form name2"); + Pet response2 = petApi.GetPetById (petId); + Assert.AreEqual ("new form name2", response2.Name); } /// @@ -169,13 +279,45 @@ public void UpdatePetWithFormTest() [Test] public void UploadFileTest() { - // TODO uncomment below to test the method and replace null with proper value - //long? petId = null; - //string additionalMetadata = null; - //System.IO.Stream file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); - //Assert.IsInstanceOf (response, "response is ApiResponse"); + Assembly _assembly = Assembly.GetExecutingAssembly(); + Stream _imageStream = _assembly.GetManifestResourceStream("IO.Swagger.Test.swagger-logo.png"); + PetApi petApi = new PetApi (); + // test file upload with form parameters + petApi.UploadFile(petId, "new form name", _imageStream); + + // test file upload without any form parameters + // using optional parameter syntax introduced at .net 4.0 + petApi.UploadFile(petId: petId, file: _imageStream); + } + + /// + /// Test status code + /// + [Test ()] + public void TestStatusCodeAndHeader () + { + PetApi petApi = new PetApi (); + var response = petApi.GetPetByIdWithHttpInfo (petId); + Assert.AreEqual (response.StatusCode, 200); + Assert.IsTrue (response.Headers.ContainsKey("Content-Type")); + Assert.AreEqual (response.Headers["Content-Type"], "application/json"); + } + + /// + /// Test default header (should be deprecated + /// + [Test ()] + public void TestDefaultHeader () + { + PetApi petApi = new PetApi (); + // commented out the warning test below as it's confirmed the warning is working as expected + // there should be a warning for using AddDefaultHeader (deprecated) below + //petApi.AddDefaultHeader ("header_key", "header_value"); + // the following should be used instead as suggested in the doc + petApi.Configuration.AddDefaultHeader ("header_key2", "header_value2"); + + } } From b22fb30891a8c6a576ead24358dbcd77af2f75c8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 13 Oct 2017 00:35:04 +0800 Subject: [PATCH 148/197] add jaz-ah to swift, android tech committee --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd51336054b..11d88e418cc 100644 --- a/README.md +++ b/README.md @@ -1053,6 +1053,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | Languages | Member (join date) | |:-------------|:-------------| | ActionScript | | +| Android | @jaz-ah (2017/09) | | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | @@ -1077,7 +1078,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) @jimschubert (2017/09) | -| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) | +| 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 eb453791b61742a9430562c01ab7b810b6710d30 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 13 Oct 2017 05:02:20 -0400 Subject: [PATCH 149/197] golang: trailing whitespace fails gofmt (#6669) Signed-off-by: Vincent Batts --- .../src/main/resources/go/partial_header.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache index b655ebb8269..83edccca9b2 100644 --- a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache @@ -1,4 +1,4 @@ -/* +/* {{#appName}} * {{{appName}}} * From 96444d374f1f29d634cec8a005af74b07798a6ef Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 13 Oct 2017 18:27:13 +0800 Subject: [PATCH 150/197] update go petstore samples --- .../petstore/go/go-petstore/additional_properties_class.go | 2 +- samples/client/petstore/go/go-petstore/animal.go | 2 +- samples/client/petstore/go/go-petstore/animal_farm.go | 2 +- samples/client/petstore/go/go-petstore/another_fake_api.go | 2 +- samples/client/petstore/go/go-petstore/api_client.go | 2 +- samples/client/petstore/go/go-petstore/api_response.go | 2 +- .../petstore/go/go-petstore/array_of_array_of_number_only.go | 2 +- samples/client/petstore/go/go-petstore/array_of_number_only.go | 2 +- samples/client/petstore/go/go-petstore/array_test.go | 2 +- samples/client/petstore/go/go-petstore/capitalization.go | 2 +- samples/client/petstore/go/go-petstore/cat.go | 2 +- samples/client/petstore/go/go-petstore/category.go | 2 +- samples/client/petstore/go/go-petstore/class_model.go | 2 +- samples/client/petstore/go/go-petstore/client.go | 2 +- samples/client/petstore/go/go-petstore/configuration.go | 2 +- samples/client/petstore/go/go-petstore/dog.go | 2 +- samples/client/petstore/go/go-petstore/enum_arrays.go | 2 +- samples/client/petstore/go/go-petstore/enum_class.go | 2 +- samples/client/petstore/go/go-petstore/enum_test.go | 2 +- samples/client/petstore/go/go-petstore/fake_api.go | 2 +- .../petstore/go/go-petstore/fake_classname_tags123_api.go | 2 +- samples/client/petstore/go/go-petstore/format_test.go | 2 +- samples/client/petstore/go/go-petstore/has_only_read_only.go | 2 +- samples/client/petstore/go/go-petstore/list.go | 2 +- samples/client/petstore/go/go-petstore/map_test.go | 2 +- .../mixed_properties_and_additional_properties_class.go | 2 +- samples/client/petstore/go/go-petstore/model_200_response.go | 2 +- samples/client/petstore/go/go-petstore/model_api_response.go | 2 +- samples/client/petstore/go/go-petstore/model_return.go | 2 +- samples/client/petstore/go/go-petstore/name.go | 2 +- samples/client/petstore/go/go-petstore/number_only.go | 2 +- samples/client/petstore/go/go-petstore/order.go | 2 +- samples/client/petstore/go/go-petstore/outer_boolean.go | 2 +- samples/client/petstore/go/go-petstore/outer_composite.go | 2 +- samples/client/petstore/go/go-petstore/outer_enum.go | 2 +- samples/client/petstore/go/go-petstore/outer_number.go | 2 +- samples/client/petstore/go/go-petstore/outer_string.go | 2 +- samples/client/petstore/go/go-petstore/pet.go | 2 +- samples/client/petstore/go/go-petstore/pet_api.go | 2 +- samples/client/petstore/go/go-petstore/read_only_first.go | 2 +- samples/client/petstore/go/go-petstore/special_model_name.go | 2 +- samples/client/petstore/go/go-petstore/store_api.go | 2 +- samples/client/petstore/go/go-petstore/tag.go | 2 +- samples/client/petstore/go/go-petstore/user.go | 2 +- samples/client/petstore/go/go-petstore/user_api.go | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) 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 aabf50e5aad..638857fb25f 100644 --- a/samples/client/petstore/go/go-petstore/additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/additional_properties_class.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/animal.go b/samples/client/petstore/go/go-petstore/animal.go index 0b14ac8d2c0..40b5778704b 100644 --- a/samples/client/petstore/go/go-petstore/animal.go +++ b/samples/client/petstore/go/go-petstore/animal.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/animal_farm.go b/samples/client/petstore/go/go-petstore/animal_farm.go index 32db51c8e02..6b872ea1c42 100644 --- a/samples/client/petstore/go/go-petstore/animal_farm.go +++ b/samples/client/petstore/go/go-petstore/animal_farm.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/another_fake_api.go b/samples/client/petstore/go/go-petstore/another_fake_api.go index 7953340a72e..5eb37c217fc 100644 --- a/samples/client/petstore/go/go-petstore/another_fake_api.go +++ b/samples/client/petstore/go/go-petstore/another_fake_api.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index 3827a42128d..798424db7e6 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index 27064d2af68..03c6528380b 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/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 1daab9061bd..c268522aa9c 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 @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/array_of_number_only.go b/samples/client/petstore/go/go-petstore/array_of_number_only.go index 5d444bea765..f04e5a2be6f 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 @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/array_test.go b/samples/client/petstore/go/go-petstore/array_test.go index e91915d5c76..bbb667e88b0 100644 --- a/samples/client/petstore/go/go-petstore/array_test.go +++ b/samples/client/petstore/go/go-petstore/array_test.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/capitalization.go b/samples/client/petstore/go/go-petstore/capitalization.go index 0c4631e3282..7e3f1910179 100644 --- a/samples/client/petstore/go/go-petstore/capitalization.go +++ b/samples/client/petstore/go/go-petstore/capitalization.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/cat.go b/samples/client/petstore/go/go-petstore/cat.go index 72f3a77fd18..a9192b03c7c 100644 --- a/samples/client/petstore/go/go-petstore/cat.go +++ b/samples/client/petstore/go/go-petstore/cat.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index d602586af7d..5dace4961ff 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/class_model.go b/samples/client/petstore/go/go-petstore/class_model.go index efcd6540b20..2a01b0265ab 100644 --- a/samples/client/petstore/go/go-petstore/class_model.go +++ b/samples/client/petstore/go/go-petstore/class_model.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 6ee95a777e6..e9331f3cd42 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 96275d11ccd..cd828fc90ca 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/dog.go b/samples/client/petstore/go/go-petstore/dog.go index a2d91c6e6a1..700c407d484 100644 --- a/samples/client/petstore/go/go-petstore/dog.go +++ b/samples/client/petstore/go/go-petstore/dog.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/enum_arrays.go b/samples/client/petstore/go/go-petstore/enum_arrays.go index f649887925d..7dcf60043d3 100644 --- a/samples/client/petstore/go/go-petstore/enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/enum_arrays.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/enum_class.go b/samples/client/petstore/go/go-petstore/enum_class.go index 2e520cb005b..f96897cbd0a 100644 --- a/samples/client/petstore/go/go-petstore/enum_class.go +++ b/samples/client/petstore/go/go-petstore/enum_class.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/enum_test.go b/samples/client/petstore/go/go-petstore/enum_test.go index c138ae5c3bd..bd547952198 100644 --- a/samples/client/petstore/go/go-petstore/enum_test.go +++ b/samples/client/petstore/go/go-petstore/enum_test.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index e99b9f3d6ff..8dbceb67737 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go b/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go index 82a24af48b9..e159a49d4ac 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 @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/format_test.go b/samples/client/petstore/go/go-petstore/format_test.go index cd9c6b51322..9ced730ad6d 100644 --- a/samples/client/petstore/go/go-petstore/format_test.go +++ b/samples/client/petstore/go/go-petstore/format_test.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/has_only_read_only.go b/samples/client/petstore/go/go-petstore/has_only_read_only.go index 47b33d16ecd..4ac6a1237a9 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 @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/list.go b/samples/client/petstore/go/go-petstore/list.go index 81f3f61f86c..c52e011d665 100644 --- a/samples/client/petstore/go/go-petstore/list.go +++ b/samples/client/petstore/go/go-petstore/list.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/map_test.go b/samples/client/petstore/go/go-petstore/map_test.go index e1f0614bd26..ede75865a72 100644 --- a/samples/client/petstore/go/go-petstore/map_test.go +++ b/samples/client/petstore/go/go-petstore/map_test.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/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 9dfb723be42..ca571af65be 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 @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index be347495a12..a596e8bd73b 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 0135c4bd4a8..603e2c92750 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index b4687b33060..b6c387f4bce 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/name.go b/samples/client/petstore/go/go-petstore/name.go index cd427f8a861..0aa3a8c4b04 100644 --- a/samples/client/petstore/go/go-petstore/name.go +++ b/samples/client/petstore/go/go-petstore/name.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/number_only.go b/samples/client/petstore/go/go-petstore/number_only.go index 9a8e88f1e20..23a4c82d235 100644 --- a/samples/client/petstore/go/go-petstore/number_only.go +++ b/samples/client/petstore/go/go-petstore/number_only.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index b2714eb3ece..55c9cfd7898 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/outer_boolean.go b/samples/client/petstore/go/go-petstore/outer_boolean.go index bdd8378715a..07b1230bfd9 100644 --- a/samples/client/petstore/go/go-petstore/outer_boolean.go +++ b/samples/client/petstore/go/go-petstore/outer_boolean.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/outer_composite.go index 9e4ae6a131c..db0ccece4b5 100644 --- a/samples/client/petstore/go/go-petstore/outer_composite.go +++ b/samples/client/petstore/go/go-petstore/outer_composite.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/outer_enum.go b/samples/client/petstore/go/go-petstore/outer_enum.go index 4b24f8fab26..569b3ecaafa 100644 --- a/samples/client/petstore/go/go-petstore/outer_enum.go +++ b/samples/client/petstore/go/go-petstore/outer_enum.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/outer_number.go b/samples/client/petstore/go/go-petstore/outer_number.go index c83626abd2a..c5d68320690 100644 --- a/samples/client/petstore/go/go-petstore/outer_number.go +++ b/samples/client/petstore/go/go-petstore/outer_number.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/outer_string.go b/samples/client/petstore/go/go-petstore/outer_string.go index f1f4cf9fbe0..eeab75cd96c 100644 --- a/samples/client/petstore/go/go-petstore/outer_string.go +++ b/samples/client/petstore/go/go-petstore/outer_string.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index b1ff5ffc869..cf12df89663 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index 7e7145969bf..ae565a8f511 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/read_only_first.go b/samples/client/petstore/go/go-petstore/read_only_first.go index e6b34918742..ef235fe459f 100644 --- a/samples/client/petstore/go/go-petstore/read_only_first.go +++ b/samples/client/petstore/go/go-petstore/read_only_first.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/special_model_name.go b/samples/client/petstore/go/go-petstore/special_model_name.go index 7d106fb05e1..b14a0d7f234 100644 --- a/samples/client/petstore/go/go-petstore/special_model_name.go +++ b/samples/client/petstore/go/go-petstore/special_model_name.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 30d428968e3..eaf6ea785cd 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/tag.go index 13bd1bec5cf..2597fbd379b 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 01203380fb8..739a5f5bf40 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index d317fa7cf04..a2e37d35dbf 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -1,4 +1,4 @@ -/* +/* * Swagger Petstore * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ From 027fb2fe4787b3cc1798b22f575a75fb2cd87479 Mon Sep 17 00:00:00 2001 From: stkrwork Date: Sun, 15 Oct 2017 17:38:46 +0200 Subject: [PATCH 151/197] - Removed unnecessary line in in Restbed Codegen Constructor (#6675) - Updated samples --- .../main/java/io/swagger/codegen/languages/RestbedCodegen.java | 2 -- samples/server/petstore/restbed/.swagger-codegen/VERSION | 2 +- samples/server/petstore/restbed/api/PetApi.cpp | 2 +- samples/server/petstore/restbed/api/PetApi.h | 2 +- samples/server/petstore/restbed/api/StoreApi.cpp | 2 +- samples/server/petstore/restbed/api/StoreApi.h | 2 +- samples/server/petstore/restbed/api/UserApi.cpp | 2 +- samples/server/petstore/restbed/api/UserApi.h | 2 +- samples/server/petstore/restbed/model/ApiResponse.cpp | 2 +- samples/server/petstore/restbed/model/ApiResponse.h | 2 +- samples/server/petstore/restbed/model/Category.cpp | 2 +- samples/server/petstore/restbed/model/Category.h | 2 +- samples/server/petstore/restbed/model/Order.cpp | 2 +- samples/server/petstore/restbed/model/Order.h | 2 +- samples/server/petstore/restbed/model/Pet.cpp | 2 +- samples/server/petstore/restbed/model/Pet.h | 2 +- samples/server/petstore/restbed/model/Tag.cpp | 2 +- samples/server/petstore/restbed/model/Tag.h | 2 +- samples/server/petstore/restbed/model/User.cpp | 2 +- samples/server/petstore/restbed/model/User.h | 2 +- 20 files changed, 19 insertions(+), 21 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java index 070f4de3ca1..63c1ab387a4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java @@ -99,8 +99,6 @@ public RestbedCodegen() { addOption(DEFAULT_INCLUDE, "The default include statement that should be placed in all headers for including things like the declspec (convention: #include \"Commons.h\" ", this.defaultInclude); - - reservedWords = new HashSet(); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); diff --git a/samples/server/petstore/restbed/.swagger-codegen/VERSION b/samples/server/petstore/restbed/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/restbed/.swagger-codegen/VERSION +++ b/samples/server/petstore/restbed/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/restbed/api/PetApi.cpp b/samples/server/petstore/restbed/api/PetApi.cpp index 3dc61c1d66b..a681ad1431b 100644 --- a/samples/server/petstore/restbed/api/PetApi.cpp +++ b/samples/server/petstore/restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/api/PetApi.h b/samples/server/petstore/restbed/api/PetApi.h index c818ca6d2a4..b178f31fac0 100644 --- a/samples/server/petstore/restbed/api/PetApi.h +++ b/samples/server/petstore/restbed/api/PetApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/api/StoreApi.cpp b/samples/server/petstore/restbed/api/StoreApi.cpp index 4e44f96bb1a..c3a8545061d 100644 --- a/samples/server/petstore/restbed/api/StoreApi.cpp +++ b/samples/server/petstore/restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/api/StoreApi.h b/samples/server/petstore/restbed/api/StoreApi.h index 4fbed3ffb3a..5c7142cfc4f 100644 --- a/samples/server/petstore/restbed/api/StoreApi.h +++ b/samples/server/petstore/restbed/api/StoreApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/api/UserApi.cpp b/samples/server/petstore/restbed/api/UserApi.cpp index 558519746a6..19ebcd66c1d 100644 --- a/samples/server/petstore/restbed/api/UserApi.cpp +++ b/samples/server/petstore/restbed/api/UserApi.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/api/UserApi.h b/samples/server/petstore/restbed/api/UserApi.h index 95ab6c5a7a0..4e0205f971d 100644 --- a/samples/server/petstore/restbed/api/UserApi.h +++ b/samples/server/petstore/restbed/api/UserApi.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/ApiResponse.cpp b/samples/server/petstore/restbed/model/ApiResponse.cpp index 63b89a4b932..8335db91c2b 100644 --- a/samples/server/petstore/restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/ApiResponse.h b/samples/server/petstore/restbed/model/ApiResponse.h index 122621cfb31..40b1d93a8ce 100644 --- a/samples/server/petstore/restbed/model/ApiResponse.h +++ b/samples/server/petstore/restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Category.cpp b/samples/server/petstore/restbed/model/Category.cpp index ff89a04951a..0f3a41858ab 100644 --- a/samples/server/petstore/restbed/model/Category.cpp +++ b/samples/server/petstore/restbed/model/Category.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Category.h b/samples/server/petstore/restbed/model/Category.h index b72d5980184..83fed4a0275 100644 --- a/samples/server/petstore/restbed/model/Category.h +++ b/samples/server/petstore/restbed/model/Category.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Order.cpp b/samples/server/petstore/restbed/model/Order.cpp index 47944f96852..cf34ceb4d1e 100644 --- a/samples/server/petstore/restbed/model/Order.cpp +++ b/samples/server/petstore/restbed/model/Order.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Order.h b/samples/server/petstore/restbed/model/Order.h index e7de9e60b55..88d9d77eee4 100644 --- a/samples/server/petstore/restbed/model/Order.h +++ b/samples/server/petstore/restbed/model/Order.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Pet.cpp b/samples/server/petstore/restbed/model/Pet.cpp index 76d84be4244..e1512ddb698 100644 --- a/samples/server/petstore/restbed/model/Pet.cpp +++ b/samples/server/petstore/restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Pet.h b/samples/server/petstore/restbed/model/Pet.h index 6e55fa78749..c45b9a2bda7 100644 --- a/samples/server/petstore/restbed/model/Pet.h +++ b/samples/server/petstore/restbed/model/Pet.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Tag.cpp b/samples/server/petstore/restbed/model/Tag.cpp index 18c712ddd55..5504323641d 100644 --- a/samples/server/petstore/restbed/model/Tag.cpp +++ b/samples/server/petstore/restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/Tag.h b/samples/server/petstore/restbed/model/Tag.h index 34900de06a1..1fd64907e38 100644 --- a/samples/server/petstore/restbed/model/Tag.h +++ b/samples/server/petstore/restbed/model/Tag.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/User.cpp b/samples/server/petstore/restbed/model/User.cpp index bf14eea0a8d..e34781c782b 100644 --- a/samples/server/petstore/restbed/model/User.cpp +++ b/samples/server/petstore/restbed/model/User.cpp @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ diff --git a/samples/server/petstore/restbed/model/User.h b/samples/server/petstore/restbed/model/User.h index 33764f060bb..5a79bba992b 100644 --- a/samples/server/petstore/restbed/model/User.h +++ b/samples/server/petstore/restbed/model/User.h @@ -5,7 +5,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * - * NOTE: This class is auto generated by the swagger code generator 2.2.3-SNAPSHOT. + * NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ From 1f97caf960e19b847588d2ef2c0ed2010c6c25c5 Mon Sep 17 00:00:00 2001 From: Gustavo Paz <32820138+gustavoapaz@users.noreply.github.com> Date: Sun, 15 Oct 2017 21:17:40 -0500 Subject: [PATCH 152/197] Included Open Systems International in the list of companies using Swagger Codegen (#6692) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 11d88e418cc..9961dd9a4ac 100644 --- a/README.md +++ b/README.md @@ -799,6 +799,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) +- [Open International Systems](https://openintl.com/) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) From 3f7f6b85994a05db153b6f6b64cdb06e2dc2795f Mon Sep 17 00:00:00 2001 From: Elias Ovchynnikov Date: Mon, 16 Oct 2017 04:18:32 +0200 Subject: [PATCH 153/197] Add operationId as nickname to @ApiOperation (#6688) * Add operationId as nickname to @ApiOperation * Refresh samples after adding nicknames to @ApiOperation --- .../src/main/resources/JavaSpring/api.mustache | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- .../main/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/main/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/main/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/main/java/io/swagger/api/UserApi.java | 16 ++++++++-------- 55 files changed, 281 insertions(+), 281 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index c38d0cebf3d..9cf1a6fd167 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -43,7 +43,7 @@ import javax.validation.Valid; public interface {{classname}} { {{#operation}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 549021488e3..7460e4146d0 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -28,7 +28,7 @@ @Api(value = "Pet", description = "the Pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -43,7 +43,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -58,7 +58,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -74,7 +74,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand>> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -90,7 +90,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand>> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -104,7 +104,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId); - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -121,7 +121,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -136,7 +136,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 2b3eb977d81..f2249f2f415 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 @@ @Api(value = "Store", description = "the Store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -38,7 +38,7 @@ public interface StoreApi { com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -50,7 +50,7 @@ public interface StoreApi { com.netflix.hystrix.HystrixCommand>> getInventory(); - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -62,7 +62,7 @@ public interface StoreApi { 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); - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index ed82a2c6e23..52c0d7065f2 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -27,7 +27,7 @@ @Api(value = "User", description = "the User API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -47,7 +47,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -57,7 +57,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -68,7 +68,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username); - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -80,7 +80,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username); - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -91,7 +91,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -101,7 +101,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> logoutUser(); - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 83a393f755d..fd689d1e630 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -59,7 +59,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -75,7 +75,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -91,7 +91,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -105,7 +105,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -122,7 +122,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -137,7 +137,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 b112bce163e..4d012286be4 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -39,7 +39,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -51,7 +51,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -63,7 +63,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index cccc8970235..76d92efe050 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -38,7 +38,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -48,7 +48,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -58,7 +58,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -69,7 +69,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -81,7 +81,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -92,7 +92,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -102,7 +102,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java index be61b2ad26e..8ad023f68d0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -29,7 +29,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 01160e34534..a4e2b7ed871 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -33,7 +33,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -44,7 +44,7 @@ default CompletableFuture> fakeOuterBooleanSerialize(@Ap } - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -55,7 +55,7 @@ default CompletableFuture> fakeOuterCompositeSeri } - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -66,7 +66,7 @@ default CompletableFuture> fakeOuterNumberSerialize(@ } - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -77,7 +77,7 @@ default CompletableFuture> fakeOuterStringSerialize(@ApiP } - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -90,7 +90,7 @@ default CompletableFuture> testClientModel(@ApiParam(valu } - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -106,7 +106,7 @@ default CompletableFuture> testEndpointParameters(@ApiParam } - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -120,7 +120,7 @@ default CompletableFuture> testEnumParameters(@ApiParam(val } - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java index ff0695ba17b..bee88691e39 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -29,7 +29,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index c848b4e10db..bc81d88402f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -31,7 +31,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -49,7 +49,7 @@ default CompletableFuture> addPet(@ApiParam(value = "Pet ob } - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -66,7 +66,7 @@ default CompletableFuture> deletePet(@ApiParam(value = "Pet } - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -84,7 +84,7 @@ default CompletableFuture>> findPetsByStatus( @NotNull@ } - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -102,7 +102,7 @@ default CompletableFuture>> findPetsByTags( @NotNull@Ap } - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -118,7 +118,7 @@ default CompletableFuture> getPetById(@ApiParam(value = "ID } - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -138,7 +138,7 @@ default CompletableFuture> updatePet(@ApiParam(value = "Pet } - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -156,7 +156,7 @@ default CompletableFuture> updatePetWithForm(@ApiParam(valu } - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 6c0a3bb22a0..258f7f9c9ed 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 @@ -30,7 +30,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -43,7 +43,7 @@ default CompletableFuture> deleteOrder(@ApiParam(value = "I } - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -57,7 +57,7 @@ default CompletableFuture>> getInventory( @R } - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -71,7 +71,7 @@ default CompletableFuture> getOrderById( @Min(1) @Max(5)@A } - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index e04c43267b1..1faeadc5e41 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -30,7 +30,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -42,7 +42,7 @@ default CompletableFuture> createUser(@ApiParam(value = "Cr } - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -54,7 +54,7 @@ default CompletableFuture> createUsersWithArrayInput(@ApiPa } - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -66,7 +66,7 @@ default CompletableFuture> createUsersWithListInput(@ApiPar } - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -79,7 +79,7 @@ default CompletableFuture> deleteUser(@ApiParam(value = "Th } - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -93,7 +93,7 @@ default CompletableFuture> getUserByName(@ApiParam(value = } - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -106,7 +106,7 @@ default CompletableFuture> loginUser( @NotNull@ApiParam(v } - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -118,7 +118,7 @@ default CompletableFuture> logoutUser( @RequestHeader(value } - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java index 3b14b5b65c4..a3fcfabaf12 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -27,7 +27,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index 496b425270f..bb3d2a07bc8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -31,7 +31,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -39,7 +39,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -47,7 +47,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -55,7 +55,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -63,7 +63,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java index d96868f2aaa..00fffe8a123 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -27,7 +27,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index d54623656c0..9d3d35fa3d4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -58,7 +58,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -73,7 +73,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -88,7 +88,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -133,7 +133,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 ee501717cd8..29eb4c3f78e 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -38,7 +38,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -49,7 +49,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -60,7 +60,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index 1782db76772..4ebcd42aa79 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -65,7 +65,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -76,7 +76,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java index 3b14b5b65c4..a3fcfabaf12 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -27,7 +27,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java index 496b425270f..bb3d2a07bc8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java @@ -31,7 +31,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -39,7 +39,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -47,7 +47,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -55,7 +55,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -63,7 +63,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java index d96868f2aaa..00fffe8a123 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -27,7 +27,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java index d54623656c0..9d3d35fa3d4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -58,7 +58,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -73,7 +73,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -88,7 +88,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -133,7 +133,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 ee501717cd8..29eb4c3f78e 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -38,7 +38,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -49,7 +49,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -60,7 +60,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java index 1782db76772..4ebcd42aa79 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -65,7 +65,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -76,7 +76,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java index 53bfedb21b8..a54382d9a2f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -28,7 +28,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index ca936803ec7..6c25bd2db9c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -32,7 +32,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -43,7 +43,7 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp } - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -54,7 +54,7 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val } - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -65,7 +65,7 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I } - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -76,7 +76,7 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input } - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -89,7 +89,7 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" } - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -105,7 +105,7 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re } - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -119,7 +119,7 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Form paramete } - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeClassnameTestApi.java index 79dabad65f3..9473d86b65e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -28,7 +28,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index 0818727b582..e7da9813412 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -30,7 +30,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -48,7 +48,7 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to } - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -65,7 +65,7 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ } - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -83,7 +83,7 @@ default ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "S } - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -101,7 +101,7 @@ default ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tag } - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -117,7 +117,7 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r } - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -137,7 +137,7 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs } - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -155,7 +155,7 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that } - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 e57ff9e6d87..0eb316bb35b 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 @@ -29,7 +29,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -42,7 +42,7 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that } - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -56,7 +56,7 @@ default ResponseEntity> getInventory( @RequestHeader(value } - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -70,7 +70,7 @@ default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID } - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index c94fc397799..a5bb65fbf78 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -41,7 +41,7 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" } - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -53,7 +53,7 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o } - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -65,7 +65,7 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of } - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -78,7 +78,7 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t } - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -92,7 +92,7 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need } - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -105,7 +105,7 @@ default ResponseEntity loginUser( @NotNull@ApiParam(value = "The user na } - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -117,7 +117,7 @@ default ResponseEntity logoutUser( @RequestHeader(value = "Accept", requir } - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java index 3b14b5b65c4..a3fcfabaf12 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -27,7 +27,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index 496b425270f..bb3d2a07bc8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -31,7 +31,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -39,7 +39,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -47,7 +47,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -55,7 +55,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -63,7 +63,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java index d96868f2aaa..00fffe8a123 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -27,7 +27,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index d54623656c0..9d3d35fa3d4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -58,7 +58,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -73,7 +73,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -88,7 +88,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -133,7 +133,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 ee501717cd8..29eb4c3f78e 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -38,7 +38,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -49,7 +49,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -60,7 +60,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index 1782db76772..4ebcd42aa79 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -65,7 +65,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -76,7 +76,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java index d062a2914d4..f4111f3fbd2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -27,7 +27,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java index 6b7e54c4ad1..49e84ac7d28 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -31,7 +31,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @ApiImplicitParams({ @@ -42,7 +42,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @ApiImplicitParams({ @@ -53,7 +53,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @ApiImplicitParams({ @@ -64,7 +64,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @ApiImplicitParams({ @@ -75,7 +75,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @ApiImplicitParams({ @@ -88,7 +88,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -104,7 +104,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -118,7 +118,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java index ba4bd4c535a..8780b066c18 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -27,7 +27,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java index b15e3ed6c92..4507ea983d3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -47,7 +47,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -64,7 +64,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -82,7 +82,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -100,7 +100,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -116,7 +116,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -136,7 +136,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -154,7 +154,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 9d3e0ac3f3c..f77da88f58f 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -41,7 +41,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -55,7 +55,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -69,7 +69,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java index 51c5fdd39b2..c54491d6812 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -40,7 +40,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -52,7 +52,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -64,7 +64,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -77,7 +77,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -91,7 +91,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -104,7 +104,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -116,7 +116,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java index e629a1e2d31..62ca3f0eaa2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -28,7 +28,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java index dfe62a451f8..afd79d11cce 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java @@ -32,7 +32,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -40,7 +40,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -48,7 +48,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -56,7 +56,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -64,7 +64,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -74,7 +74,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -87,7 +87,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -98,7 +98,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) Optional> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) Optional enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") Optional enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java index 80bdc77c19d..18477c21ccf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -28,7 +28,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java index 306a732f8de..77f019f4571 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java @@ -30,7 +30,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -45,7 +45,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -59,7 +59,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) Optional apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -74,7 +74,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -89,7 +89,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -102,7 +102,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -119,7 +119,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -134,7 +134,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 790fafa3f3e..ef179173939 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 @@ -29,7 +29,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -39,7 +39,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -50,7 +50,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -61,7 +61,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java index 06cafd6d421..4692409e01a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -38,7 +38,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -47,7 +47,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -56,7 +56,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -66,7 +66,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -77,7 +77,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -87,7 +87,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -96,7 +96,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java index 3b14b5b65c4..a3fcfabaf12 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -27,7 +27,7 @@ @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { - @ApiOperation(value = "To test special tags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) + @ApiOperation(value = "To test special tags", nickname = "testSpecialTags", notes = "To test special tags", response = Client.class, tags={ "$another-fake?", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/another-fake/dummy", diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index 496b425270f..bb3d2a07bc8 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -31,7 +31,7 @@ @Api(value = "fake", description = "the fake API") public interface FakeApi { - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) @RequestMapping(value = "/fake/outer/boolean", @@ -39,7 +39,7 @@ public interface FakeApi { ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) @RequestMapping(value = "/fake/outer/composite", @@ -47,7 +47,7 @@ public interface FakeApi { ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) @RequestMapping(value = "/fake/outer/number", @@ -55,7 +55,7 @@ public interface FakeApi { ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) + @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) @RequestMapping(value = "/fake/outer/string", @@ -63,7 +63,7 @@ public interface FakeApi { ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) + @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) @RequestMapping(value = "/fake", @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java index d96868f2aaa..00fffe8a123 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -27,7 +27,7 @@ @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { - @ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, authorizations = { + @ApiOperation(value = "To test class name in snake case", nickname = "testClassname", notes = "", response = Client.class, authorizations = { @Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) @ApiResponses(value = { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index d54623656c0..9d3d35fa3d4 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -58,7 +58,7 @@ public interface PetApi { ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -73,7 +73,7 @@ public interface PetApi { ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -88,7 +88,7 @@ public interface PetApi { ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -133,7 +133,7 @@ public interface PetApi { ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 ee501717cd8..29eb4c3f78e 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") public interface StoreApi { - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) + @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", response = Void.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -38,7 +38,7 @@ public interface StoreApi { ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("order_id") String orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @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 = { @@ -49,7 +49,7 @@ public interface StoreApi { ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @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 = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @@ -60,7 +60,7 @@ public interface StoreApi { ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("order_id") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 1782db76772..4ebcd42aa79 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -65,7 +65,7 @@ public interface UserApi { ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @@ -76,7 +76,7 @@ public interface UserApi { ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) From 3067da2877b627af87ffec8201c58426ae598843 Mon Sep 17 00:00:00 2001 From: Javier Velilla Date: Mon, 16 Oct 2017 00:02:19 -0300 Subject: [PATCH 154/197] Swagger eiffel:fix (#6674) * Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel Void Safety Rules, optional parameters are translated to detachable TYPE. Validation Rules are mapped to preconditions, at the moment maximun and minimun validation has been added. Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32]. Improved model template to generate the model output. * Updated API_CLIENT.parameter_to_string feature, missing STRING representation. * Updating sample using the latest modifications. --- .../main/resources/Eiffel/api_client.mustache | 4 + samples/client/petstore/eiffel/README.md | 50 +---------- samples/client/petstore/eiffel/api_client.ecf | 2 +- .../client/petstore/eiffel/docs/PET_API.md | 2 +- .../client/petstore/eiffel/docs/STORE_API.md | 8 +- .../client/petstore/eiffel/docs/USER_API.md | 2 +- .../client/petstore/eiffel/src/api/pet_api.e | 24 +++++- .../petstore/eiffel/src/api/store_api.e | 20 +++-- .../client/petstore/eiffel/src/api/user_api.e | 18 +++- .../client/petstore/eiffel/src/api_client.e | 82 ++++++++++++++++--- .../petstore/eiffel/src/domain/api_response.e | 11 +-- .../petstore/eiffel/src/domain/category.e | 9 +- .../client/petstore/eiffel/src/domain/order.e | 17 ++-- .../client/petstore/eiffel/src/domain/pet.e | 17 ++-- .../client/petstore/eiffel/src/domain/tag.e | 9 +- .../client/petstore/eiffel/src/domain/user.e | 21 ++--- .../eiffel/src/framework/api_client_request.e | 2 +- .../src/framework/api_client_response.e | 2 +- .../petstore/eiffel/src/framework/api_error.e | 2 +- .../petstore/eiffel/src/framework/api_i.e | 2 +- .../eiffel/src/framework/auth/api_key_auth.e | 2 +- .../src/framework/auth/authentication.e | 2 +- .../src/framework/auth/http_basic_auth.e | 2 +- .../eiffel/src/framework/auth/oauth.e | 2 +- .../eiffel/src/framework/configuration.e | 2 +- .../serialization/api_deserializer.e | 2 +- .../serialization/api_json_deserializer.e | 2 +- .../serialization/api_json_serializer.e | 2 +- .../framework/serialization/api_serializer.e | 2 +- .../client/petstore/eiffel/test/api_test.ecf | 2 +- 30 files changed, 198 insertions(+), 126 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache b/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache index 9958265883a..9f7ae9ccc10 100644 --- a/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/Eiffel/api_client.mustache @@ -232,6 +232,10 @@ feature -- Query Parameter Helpers -- TODO improve to support -- dateTime string date-time As defined by date-time - RFC3339 Result := date_time.date.debug_output + elseif attached {STRING_32} a_param as str_32 then + Result := str_32 + elseif attached {STRING_8} a_param as str_8 then + Result := str_8 else -- Unsupported Object type. Result := "" diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index c399baba8f6..0152d6bcd0e 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -1,6 +1,6 @@ # Eiffel API client for swagger -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +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. ## Overview This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. @@ -17,19 +17,10 @@ Add the library into your Eiffel configuration file. ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | -*FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | -*FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | -*FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | -*FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters -*FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data -*FAKE_CLASSNAME_TAGS123_API* | [**test_classname**](docs/FAKE_CLASSNAME_TAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case *PET_API* | [**add_pet**](docs/PET_API.md#add_pet) | **Post** /pet | Add a new pet to the store *PET_API* | [**delete_pet**](docs/PET_API.md#delete_pet) | **Delete** /pet/{petId} | Deletes a pet *PET_API* | [**find_pets_by_status**](docs/PET_API.md#find_pets_by_status) | **Get** /pet/findByStatus | Finds Pets by status @@ -38,9 +29,9 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image -*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID +*STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID +*STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID *STORE_API* | [**place_order**](docs/STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet *USER_API* | [**create_user**](docs/USER_API.md#create_user) | **Post** /user | Create user *USER_API* | [**create_users_with_array_input**](docs/USER_API.md#create_users_with_array_input) | **Post** /user/createWithArray | Creates list of users with given input array @@ -54,41 +45,12 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) - - [ANIMAL](docs/ANIMAL.md) - - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) - - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) - - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) - - [ARRAY_TEST](docs/ARRAY_TEST.md) - - [CAPITALIZATION](docs/CAPITALIZATION.md) - [CATEGORY](docs/CATEGORY.md) - - [CLASS_MODEL](docs/CLASS_MODEL.md) - - [CLIENT](docs/CLIENT.md) - - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) - - [ENUM_CLASS](docs/ENUM_CLASS.md) - - [ENUM_TEST](docs/ENUM_TEST.md) - - [FORMAT_TEST](docs/FORMAT_TEST.md) - - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) - - [MAP_TEST](docs/MAP_TEST.md) - - [MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS](docs/MIXED_PROPERTIES_AND_ADDITIONAL_PROPERTIES_CLASS.md) - - [MODEL_200_RESPONSE](docs/MODEL_200_RESPONSE.md) - - [NAME](docs/NAME.md) - - [NUMBER_ONLY](docs/NUMBER_ONLY.md) - [ORDER](docs/ORDER.md) - - [OUTER_BOOLEAN](docs/OUTER_BOOLEAN.md) - - [OUTER_COMPOSITE](docs/OUTER_COMPOSITE.md) - - [OUTER_ENUM](docs/OUTER_ENUM.md) - - [OUTER_NUMBER](docs/OUTER_NUMBER.md) - - [OUTER_STRING](docs/OUTER_STRING.md) - [PET](docs/PET.md) - - [READ_ONLY_FIRST](docs/READ_ONLY_FIRST.md) - - [RETURN](docs/RETURN.md) - - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) - [USER](docs/USER.md) - - [CAT](docs/CAT.md) - - [DOG](docs/DOG.md) ## Documentation For Authorization @@ -100,10 +62,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -## http_basic_test - -- **Type**: HTTP basic authentication - ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index dde6c493504..be81e54bd6e 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index c445581a329..cf5ce8fc53c 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -1,6 +1,6 @@ # PET_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index 69480c8072d..5b93ae40e4b 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -1,12 +1,12 @@ # STORE_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID +[**delete_order**](STORE_API.md#delete_order) | **Delete** /store/order/{orderId} | Delete purchase order by ID [**inventory**](STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status -[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID +[**order_by_id**](STORE_API.md#order_by_id) | **Get** /store/order/{orderId} | Find purchase order by ID [**place_order**](STORE_API.md#place_order) | **Post** /store/order | Place an order for a pet @@ -54,7 +54,7 @@ This endpoint does not need any parameter. ### Return type -[**STRING_TABLE[INTEGER_32]**](STRING_TABLE.md) +**STRING_TABLE[INTEGER_32]** ### Authorization diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 2d325a6b2fd..ee8e26c6ad0 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -1,6 +1,6 @@ # USER_API -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 00072bb6f32..d8a1648cc84 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -31,6 +31,7 @@ feature -- API Access -- argument: body Pet object that needs to be added to the store (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -41,6 +42,7 @@ feature -- API Access l_request.set_body(body) l_path := "/pet" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -52,7 +54,7 @@ feature -- API Access end end - delete_pet (pet_id: INTEGER_64; api_key: detachable STRING_32) + delete_pet (pet_id: INTEGER_64; api_key: STRING_32) -- Deletes a pet -- -- @@ -61,6 +63,7 @@ feature -- API Access -- argument: api_key (optional) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -71,6 +74,7 @@ feature -- API Access l_path := "/pet/{petId}" l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + if attached api_key as l_api_key then l_request.add_header(l_api_key.out,"api_key"); end @@ -94,6 +98,7 @@ feature -- API Access -- -- -- Result LIST [PET] + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -105,6 +110,7 @@ feature -- API Access l_path := "/pet/findByStatus" l_request.fill_query_params(api_client.parameter_to_tuple("csv", "status", status)); + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -128,6 +134,7 @@ feature -- API Access -- -- -- Result LIST [PET] + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -139,6 +146,7 @@ feature -- API Access l_path := "/pet/findByTags" l_request.fill_query_params(api_client.parameter_to_tuple("csv", "tags", tags)); + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -162,6 +170,7 @@ feature -- API Access -- -- -- Result PET + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -173,6 +182,7 @@ feature -- API Access l_path := "/pet/{petId}" l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -195,6 +205,7 @@ feature -- API Access -- argument: body Pet object that needs to be added to the store (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -205,6 +216,7 @@ feature -- API Access l_request.set_body(body) l_path := "/pet" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -216,7 +228,7 @@ feature -- API Access end end - update_pet_with_form (pet_id: INTEGER_64; name: detachable STRING_32; status: detachable STRING_32) + update_pet_with_form (pet_id: INTEGER_64; name: STRING_32; status: STRING_32) -- Updates a pet in the store with form data -- -- @@ -227,6 +239,7 @@ feature -- API Access -- argument: status Updated status of the pet (optional) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -237,6 +250,7 @@ feature -- API Access l_path := "/pet/{petId}" l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + if attached name as l_name then l_request.add_form(l_name,"name"); end @@ -255,7 +269,7 @@ feature -- API Access end end - upload_file (pet_id: INTEGER_64; additional_metadata: detachable STRING_32; file: detachable FILE): detachable API_RESPONSE + upload_file (pet_id: INTEGER_64; additional_metadata: STRING_32; file: detachable FILE): detachable API_RESPONSE -- uploads an image -- -- @@ -267,6 +281,7 @@ feature -- API Access -- -- -- Result API_RESPONSE + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -277,6 +292,7 @@ feature -- API Access l_path := "/pet/{petId}/uploadImage" l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + if attached additional_metadata as l_additional_metadata then l_request.add_form(l_additional_metadata,"additionalMetadata"); end diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index 5ecd833fabe..6cc61998d66 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -31,6 +31,7 @@ feature -- API Access -- argument: order_id ID of the order that needs to be deleted (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -39,8 +40,9 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{order_id}" - l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{orderId}" + l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); @@ -59,6 +61,7 @@ feature -- API Access -- -- -- Result STRING_TABLE[INTEGER_32] + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -69,6 +72,7 @@ feature -- API Access l_path := "/store/inventory" + if attached {STRING} api_client.select_header_accept (<<"application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -92,6 +96,9 @@ feature -- API Access -- -- -- Result ORDER + require + order_id_is_less_or_equal_than: order_id <= 5 + order_id_is_greater_or_equal_than: order_id >= 1 local l_path: STRING l_request: API_CLIENT_REQUEST @@ -100,8 +107,9 @@ feature -- API Access reset_error create l_request - l_path := "/store/order/{order_id}" - l_path.replace_substring_all ("{"+"order_id"+"}", api_client.url_encode (order_id.out)) + l_path := "/store/order/{orderId}" + l_path.replace_substring_all ("{"+"orderId"+"}", api_client.url_encode (order_id.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); @@ -126,6 +134,7 @@ feature -- API Access -- -- -- Result ORDER + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -136,6 +145,7 @@ feature -- API Access l_request.set_body(body) l_path := "/store/order" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 1acf95ecf8c..6c6ef3c686e 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -31,6 +31,7 @@ feature -- API Access -- argument: body Created user object (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -41,6 +42,7 @@ feature -- API Access l_request.set_body(body) l_path := "/user" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -59,6 +61,7 @@ feature -- API Access -- argument: body List of user object (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -69,6 +72,7 @@ feature -- API Access l_request.set_body(body) l_path := "/user/createWithArray" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -87,6 +91,7 @@ feature -- API Access -- argument: body List of user object (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -97,6 +102,7 @@ feature -- API Access l_request.set_body(body) l_path := "/user/createWithList" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -115,6 +121,7 @@ feature -- API Access -- argument: username The name that needs to be deleted (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -126,6 +133,7 @@ feature -- API Access l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -147,6 +155,7 @@ feature -- API Access -- -- -- Result STRING_32 + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -159,6 +168,7 @@ feature -- API Access l_request.fill_query_params(api_client.parameter_to_tuple("", "username", username)); l_request.fill_query_params(api_client.parameter_to_tuple("", "password", password)); + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -179,6 +189,7 @@ feature -- API Access -- -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -189,6 +200,7 @@ feature -- API Access l_path := "/user/logout" + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -209,6 +221,7 @@ feature -- API Access -- argument: body Updated user object (required) -- -- + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -220,6 +233,7 @@ feature -- API Access l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end @@ -239,6 +253,7 @@ feature -- API Access -- -- -- Result USER + require local l_path: STRING l_request: API_CLIENT_REQUEST @@ -250,6 +265,7 @@ feature -- API Access l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) + if attached {STRING} api_client.select_header_accept (<<"application/xml", "application/json">>) as l_accept then l_request.add_header(l_accept,"Accept"); end diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index e3645183fd2..aa91d1734a9 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -31,16 +31,14 @@ feature {NONE} -- Initialization create authentications.make (3) authentications.force (create {API_KEY_AUTH}.make ("header", "api_key"), "api_key") - is_api_key_configured := True - authentications.force (create {HTTP_BASIC_AUTH}, "http_basic_test") - is_basic_auth_configured := True + is_api_key_configured := True authentications.force (create {OAUTH},"petstore_auth") is_oauth_configured := True end feature -- Access - default_base_path: STRING = "http://petstore.swagger.io:80/v2" + default_base_path: STRING = "http://petstore.swagger.io/v2" -- default base path. base_path: STRING @@ -136,7 +134,7 @@ feature -- Helper: OAuth Authentication feature -- Query Parameter Helpers - parameter_to_tuple (a_collection_format, a_name: STRING; a_value: ANY): LIST [TUPLE [name: STRING; value: STRING]] + parameter_to_tuple (a_collection_format, a_name: STRING; a_value: detachable ANY): LIST [TUPLE [name: STRING; value: STRING]] -- A list of tuples with name and valule. -- collectionFormat collection format (e.g. csv, tsv) -- name Name @@ -148,7 +146,7 @@ feature -- Query Parameter Helpers l_delimiter: STRING l_value: STRING do - if attached {LIST [STRING_32]} a_value as a_list then + if attached {LIST [ANY]} a_value as a_list then -- Collection if a_list.is_empty then -- Return an empty list @@ -163,7 +161,7 @@ feature -- Query Parameter Helpers end if l_format.is_case_insensitive_equal ("multi") then across a_list as ic loop - Result.force ([a_name, ic.item.as_string_8]) + Result.force ([a_name, parameter_to_string (ic.item)]) end else if l_format.is_case_insensitive_equal ("csv") then @@ -179,7 +177,7 @@ feature -- Query Parameter Helpers end across a_list as ic from create l_value.make_empty loop - l_value.append (ic.item) + l_value.append (parameter_to_string (ic.item)) l_value.append (l_delimiter) end l_value.remove_tail (1) @@ -188,7 +186,71 @@ feature -- Query Parameter Helpers end else create {ARRAYED_LIST [TUPLE [name: STRING; value: STRING]]} Result.make (1) - Result.force ([a_name,a_value.out]) + if attached a_value then + Result.force ([a_name,a_value.out]) + else + Result.force ([a_name,""]) + end + + end + end + + + parameter_to_string (a_param: detachable ANY): STRING + -- return the string representation of the givien object `a_param'. + do + if a_param = Void then + Result := "" + else + if attached {BOOLEAN} a_param as bool then + Result := bool.out + elseif attached {NUMERIC} a_param as num then + if attached {INTEGER_64} num as i64 then + Result := i64.out + elseif attached {INTEGER_32} num as i32 then + Result := i32.out + elseif attached {INTEGER_16} num as i16 then + Result := i16.out + elseif attached {INTEGER_8} num as i8 then + Result := i8.out + elseif attached {NATURAL_64} num as n64 then + Result := n64.out + elseif attached {NATURAL_32} num as n32 then + Result := n32.out + elseif attached {NATURAL_16} num as n16 then + Result := n16.out + elseif attached {NATURAL_8} num as n8 then + Result := n8.out + elseif attached {REAL_64} num as r64 then + Result := r64.out + elseif attached {REAL_32} num as r32 then + Result := r32.out + else + check is_basic_numeric_type: False end + end + Result := num.out + elseif attached {CHARACTER_8} a_param as ch8 then + Result := ch8.out + elseif attached {CHARACTER_32} a_param as ch32 then + Result := ch32.out + elseif attached {POINTER} a_param as ptr then + Result := ptr.to_integer_32.out + elseif attached {DATE} a_param as date then + --TODO improve to support + -- date string As defined by full-date - RFC3339 + Result := date.debug_output + elseif attached {DATE_TIME} a_param as date_time then + -- TODO improve to support + -- dateTime string date-time As defined by date-time - RFC3339 + Result := date_time.date.debug_output + elseif attached {STRING_32} a_param as str_32 then + Result := str_32 + elseif attached {STRING_8} a_param as str_8 then + Result := str_8 + else + -- Unsupported Object type. + Result := "" + end end end diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index 1bbddce63e3..bf1c07248f3 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class API_RESPONSE inherit @@ -67,19 +66,21 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass API_RESPONSE%N") if attached code as l_code then - Result.append ("%N") + Result.append ("%Ncode:") Result.append (l_code.out) Result.append ("%N") end if attached type as l_type then - Result.append ("%N") + Result.append ("%Ntype:") Result.append (l_type.out) Result.append ("%N") end if attached message as l_message then - Result.append ("%N") + Result.append ("%Nmessage:") Result.append (l_message.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index d40a3dd1b99..eb8baca2916 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class CATEGORY inherit @@ -57,14 +56,16 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass CATEGORY%N") if attached id as l_id then - Result.append ("%N") + Result.append ("%Nid:") Result.append (l_id.out) Result.append ("%N") end if attached name as l_name then - Result.append ("%N") + Result.append ("%Nname:") Result.append (l_name.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index c216c6d6fcc..caa97313be0 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class ORDER inherit @@ -97,34 +96,36 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass ORDER%N") if attached id as l_id then - Result.append ("%N") + Result.append ("%Nid:") Result.append (l_id.out) Result.append ("%N") end if attached pet_id as l_pet_id then - Result.append ("%N") + Result.append ("%Npet_id:") Result.append (l_pet_id.out) Result.append ("%N") end if attached quantity as l_quantity then - Result.append ("%N") + Result.append ("%Nquantity:") Result.append (l_quantity.out) Result.append ("%N") end if attached ship_date as l_ship_date then - Result.append ("%N") + Result.append ("%Nship_date:") Result.append (l_ship_date.out) Result.append ("%N") end if attached status as l_status then - Result.append ("%N") + Result.append ("%Nstatus:") Result.append (l_status.out) Result.append ("%N") end if attached complete as l_complete then - Result.append ("%N") + Result.append ("%Ncomplete:") Result.append (l_complete.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 4b0eca19003..6f4d93c5dfb 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class PET inherit @@ -97,38 +96,40 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass PET%N") if attached id as l_id then - Result.append ("%N") + Result.append ("%Nid:") Result.append (l_id.out) Result.append ("%N") end if attached category as l_category then - Result.append ("%N") + Result.append ("%Ncategory:") Result.append (l_category.out) Result.append ("%N") end if attached name as l_name then - Result.append ("%N") + Result.append ("%Nname:") Result.append (l_name.out) Result.append ("%N") end if attached photo_urls as l_photo_urls then across l_photo_urls as ic loop - Result.append ("%N") + Result.append ("%N photo_urls:") Result.append (ic.item.out) Result.append ("%N") end end if attached tags as l_tags then across l_tags as ic loop - Result.append ("%N") + Result.append ("%N tags:") Result.append (ic.item.out) Result.append ("%N") end end if attached status as l_status then - Result.append ("%N") + Result.append ("%Nstatus:") Result.append (l_status.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index 63149ebd5cf..4b579c27416 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class TAG inherit @@ -57,14 +56,16 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass TAG%N") if attached id as l_id then - Result.append ("%N") + Result.append ("%Nid:") Result.append (l_id.out) Result.append ("%N") end if attached name as l_name then - Result.append ("%N") + Result.append ("%Nname:") Result.append (l_name.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 5b8cf7473cf..794e8f9363d 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 @@ -12,7 +12,6 @@ note date: "$Date$" revision: "$Revision$" EIS:"Eiffel swagger codegen", "src=https://github.com/swagger-api/swagger-codegen.git", "protocol=uri" - class USER inherit @@ -117,44 +116,46 @@ feature -- Change Element create Result.make_empty Result.append("%Nclass USER%N") if attached id as l_id then - Result.append ("%N") + Result.append ("%Nid:") Result.append (l_id.out) Result.append ("%N") end if attached username as l_username then - Result.append ("%N") + Result.append ("%Nusername:") Result.append (l_username.out) Result.append ("%N") end if attached first_name as l_first_name then - Result.append ("%N") + Result.append ("%Nfirst_name:") Result.append (l_first_name.out) Result.append ("%N") end if attached last_name as l_last_name then - Result.append ("%N") + Result.append ("%Nlast_name:") Result.append (l_last_name.out) Result.append ("%N") end if attached email as l_email then - Result.append ("%N") + Result.append ("%Nemail:") Result.append (l_email.out) Result.append ("%N") end if attached password as l_password then - Result.append ("%N") + Result.append ("%Npassword:") Result.append (l_password.out) Result.append ("%N") end if attached phone as l_phone then - Result.append ("%N") + Result.append ("%Nphone:") Result.append (l_phone.out) Result.append ("%N") end if attached user_status as l_user_status then - Result.append ("%N") + Result.append ("%Nuser_status:") Result.append (l_user_status.out) Result.append ("%N") end end end + + diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index 62a882ea13a..51fd6841cfe 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index 1d5c0230f4b..9787f9672ca 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index 28ad33fa77d..e4cfc25666f 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index da1688fcc16..37bc6f47b63 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index 9cd03d4208b..4299d42e180 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index d4f70460eb6..12c3f77c265 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 24aa58826ff..e1528199e3d 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index bdcad7515c4..e432801c5fc 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 806373bda4f..5f0d7ee52c3 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 8484d1ac6f6..53f54dd1f9e 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index 060324421fc..56442620c79 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index bc124a8d79f..8dab668cb92 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index 35a4b32321f..e870c3da48d 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -1,7 +1,7 @@ note description:"[ 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: \" \\ + 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 diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index 81f8eb4f32f..7a6f8fc387b 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + From 8bcceb4a1036baa84434fa1284835e5adf769510 Mon Sep 17 00:00:00 2001 From: Yukio Ejiri Date: Mon, 16 Oct 2017 12:05:41 +0900 Subject: [PATCH 155/197] [kotlin] Fix causing NoClassDefFoundError at runtime on Android device (#6661) * Fix causing NoClassDefFoundError at runtime on Android device. * Add samples modified by bin/kotlin-client-petstore.sh --- .../kotlin-client/infrastructure/ApiClient.kt.mustache | 6 +++--- .../kotlin/io/swagger/client/infrastructure/ApiClient.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache b/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache index 49517bd1592..6c56fd17356 100644 --- a/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache +++ b/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache @@ -60,9 +60,9 @@ open class ApiClient(val baseUrl: String) { var urlBuilder = httpUrl.newBuilder() .addPathSegments(requestConfig.path.trimStart('/')) - requestConfig.query.forEach { k, v -> - v.forEach { queryValue -> - urlBuilder = urlBuilder.addQueryParameter(k,queryValue) + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue) } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt index 40d771e475d..da178750688 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt @@ -60,9 +60,9 @@ open class ApiClient(val baseUrl: String) { var urlBuilder = httpUrl.newBuilder() .addPathSegments(requestConfig.path.trimStart('/')) - requestConfig.query.forEach { k, v -> - v.forEach { queryValue -> - urlBuilder = urlBuilder.addQueryParameter(k,queryValue) + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue) } } From 12a85bb09d9e8a68bb6c39929d11ec8972b18321 Mon Sep 17 00:00:00 2001 From: Logan Patino Date: Sun, 15 Oct 2017 23:34:31 -0400 Subject: [PATCH 156/197] Add enum support for flask (#6684) --- .../codegen/languages/FlaskConnexionCodegen.java | 6 ++++++ .../src/main/resources/flaskConnexion/model.mustache | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index efaee9eb05f..adab7d64d16 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -662,6 +662,12 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert postProcessPattern(property.pattern, property.vendorExtensions); } + @Override + public Map postProcessModels(Map objs) { + // process enum in models + return postProcessModelsEnum(objs); + } + @Override public void postProcessParameter(CodegenParameter parameter){ postProcessPattern(parameter.pattern, parameter.vendorExtensions); diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache index 9a0b4f89247..761492870bf 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/model.mustache @@ -16,6 +16,16 @@ class {{classname}}(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + +{{#allowableValues}} + """ + allowed enum values + """ +{{#enumVars}} + {{name}} = {{{value}}} +{{/enumVars}} +{{/allowableValues}} + def __init__(self{{#vars}}, {{name}}{{^supportPython2}}: {{datatype}}{{/supportPython2}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): """ {{classname}} - a model defined in Swagger From 619c391be9682214b44f7707d52fdf279ca5ae45 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 16 Oct 2017 11:48:13 +0800 Subject: [PATCH 157/197] update python flask petstore samples --- bin/python-flask-all.sh | 4 ++ ...n2.sh => python-flask-petstore-python2.sh} | 0 ...kConnexion.sh => python-flask-petstore.sh} | 0 .../.swagger-codegen/VERSION | 2 +- .../flaskConnexion-python2/requirements.txt | 2 +- .../swagger_server/models/api_response.py | 2 + .../swagger_server/models/category.py | 2 + .../swagger_server/models/order.py | 2 + .../swagger_server/models/pet.py | 2 + .../swagger_server/models/tag.py | 2 + .../swagger_server/models/user.py | 2 + .../swagger_server/swagger/swagger.yaml | 46 ++++++++++++++++++- .../flaskConnexion/.swagger-codegen/VERSION | 2 +- .../swagger_server/models/api_response.py | 2 + .../swagger_server/models/category.py | 2 + .../swagger_server/models/order.py | 2 + .../swagger_server/models/pet.py | 2 + .../swagger_server/models/tag.py | 2 + .../swagger_server/models/user.py | 2 + .../swagger_server/swagger/swagger.yaml | 46 ++++++++++++++++++- 20 files changed, 119 insertions(+), 7 deletions(-) create mode 100755 bin/python-flask-all.sh rename bin/{flaskConnexion-python2.sh => python-flask-petstore-python2.sh} (100%) rename bin/{flaskConnexion.sh => python-flask-petstore.sh} (100%) diff --git a/bin/python-flask-all.sh b/bin/python-flask-all.sh new file mode 100755 index 00000000000..ed4ca88d286 --- /dev/null +++ b/bin/python-flask-all.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./bin/python-flask-petstore.sh +./bin/python-flask-petstore-python2.sh diff --git a/bin/flaskConnexion-python2.sh b/bin/python-flask-petstore-python2.sh similarity index 100% rename from bin/flaskConnexion-python2.sh rename to bin/python-flask-petstore-python2.sh diff --git a/bin/flaskConnexion.sh b/bin/python-flask-petstore.sh similarity index 100% rename from bin/flaskConnexion.sh rename to bin/python-flask-petstore.sh diff --git a/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION +++ b/samples/server/petstore/flaskConnexion-python2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/flaskConnexion-python2/requirements.txt b/samples/server/petstore/flaskConnexion-python2/requirements.txt index 19b78ffc36d..87876f969e9 100644 --- a/samples/server/petstore/flaskConnexion-python2/requirements.txt +++ b/samples/server/petstore/flaskConnexion-python2/requirements.txt @@ -1,4 +1,4 @@ -connexion == 1.1.9 +connexion == 1.1.15 python_dateutil == 2.6.0 typing == 3.5.2.2 setuptools >= 21.0.0 diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/api_response.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/api_response.py index 0868d2a1049..c1e51033298 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/api_response.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/api_response.py @@ -12,6 +12,8 @@ class ApiResponse(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, code=None, type=None, message=None): """ ApiResponse - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py index fd702edf6fe..d465845fe11 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/category.py @@ -12,6 +12,8 @@ class Category(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id=None, name=None): """ Category - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py index 9574a16fb46..fefe4cb8c5f 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/order.py @@ -12,6 +12,8 @@ class Order(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): """ Order - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py index 0ecf301be64..35dac42dc45 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/pet.py @@ -14,6 +14,8 @@ class Pet(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): """ Pet - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py index 76b4c15c97e..0933d44d0b1 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/tag.py @@ -12,6 +12,8 @@ class Tag(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id=None, name=None): """ Tag - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py index 27f215ef61c..eddf5ef92ef 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/models/user.py @@ -12,6 +12,8 @@ class User(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): """ User - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml index 92590b31bc1..32000d3c2dc 100644 --- a/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion-python2/swagger_server/swagger/swagger.yaml @@ -11,7 +11,7 @@ info: contact: email: "apiteam@swagger.io" license: - name: "Apache 2.0" + name: "Apache-2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "petstore.swagger.io" basePath: "/v2" @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: @@ -161,6 +161,7 @@ paths: - petstore_auth: - "write:pets" - "read:pets" + deprecated: true x-swagger-router-controller: "swagger_server.controllers.pet_controller" /pet/{petId}: get: @@ -625,6 +626,13 @@ definitions: 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: @@ -637,6 +645,9 @@ definitions: type: "string" title: "Pet catehgry" description: "A category for a pet" + example: + name: "name" + id: 6 xml: name: "Category" User: @@ -663,6 +674,15 @@ definitions: 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: @@ -675,6 +695,9 @@ definitions: type: "string" title: "Pet Tag" description: "A tag for a pet" + example: + name: "name" + id: 1 xml: name: "Tag" Pet: @@ -714,6 +737,21 @@ definitions: - "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: @@ -728,6 +766,10 @@ definitions: 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" diff --git a/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION b/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION +++ b/samples/server/petstore/flaskConnexion/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/api_response.py b/samples/server/petstore/flaskConnexion/swagger_server/models/api_response.py index b49738579d6..8b7cecc3398 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/api_response.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/api_response.py @@ -12,6 +12,8 @@ class ApiResponse(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, code: int=None, type: str=None, message: str=None): """ ApiResponse - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/category.py b/samples/server/petstore/flaskConnexion/swagger_server/models/category.py index ba381b5792f..42657e8447d 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/category.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/category.py @@ -12,6 +12,8 @@ class Category(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id: int=None, name: str=None): """ Category - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/order.py b/samples/server/petstore/flaskConnexion/swagger_server/models/order.py index 772769084d5..deffb5236b2 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/order.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/order.py @@ -12,6 +12,8 @@ class Order(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id: int=None, pet_id: int=None, quantity: int=None, ship_date: datetime=None, status: str=None, complete: bool=False): """ Order - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py b/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py index 6594f0f90d2..30173e024fb 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/pet.py @@ -14,6 +14,8 @@ class Pet(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id: int=None, category: Category=None, name: str=None, photo_urls: List[str]=None, tags: List[Tag]=None, status: str=None): """ Pet - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/tag.py b/samples/server/petstore/flaskConnexion/swagger_server/models/tag.py index 635ab029eea..9931b7476b1 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/tag.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/tag.py @@ -12,6 +12,8 @@ class Tag(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id: int=None, name: str=None): """ Tag - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/models/user.py b/samples/server/petstore/flaskConnexion/swagger_server/models/user.py index 08ebe6cf9db..c4ea4d373bc 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/models/user.py +++ b/samples/server/petstore/flaskConnexion/swagger_server/models/user.py @@ -12,6 +12,8 @@ class User(Model): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + def __init__(self, id: int=None, username: str=None, first_name: str=None, last_name: str=None, email: str=None, password: str=None, phone: str=None, user_status: int=None): """ User - a model defined in Swagger diff --git a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml index 92590b31bc1..32000d3c2dc 100644 --- a/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml +++ b/samples/server/petstore/flaskConnexion/swagger_server/swagger/swagger.yaml @@ -11,7 +11,7 @@ info: contact: email: "apiteam@swagger.io" license: - name: "Apache 2.0" + name: "Apache-2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "petstore.swagger.io" basePath: "/v2" @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" responses: 200: @@ -161,6 +161,7 @@ paths: - petstore_auth: - "write:pets" - "read:pets" + deprecated: true x-swagger-router-controller: "swagger_server.controllers.pet_controller" /pet/{petId}: get: @@ -625,6 +626,13 @@ definitions: 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: @@ -637,6 +645,9 @@ definitions: type: "string" title: "Pet catehgry" description: "A category for a pet" + example: + name: "name" + id: 6 xml: name: "Category" User: @@ -663,6 +674,15 @@ definitions: 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: @@ -675,6 +695,9 @@ definitions: type: "string" title: "Pet Tag" description: "A tag for a pet" + example: + name: "name" + id: 1 xml: name: "Tag" Pet: @@ -714,6 +737,21 @@ definitions: - "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: @@ -728,6 +766,10 @@ definitions: 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" From 8b70f24371e5296fc95a60c3c89e1e53eccbb179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Mon, 16 Oct 2017 09:23:05 -0400 Subject: [PATCH 158/197] There was no validation when a required field was null, creating crash and null pointer exception further down the line in the business code. Now, it throws a InvalidArgumentException. (#6673) --- .../newApiController.mustache | 88 +++++++++++------ .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../public/swagger.json | 2 +- .../app/Module.java | 1 + .../controllers/AnotherFakeApiController.java | 50 ++++++++++ .../AnotherFakeApiControllerImp.java | 19 ++++ .../AnotherFakeApiControllerImpInterface.java | 16 ++++ .../app/controllers/FakeApiController.java | 94 +++++++++---------- .../FakeClassnameTags123ApiController.java | 10 +- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../conf/routes | 3 + .../public/swagger.json | 49 ++++++++-- .../app/controllers/PetApiController.java | 32 ++++--- .../app/controllers/StoreApiController.java | 8 +- .../app/controllers/UserApiController.java | 48 ++++++---- .../public/swagger.json | 2 +- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../public/swagger.json | 2 +- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../public/swagger.json | 2 +- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../public/swagger.json | 2 +- .../app/controllers/PetApiController.java | 36 ++++--- .../app/controllers/StoreApiController.java | 10 +- .../app/controllers/UserApiController.java | 60 +++++++----- .../java-play-framework/public/swagger.json | 2 +- 39 files changed, 747 insertions(+), 425 deletions(-) create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache index 12c4fbb9d5f..0d7345a93b9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -52,25 +52,35 @@ public class {{classname}}Controller extends Controller { {{^collectionFormat}} JsonNode node{{paramName}} = request().body().asJson(); {{{dataType}}} {{paramName}}; - {{^required}} if (node{{paramName}} != null) { - {{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{#isContainer}}new TypeReference<{{{dataType}}}>(){}{{/isContainer}}{{^isContainer}}{{{dataType}}}.class{{/isContainer}});{{/required}} - {{#required}}{{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{#isContainer}}new TypeReference<{{{dataType}}}>(){}{{/isContainer}}{{^isContainer}}{{{dataType}}}.class{{/isContainer}});{{/required}}{{#useBeanValidation}} - {{#isListContainer}}for ({{{baseType}}} curItem : {{paramName}}) { - curItem.validate(); - }{{/isListContainer}}{{#isMapContainer}}for (Map.Entry entry : {{paramName}}.entrySet()) { - entry.getValue().validate(); - } - {{/isMapContainer}}{{^isContainer}}{{paramName}}.validate();{{/isContainer}}{{/useBeanValidation}} - {{^required}} + {{paramName}} = mapper.readValue(node{{paramName}}.toString(), {{#isContainer}}new TypeReference<{{{dataType}}}>(){}{{/isContainer}}{{^isContainer}}{{{dataType}}}.class{{/isContainer}}); + {{#useBeanValidation}} + {{#isListContainer}}for ({{{baseType}}} curItem : {{paramName}}) { + curItem.validate(); + }{{/isListContainer}}{{#isMapContainer}}for (Map.Entry entry : {{paramName}}.entrySet()) { + entry.getValue().validate(); + } + {{/isMapContainer}}{{^isContainer}}{{paramName}}.validate();{{/isContainer}} + {{/useBeanValidation}} } else { + {{#required}} + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + {{/required}} + {{^required}} {{paramName}} = null; - }{{/required}} + {{/required}} + } {{/collectionFormat}} {{/bodyParams}} {{#queryParams}} {{#collectionFormat}} - List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", request().queryString().get("{{baseName}}")); + String[] {{paramName}}Array = request().queryString().get("{{baseName}}"); + {{#required}} + if ({{paramName}}Array == null) { + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + } + {{/required}} + List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation @@ -80,14 +90,16 @@ public class {{classname}}Controller extends Controller { {{^collectionFormat}} String value{{paramName}} = request().getQueryString("{{baseName}}"); {{{dataType}}} {{paramName}}; - {{^required}} if (value{{paramName}} != null) { - {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{^required}} + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}}; } else { + {{#required}} + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + {{/required}} + {{^required}} {{paramName}} = {{>paramDefaultValue}}; - }{{/required}} + {{/required}} + } {{/collectionFormat}} {{/queryParams}} {{#formParams}} @@ -95,13 +107,19 @@ public class {{classname}}Controller extends Controller { {{{dataType}}} {{paramName}} = request().body().asMultipartFormData().getFile("{{baseName}}"); {{#required}} if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) { - throw new RuntimeException("File cannot be empty"); + throw new IllegalArgumentException("'{{baseName}}' file cannot be empty"); } {{/required}} {{/notFile}} {{#notFile}} {{#collectionFormat}} - List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}")); + String[] {{paramName}}Array = request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"); + {{#required}} + if ({{paramName}}Array == null) { + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + } + {{/required}} + List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation @@ -111,20 +129,28 @@ public class {{classname}}Controller extends Controller { {{^collectionFormat}} String value{{paramName}} = (request().body().asMultipartFormData().asFormUrlEncoded().get("{{baseName}}"))[0]; {{{dataType}}} {{paramName}}; - {{^required}} if (value{{paramName}} != null) { - {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{^required}} + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}}; } else { + {{#required}} + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + {{/required}} + {{^required}} {{paramName}} = {{>paramDefaultValue}}; - }{{/required}} + {{/required}} + } {{/collectionFormat}} {{/notFile}} {{/formParams}} {{#headerParams}} {{#collectionFormat}} - List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", request().headers().get("{{baseName}}")); + String[] {{paramName}}Array = request().headers().get("{{baseName}}"); + {{#required}} + if ({{paramName}}Array == null) { + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + } + {{/required}} + List {{paramName}}List = SwaggerUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); for (String curParam : {{paramName}}List) { //noinspection UseBulkOperation @@ -134,14 +160,16 @@ public class {{classname}}Controller extends Controller { {{^collectionFormat}} String value{{paramName}} = request().getHeader("{{baseName}}"); {{{dataType}}} {{paramName}}; - {{^required}} if (value{{paramName}} != null) { - {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{#required}}{{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}};{{/required}} - {{^required}} + {{paramName}} = {{>conversionBegin}}value{{paramName}}{{>conversionEnd}}; } else { + {{#required}} + throw new IllegalArgumentException("'{{baseName}}' parameter is required"); + {{/required}} + {{^required}} {{paramName}} = {{>paramDefaultValue}}; - }{{/required}} + {{/required}} + } {{/collectionFormat}} {{/headerParams}} {{^controllerOnly}} diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index 57c67da82ac..74f975466b1 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -36,10 +36,12 @@ private PetApiController() { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } return ok(); } @@ -49,7 +51,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -58,7 +59,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -69,7 +74,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -87,10 +96,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } return ok(); } @@ -100,7 +111,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -108,7 +118,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -121,7 +130,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index 566bf84526c..a0cc3e27d57 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -50,10 +50,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } return ok(); } } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 7d93808f3af..ec0b0d53ef0 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -35,10 +35,12 @@ private UserApiController() { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } return ok(); } @@ -46,12 +48,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - return ok(); } @@ -59,12 +63,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - return ok(); } @@ -82,14 +88,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + if (valuepassword != null) { + password = valuepassword; + } else { + throw new IllegalArgumentException("'password' parameter is required"); + } return ok(); } @@ -102,10 +112,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } return ok(); } } diff --git a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/swagger.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/Module.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/Module.java index 058fb7ddd01..eea2541f91c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/Module.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/Module.java @@ -6,6 +6,7 @@ public class Module extends AbstractModule { @Override protected void configure() { + bind(AnotherFakeApiControllerImpInterface.class).to(AnotherFakeApiControllerImp.class); bind(FakeApiControllerImpInterface.class).to(FakeApiControllerImp.class); bind(FakeClassnameTags123ApiControllerImpInterface.class).to(FakeClassnameTags123ApiControllerImp.class); bind(PetApiControllerImpInterface.class).to(PetApiControllerImp.class); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java new file mode 100644 index 00000000000..6164019070f --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java @@ -0,0 +1,50 @@ +package controllers; + +import apimodels.Client; + +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 swagger.SwaggerUtils.ApiAction; + + +public class AnotherFakeApiController extends Controller { + + private final AnotherFakeApiControllerImpInterface imp; + private final ObjectMapper mapper; + + @Inject + private AnotherFakeApiController(AnotherFakeApiControllerImpInterface imp) { + this.imp = imp; + mapper = new ObjectMapper(); + } + + + @ApiAction + public Result testSpecialTags() throws Exception { + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + Client obj = imp.testSpecialTags(body); + obj.validate(); + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java new file mode 100644 index 00000000000..a482a7f8492 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java @@ -0,0 +1,19 @@ +package controllers; + +import apimodels.Client; + +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 AnotherFakeApiControllerImp implements AnotherFakeApiControllerImpInterface { + @Override + public Client testSpecialTags(Client body) throws Exception { + //Do your magic!!! + return new Client(); + } + +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java new file mode 100644 index 00000000000..f60394a0103 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java @@ -0,0 +1,16 @@ +package controllers; + +import apimodels.Client; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.validation.constraints.*; + +@SuppressWarnings("RedundantThrows") +public interface AnotherFakeApiControllerImpInterface { + Client testSpecialTags(Client body) throws Exception; + +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 5781e482a79..d9bcaed20a5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -42,8 +42,7 @@ public Result fakeOuterBooleanSerialize() throws Exception { Boolean body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), Boolean.class); - - body.validate(); + body.validate(); } else { body = null; } @@ -58,8 +57,7 @@ public Result fakeOuterCompositeSerialize() throws Exception { OuterComposite body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), OuterComposite.class); - - body.validate(); + body.validate(); } else { body = null; } @@ -75,8 +73,7 @@ public Result fakeOuterNumberSerialize() throws Exception { BigDecimal body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), BigDecimal.class); - - body.validate(); + body.validate(); } else { body = null; } @@ -92,8 +89,7 @@ public Result fakeOuterStringSerialize() throws Exception { String body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), String.class); - - body.validate(); + body.validate(); } else { body = null; } @@ -106,10 +102,12 @@ public Result fakeOuterStringSerialize() throws Exception { public Result testClientModel() throws Exception { JsonNode nodebody = request().body().asJson(); Client body; - - body = mapper.readValue(nodebody.toString(), Client.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Client obj = imp.testClientModel(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); @@ -122,7 +120,6 @@ public Result testEndpointParameters() throws Exception { Integer integer; if (valueinteger != null) { integer = Integer.parseInt(valueinteger); - } else { integer = null; } @@ -130,7 +127,6 @@ public Result testEndpointParameters() throws Exception { Integer int32; if (valueint32 != null) { int32 = Integer.parseInt(valueint32); - } else { int32 = null; } @@ -138,51 +134,55 @@ public Result testEndpointParameters() throws Exception { Long int64; if (valueint64 != null) { int64 = Long.parseLong(valueint64); - } else { int64 = null; } String valuenumber = (request().body().asMultipartFormData().asFormUrlEncoded().get("number"))[0]; BigDecimal number; - - number = Float.parseFloat(valuenumber); - + if (valuenumber != null) { + number = Float.parseFloat(valuenumber); + } else { + throw new IllegalArgumentException("'number' parameter is required"); + } String value_float = (request().body().asMultipartFormData().asFormUrlEncoded().get("float"))[0]; Float _float; if (value_float != null) { _float = Float.parseFloat(value_float); - } else { _float = null; } String value_double = (request().body().asMultipartFormData().asFormUrlEncoded().get("double"))[0]; Double _double; - - _double = Double.parseDouble(value_double); - + if (value_double != null) { + _double = Double.parseDouble(value_double); + } else { + throw new IllegalArgumentException("'double' parameter is required"); + } String valuestring = (request().body().asMultipartFormData().asFormUrlEncoded().get("string"))[0]; String string; if (valuestring != null) { string = valuestring; - } else { string = null; } String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; - - patternWithoutDelimiter = valuepatternWithoutDelimiter; - + if (valuepatternWithoutDelimiter != null) { + patternWithoutDelimiter = valuepatternWithoutDelimiter; + } else { + throw new IllegalArgumentException("'pattern_without_delimiter' parameter is required"); + } String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0]; byte[] _byte; - - _byte = value_byte; - + if (value_byte != null) { + _byte = value_byte; + } else { + throw new IllegalArgumentException("'byte' parameter is required"); + } String valuebinary = (request().body().asMultipartFormData().asFormUrlEncoded().get("binary"))[0]; byte[] binary; if (valuebinary != null) { binary = valuebinary; - } else { binary = null; } @@ -190,7 +190,6 @@ public Result testEndpointParameters() throws Exception { LocalDate date; if (valuedate != null) { date = valuedate; - } else { date = null; } @@ -198,7 +197,6 @@ public Result testEndpointParameters() throws Exception { OffsetDateTime dateTime; if (valuedateTime != null) { dateTime = OffsetDateTime.parse(valuedateTime); - } else { dateTime = null; } @@ -206,7 +204,6 @@ public Result testEndpointParameters() throws Exception { String password; if (valuepassword != null) { password = valuepassword; - } else { password = null; } @@ -214,7 +211,6 @@ public Result testEndpointParameters() throws Exception { String paramCallback; if (valueparamCallback != null) { paramCallback = valueparamCallback; - } else { paramCallback = null; } @@ -224,7 +220,8 @@ public Result testEndpointParameters() throws Exception { @ApiAction public Result testEnumParameters() throws Exception { - List enumQueryStringArrayList = SwaggerUtils.parametersToList("csv", request().queryString().get("enum_query_string_array")); + String[] enumQueryStringArrayArray = request().queryString().get("enum_query_string_array"); + List enumQueryStringArrayList = SwaggerUtils.parametersToList("csv", enumQueryStringArrayArray); List enumQueryStringArray = new ArrayList(); for (String curParam : enumQueryStringArrayList) { //noinspection UseBulkOperation @@ -234,7 +231,6 @@ public Result testEnumParameters() throws Exception { String enumQueryString; if (valueenumQueryString != null) { enumQueryString = valueenumQueryString; - } else { enumQueryString = "-efg"; } @@ -242,11 +238,11 @@ public Result testEnumParameters() throws Exception { Integer enumQueryInteger; if (valueenumQueryInteger != null) { enumQueryInteger = Integer.parseInt(valueenumQueryInteger); - } else { enumQueryInteger = null; } - List enumFormStringArrayList = SwaggerUtils.parametersToList("csv", request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array")); + String[] enumFormStringArrayArray = request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array"); + List enumFormStringArrayList = SwaggerUtils.parametersToList("csv", enumFormStringArrayArray); List enumFormStringArray = new ArrayList(); for (String curParam : enumFormStringArrayList) { //noinspection UseBulkOperation @@ -256,7 +252,6 @@ public Result testEnumParameters() throws Exception { String enumFormString; if (valueenumFormString != null) { enumFormString = valueenumFormString; - } else { enumFormString = "-efg"; } @@ -264,11 +259,11 @@ public Result testEnumParameters() throws Exception { Double enumQueryDouble; if (valueenumQueryDouble != null) { enumQueryDouble = Double.parseDouble(valueenumQueryDouble); - } else { enumQueryDouble = null; } - List enumHeaderStringArrayList = SwaggerUtils.parametersToList("csv", request().headers().get("enum_header_string_array")); + String[] enumHeaderStringArrayArray = request().headers().get("enum_header_string_array"); + List enumHeaderStringArrayList = SwaggerUtils.parametersToList("csv", enumHeaderStringArrayArray); List enumHeaderStringArray = new ArrayList(); for (String curParam : enumHeaderStringArrayList) { //noinspection UseBulkOperation @@ -278,7 +273,6 @@ public Result testEnumParameters() throws Exception { String enumHeaderString; if (valueenumHeaderString != null) { enumHeaderString = valueenumHeaderString; - } else { enumHeaderString = "-efg"; } @@ -290,14 +284,18 @@ public Result testEnumParameters() throws Exception { public Result testJsonFormData() throws Exception { String valueparam = (request().body().asMultipartFormData().asFormUrlEncoded().get("param"))[0]; String param; - - param = valueparam; - + if (valueparam != null) { + param = valueparam; + } else { + throw new IllegalArgumentException("'param' parameter is required"); + } String valueparam2 = (request().body().asMultipartFormData().asFormUrlEncoded().get("param2"))[0]; String param2; - - param2 = valueparam2; - + if (valueparam2 != null) { + param2 = valueparam2; + } else { + throw new IllegalArgumentException("'param2' parameter is required"); + } imp.testJsonFormData(param, param2); return ok(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index 2a2716d673b..785c5da877f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -36,10 +36,12 @@ private FakeClassnameTags123ApiController(FakeClassnameTags123ApiControllerImpIn public Result testClassname() throws Exception { JsonNode nodebody = request().body().asJson(); Client body; - - body = mapper.readValue(nodebody.toString(), Client.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Client obj = imp.testClassname(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 6ea11161da1..2ecdbcbdc0b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -38,10 +38,12 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -52,7 +54,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -62,7 +63,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -78,7 +83,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -104,10 +113,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -118,7 +129,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -126,7 +136,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -140,7 +149,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 92fafa4b746..8254d1f992e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -58,10 +58,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index c084e050fa2..b0676d8e3d5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -37,10 +37,12 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -49,12 +51,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -63,12 +67,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -91,14 +97,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -114,10 +124,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } 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 26b70790d0a..d3094cd2441 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes +++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes @@ -5,6 +5,9 @@ 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() diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json index b6ec73c0ce2..52a10430087 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, @@ -1087,6 +1087,35 @@ "x-contentType" : "application/json", "x-accepts" : "application/json" } + }, + "/another-fake/dummy" : { + "patch" : { + "tags" : [ "$another-fake?" ], + "summary" : "To test special tags", + "description" : "To test special tags", + "operationId" : "test_special_tags", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "client model", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Client" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Client" + } + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } } }, "securityDefinitions" : { @@ -1744,15 +1773,6 @@ "type" : "string", "enum" : [ "placed", "approved", "delivered" ] }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" - }, "OuterComposite" : { "type" : "object", "properties" : { @@ -1771,6 +1791,15 @@ "my_number" : { }, "my_boolean" : { } } + }, + "OuterNumber" : { + "type" : "number" + }, + "OuterString" : { + "type" : "string" + }, + "OuterBoolean" : { + "type" : "boolean" } }, "externalDocs" : { diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 93298749857..34a762ed90f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -37,9 +37,11 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -50,7 +52,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -60,7 +61,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -73,7 +78,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -95,9 +104,11 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -108,7 +119,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -116,7 +126,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -130,7 +139,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 3b0cd2a23b3..b297256a2c9 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -56,9 +56,11 @@ public Result getOrderById(Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); JsonNode result = mapper.valueToTree(obj); return ok(result); diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 0005ef24311..d186137d39c 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -36,9 +36,11 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -47,9 +49,11 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUsersWithArrayInput(body); return ok(); } @@ -58,9 +62,11 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUsersWithListInput(body); return ok(); } @@ -82,14 +88,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -105,9 +115,11 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index ceec97042b1..c5fc05efb60 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -39,10 +39,12 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws IOException { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -53,7 +55,6 @@ public Result deletePet(Long petId) { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -63,7 +64,11 @@ public Result deletePet(Long petId) { @ApiAction public Result findPetsByStatus() { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -79,7 +84,11 @@ public Result findPetsByStatus() { @ApiAction public Result findPetsByTags() { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -105,10 +114,12 @@ public Result getPetById(Long petId) { public Result updatePet() throws IOException { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -119,7 +130,6 @@ public Result updatePetWithForm(Long petId) { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -127,7 +137,6 @@ public Result updatePetWithForm(Long petId) { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -141,7 +150,6 @@ public Result uploadFile(Long petId) { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index ab19ac3ae26..147561498ea 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -59,10 +59,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) { public Result placeOrder() throws IOException { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index d09687a9a30..a0e94c65233 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -38,10 +38,12 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws IOException { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -50,12 +52,14 @@ public Result createUser() throws IOException { public Result createUsersWithArrayInput() throws IOException { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -64,12 +68,14 @@ public Result createUsersWithArrayInput() throws IOException { public Result createUsersWithListInput() throws IOException { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -92,14 +98,18 @@ public Result getUserByName(String username) { public Result loginUser() { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -115,10 +125,12 @@ public Result logoutUser() { public Result updateUser(String username) throws IOException { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index 0701f3ba336..e1f3f0b0a21 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -38,10 +38,12 @@ private PetApiController(PetApiControllerImp imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -52,7 +54,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -62,7 +63,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -78,7 +83,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -104,10 +113,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -118,7 +129,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -126,7 +136,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -140,7 +149,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index b6801a3ef1f..2c0b41176ce 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -58,10 +58,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index a62e1fb9c02..05f0a4eefed 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -37,10 +37,12 @@ private UserApiController(UserApiControllerImp imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -49,12 +51,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -63,12 +67,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -91,14 +97,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -114,10 +124,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 6ea11161da1..2ecdbcbdc0b 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -38,10 +38,12 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -52,7 +54,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -62,7 +63,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -78,7 +83,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -104,10 +113,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -118,7 +129,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -126,7 +136,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -140,7 +149,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 92fafa4b746..8254d1f992e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -58,10 +58,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index c084e050fa2..b0676d8e3d5 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -37,10 +37,12 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -49,12 +51,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -63,12 +67,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -91,14 +97,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -114,10 +124,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index c00d5993360..7b393595452 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -37,10 +37,12 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -51,7 +53,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -61,7 +62,11 @@ public Result deletePet(Long petId) throws Exception { public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -77,7 +82,11 @@ public Result findPetsByStatus() throws Exception { public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -103,10 +112,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -117,7 +128,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -125,7 +135,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -139,7 +148,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index 2f5b5b5b627..964e48e91a0 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -57,10 +57,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index e95378850b6..06b4ef13b65 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -36,10 +36,12 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -48,12 +50,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -62,12 +66,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -90,14 +96,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -113,10 +123,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 6ea11161da1..2ecdbcbdc0b 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -38,10 +38,12 @@ private PetApiController(PetApiControllerImpInterface imp) { public Result addPet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.addPet(body); return ok(); } @@ -52,7 +54,6 @@ public Result deletePet(Long petId) throws Exception { String apiKey; if (valueapiKey != null) { apiKey = valueapiKey; - } else { apiKey = null; } @@ -62,7 +63,11 @@ public Result deletePet(Long petId) throws Exception { @ApiAction public Result findPetsByStatus() throws Exception { - List statusList = SwaggerUtils.parametersToList("csv", request().queryString().get("status")); + 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 @@ -78,7 +83,11 @@ public Result findPetsByStatus() throws Exception { @ApiAction public Result findPetsByTags() throws Exception { - List tagsList = SwaggerUtils.parametersToList("csv", request().queryString().get("tags")); + 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 @@ -104,10 +113,12 @@ public Result getPetById(Long petId) throws Exception { public Result updatePet() throws Exception { JsonNode nodebody = request().body().asJson(); Pet body; - - body = mapper.readValue(nodebody.toString(), Pet.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updatePet(body); return ok(); } @@ -118,7 +129,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String name; if (valuename != null) { name = valuename; - } else { name = null; } @@ -126,7 +136,6 @@ public Result updatePetWithForm(Long petId) throws Exception { String status; if (valuestatus != null) { status = valuestatus; - } else { status = null; } @@ -140,7 +149,6 @@ public Result uploadFile(Long petId) throws Exception { String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; - } else { additionalMetadata = null; } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 92fafa4b746..8254d1f992e 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -58,10 +58,12 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { public Result placeOrder() throws Exception { JsonNode nodebody = request().body().asJson(); Order body; - - body = mapper.readValue(nodebody.toString(), Order.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } Order obj = imp.placeOrder(body); obj.validate(); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index c084e050fa2..b0676d8e3d5 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -37,10 +37,12 @@ private UserApiController(UserApiControllerImpInterface imp) { public Result createUser() throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.createUser(body); return ok(); } @@ -49,12 +51,14 @@ public Result createUser() throws Exception { public Result createUsersWithArrayInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(body); return ok(); } @@ -63,12 +67,14 @@ public Result createUsersWithArrayInput() throws Exception { public Result createUsersWithListInput() throws Exception { JsonNode nodebody = request().body().asJson(); List body; - - body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); - for (User curItem : body) { - curItem.validate(); + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + for (User curItem : body) { + curItem.validate(); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(body); return ok(); } @@ -91,14 +97,18 @@ public Result getUserByName(String username) throws Exception { public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - - username = valueusername; - + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } String valuepassword = request().getQueryString("password"); String password; - - password = valuepassword; - + 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); @@ -114,10 +124,12 @@ public Result logoutUser() throws Exception { public Result updateUser(String username) throws Exception { JsonNode nodebody = request().body().asJson(); User body; - - body = mapper.readValue(nodebody.toString(), User.class); - body.validate(); - + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + body.validate(); + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } imp.updateUser(username, body); return ok(); } diff --git a/samples/server/petstore/java-play-framework/public/swagger.json b/samples/server/petstore/java-play-framework/public/swagger.json index bf0a7a26545..7b8017053a1 100644 --- a/samples/server/petstore/java-play-framework/public/swagger.json +++ b/samples/server/petstore/java-play-framework/public/swagger.json @@ -9,7 +9,7 @@ "email" : "apiteam@swagger.io" }, "license" : { - "name" : "Apache 2.0", + "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" } }, From 1050aa9a06014261bfe24497ec85a530a0b34f50 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Mon, 16 Oct 2017 06:28:21 -0700 Subject: [PATCH 159/197] Added support for enums in Dart. (#6516) * Added support for enums in Dart. * Pick non-private names for enum values. The _ prefix denotes a private member in Dart, so avoid generating enum values starting with this character. * Properly encode enum values into query paramters. * Various cleanups. * Add support for x-enum-values extension. Use class instead of enum for better ergonomy. Better generated enum names. * Fixed test. * Support enum descriptions. --- .../codegen/languages/DartClientCodegen.java | 149 ++++++++++++++++-- .../main/resources/dart/api_client.mustache | 22 ++- .../main/resources/dart/api_helper.mustache | 10 +- .../src/main/resources/dart/apilib.mustache | 2 +- .../src/main/resources/dart/class.mustache | 14 ++ .../src/main/resources/dart/enum.mustache | 36 +++++ .../src/main/resources/dart/model.mustache | 22 +-- .../codegen/dart/DartClientOptionsTest.java | 3 +- .../options/DartClientOptionsProvider.java | 2 + .../dart/swagger/.swagger-codegen/VERSION | 2 +- .../petstore/dart/swagger/docs/StoreApi.md | 2 +- .../client/petstore/dart/swagger/lib/api.dart | 2 +- .../petstore/dart/swagger/lib/api_client.dart | 6 +- .../petstore/dart/swagger/lib/api_helper.dart | 2 +- .../dart/swagger/lib/model/api_response.dart | 2 - .../dart/swagger/lib/model/category.dart | 2 - .../dart/swagger/lib/model/order.dart | 2 - .../petstore/dart/swagger/lib/model/pet.dart | 2 - .../petstore/dart/swagger/lib/model/tag.dart | 2 - .../petstore/dart/swagger/lib/model/user.dart | 2 - 20 files changed, 234 insertions(+), 52 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/dart/class.mustache create mode 100644 modules/swagger-codegen/src/main/resources/dart/enum.mustache diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java index da10196bfda..478431a455d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java @@ -3,27 +3,35 @@ import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConstants; +import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.CodegenType; import io.swagger.codegen.DefaultCodegen; import io.swagger.codegen.SupportingFile; +import io.swagger.models.Model; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.MapProperty; import io.swagger.models.properties.Property; import java.io.File; +import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String BROWSER_CLIENT = "browserClient"; public static final String PUB_NAME = "pubName"; public static final String PUB_VERSION = "pubVersion"; public static final String PUB_DESCRIPTION = "pubDescription"; + public static final String USE_ENUM_EXTENSION = "useEnumExtension"; protected boolean browserClient = true; protected String pubName = "swagger"; protected String pubVersion = "1.0.0"; protected String pubDescription = "Swagger API client"; + protected boolean useEnumExtension = false; protected String sourceFolder = ""; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -95,6 +103,7 @@ public DartClientCodegen() { cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); cliOptions.add(new CliOption(PUB_VERSION, "Version in generated pubspec")); cliOptions.add(new CliOption(PUB_DESCRIPTION, "Description in generated pubspec")); + cliOptions.add(new CliOption(USE_ENUM_EXTENSION, "Allow the 'x-enum-values' extension for enums")); cliOptions.add(new CliOption(CodegenConstants.SOURCE_FOLDER, "source folder for generated code")); } @@ -145,6 +154,13 @@ public void processOpts() { additionalProperties.put(PUB_DESCRIPTION, pubDescription); } + if (additionalProperties.containsKey(USE_ENUM_EXTENSION)) { + this.setUseEnumExtension(convertPropertyToBooleanAndWriteBack(USE_ENUM_EXTENSION)); + } else { + // Not set, use to be passed to template. + additionalProperties.put(USE_ENUM_EXTENSION, useEnumExtension); + } + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } @@ -177,16 +193,11 @@ 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("README.mustache", "", "README.md")); - } - @Override - public String escapeReservedWord(String name) { - if(this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; + public String escapeReservedWord(String name) { + return name + "_"; } @Override @@ -223,8 +234,11 @@ public String toVarName(String name) { // pet_id => petId name = camelize(name, true); - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { + if (name.matches("^\\d.*")) { + name = "n" + name; + } + + if (isReservedWord(name)) { name = escapeReservedWord(name); } @@ -300,6 +314,117 @@ public String getSwaggerType(Property p) { return toModelName(type); } + @Override + public Map postProcessModels(Map objs) { + return postProcessModelsEnum(objs); + } + + @Override + public Map postProcessModelsEnum(Map objs) { + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + boolean succes = buildEnumFromVendorExtension(cm) || + buildEnumFromValues(cm); + for (CodegenProperty var : cm.vars) { + updateCodegenPropertyEnum(var); + } + } + return objs; + } + + /** + * Builds the set of enum members from their declared value. + * + * @return {@code true} if the enum was built + */ + private boolean buildEnumFromValues(CodegenModel cm) { + if (!cm.isEnum || cm.allowableValues == null) { + return false; + } + Map allowableValues = cm.allowableValues; + List values = (List) allowableValues.get("values"); + List> enumVars = + new ArrayList>(); + String commonPrefix = findCommonPrefixOfVars(values); + int truncateIdx = commonPrefix.length(); + for (Object value : values) { + Map enumVar = new HashMap(); + String enumName; + if (truncateIdx == 0) { + enumName = value.toString(); + } else { + enumName = value.toString().substring(truncateIdx); + if ("".equals(enumName)) { + enumName = value.toString(); + } + } + enumVar.put("name", toEnumVarName(enumName, cm.dataType)); + enumVar.put("value", toEnumValue(value.toString(), cm.dataType)); + enumVars.add(enumVar); + } + cm.allowableValues.put("enumVars", enumVars); + return true; + } + + /** + * Builds the set of enum members from a vendor extension. + * + * @return {@code true} if the enum was built + */ + private boolean buildEnumFromVendorExtension(CodegenModel cm) { + if (!cm.isEnum || cm.allowableValues == null || + !useEnumExtension || + !cm.vendorExtensions.containsKey("x-enum-values")) { + return false; + } + Object extension = cm.vendorExtensions.get("x-enum-values"); + List> values = + (List>) extension; + List> enumVars = + new ArrayList>(); + for (Map value : values) { + Map enumVar = new HashMap(); + String name = camelize((String) value.get("identifier"), true); + if (isReservedWord(name)) { + name = escapeReservedWord(name); + } + enumVar.put("name", name); + enumVar.put("value", toEnumValue( + value.get("numericValue").toString(), cm.dataType)); + if (value.containsKey("description")) { + enumVar.put("description", value.get("description").toString()); + } + enumVars.add(enumVar); + } + cm.allowableValues.put("enumVars", enumVars); + return true; + } + + @Override + public String toEnumVarName(String value, String datatype) { + if (value.length() == 0) { + return "empty"; + } + String var = value.replaceAll("\\W+", "_"); + if ("number".equalsIgnoreCase(datatype) || + "int".equalsIgnoreCase(datatype)) { + var = "Number" + var; + } + return escapeReservedWord(camelize(var, true)); + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("number".equalsIgnoreCase(datatype) || + "int".equalsIgnoreCase(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + @Override public String toOperationId(String operationId) { // method name cannot use reserved keyword, e.g. return @@ -328,6 +453,10 @@ public void setPubDescription(String pubDescription) { this.pubDescription = pubDescription; } + public void setUseEnumExtension(boolean useEnumExtension) { + this.useEnumExtension = useEnumExtension; + } + public void setSourceFolder(String sourceFolder) { this.sourceFolder = sourceFolder; } diff --git a/modules/swagger-codegen/src/main/resources/dart/api_client.mustache b/modules/swagger-codegen/src/main/resources/dart/api_client.mustache index 86e698eb836..f35db7dbaed 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api_client.mustache @@ -16,7 +16,14 @@ class ApiClient { Map _authentications = {}; final dson = new Dartson.JSON() - ..addTransformer(new DateTimeParser(), DateTime); + {{#models}} + {{#model}} + {{#isEnum}} + ..addTransformer(new {{classname}}TypeTransformer(), {{classname}}) + {{/isEnum}} + {{/model}} + {{/models}} + ..addTransformer(new DateTimeParser(), DateTime); final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); @@ -46,7 +53,16 @@ class ApiClient { {{#models}} {{#model}} case '{{classname}}': + {{#isEnum}} + // Enclose the value in a list so that Dartson can use a transformer + // to decode it. + final listValue = [value]; + final List listResult = dson.map(listValue, []); + return listResult[0]; + {{/isEnum}} + {{^isEnum}} return dson.map(value, new {{classname}}()); + {{/isEnum}} {{/model}} {{/models}} default: @@ -116,7 +132,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = new MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -141,7 +157,7 @@ class ApiClient { } /// Update query and header parameters based on authentication settings. - /// @param authNames The authentications to apply + /// @param authNames The authentications to apply void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; diff --git a/modules/swagger-codegen/src/main/resources/dart/api_helper.mustache b/modules/swagger-codegen/src/main/resources/dart/api_helper.mustache index 15798ef3466..48de5ab24b0 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api_helper.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api_helper.mustache @@ -38,7 +38,15 @@ String _parameterToString(dynamic value) { return ''; } else if (value is DateTime) { return value.toUtc().toIso8601String(); + {{#models}} + {{#model}} + {{#isEnum}} + } else if (value is {{classname}}) { + return new {{classname}}TypeTransformer().encode(value).toString(); + {{/isEnum}} + {{/model}} + {{/models}} } else { return value.toString(); } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/dart/apilib.mustache b/modules/swagger-codegen/src/main/resources/dart/apilib.mustache index 8f131054f25..8782ce2236d 100644 --- a/modules/swagger-codegen/src/main/resources/dart/apilib.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/apilib.mustache @@ -6,6 +6,7 @@ import 'package:http/browser_client.dart';{{/browserClient}} import 'package:http/http.dart'; import 'package:dartson/dartson.dart'; import 'package:dartson/transformers/date_time.dart'; +import 'package:dartson/type_transformer.dart'; part 'api_client.dart'; part 'api_helper.dart'; @@ -21,4 +22,3 @@ part 'auth/http_basic_auth.dart'; {{/model}}{{/models}} ApiClient defaultApiClient = new ApiClient(); - diff --git a/modules/swagger-codegen/src/main/resources/dart/class.mustache b/modules/swagger-codegen/src/main/resources/dart/class.mustache new file mode 100644 index 00000000000..d92258c484f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/dart/class.mustache @@ -0,0 +1,14 @@ +@Entity() +class {{classname}} { + {{#vars}}{{#description}}/* {{{description}}} */{{/description}} + @Property(name: '{{baseName}}') + {{{datatype}}} {{name}} = {{{defaultValue}}}; + {{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}} + {{/vars}} + {{classname}}(); + + @override + String toString() { + return '{{classname}}[{{#vars}}{{name}}=${{name}}, {{/vars}}]'; + } +} diff --git a/modules/swagger-codegen/src/main/resources/dart/enum.mustache b/modules/swagger-codegen/src/main/resources/dart/enum.mustache new file mode 100644 index 00000000000..debb73bbcec --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/dart/enum.mustache @@ -0,0 +1,36 @@ +@Entity() +class {{classname}} { + /// The underlying value of this enum member. + final {{dataType}} value; + + const {{classname}}._internal(this.value); + + {{#allowableValues}} + {{#enumVars}} + {{#description}} + /// {{description}} + {{/description}} + static const {{classname}} {{name}} = const {{classname}}._internal({{value}}); + {{/enumVars}} + {{/allowableValues}} +} + +class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { + + @override + dynamic encode({{classname}} data) { + return data.value; + } + + @override + {{classname}} decode(dynamic data) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{value}}: return {{classname}}.{{name}}; + {{/enumVars}} + {{/allowableValues}} + default: throw('Unknown enum value to decode: $data'); + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/dart/model.mustache b/modules/swagger-codegen/src/main/resources/dart/model.mustache index 5fe107c7849..1fa14e179a7 100644 --- a/modules/swagger-codegen/src/main/resources/dart/model.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/model.mustache @@ -1,19 +1,7 @@ part of {{pubName}}.api; -{{#models}}{{#model}} -@Entity() -class {{classname}} { - {{#vars}}{{#description}}/* {{{description}}} */{{/description}} - @Property(name: '{{baseName}}') - {{{datatype}}} {{name}} = {{{defaultValue}}}; - {{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}} - {{/vars}} - {{classname}}(); - - @override - String toString() { - return '{{classname}}[{{#vars}}{{name}}=${{name}}, {{/vars}}]'; - } - -} -{{/model}}{{/models}} +{{#models}} +{{#model}} +{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/dart/DartClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/dart/DartClientOptionsTest.java index 519ac4943cc..38231d86f01 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/dart/DartClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/dart/DartClientOptionsTest.java @@ -38,7 +38,8 @@ protected void setExpectations() { times = 1; clientCodegen.setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); times = 1; + clientCodegen.setUseEnumExtension(Boolean.valueOf(DartClientOptionsProvider.USE_ENUM_EXTENSION)); + times = 1; }}; } } - diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/DartClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/DartClientOptionsProvider.java index 4e2670f2653..52586119be8 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/DartClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/DartClientOptionsProvider.java @@ -15,6 +15,7 @@ public class DartClientOptionsProvider implements OptionsProvider { public static final String PUB_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String PUB_DESCRIPTION_VALUE = "Swagger API client dart"; public static final String SOURCE_FOLDER_VALUE = "src"; + public static final String USE_ENUM_EXTENSION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -33,6 +34,7 @@ public Map createOptions() { .put(DartClientCodegen.PUB_VERSION, PUB_VERSION_VALUE) .put(DartClientCodegen.PUB_DESCRIPTION, PUB_DESCRIPTION_VALUE) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) + .put(DartClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .build(); } diff --git a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger/docs/StoreApi.md b/samples/client/petstore/dart/swagger/docs/StoreApi.md index c2e5dcdfde1..b2615f0d4f5 100644 --- a/samples/client/petstore/dart/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/swagger/docs/StoreApi.md @@ -87,7 +87,7 @@ This endpoint does not need any parameter. ### Return type -[**Map**](Map.md) +**Map** ### Authorization diff --git a/samples/client/petstore/dart/swagger/lib/api.dart b/samples/client/petstore/dart/swagger/lib/api.dart index 9273d7f1f99..79a83321fa5 100644 --- a/samples/client/petstore/dart/swagger/lib/api.dart +++ b/samples/client/petstore/dart/swagger/lib/api.dart @@ -6,6 +6,7 @@ import 'package:http/browser_client.dart'; import 'package:http/http.dart'; import 'package:dartson/dartson.dart'; import 'package:dartson/transformers/date_time.dart'; +import 'package:dartson/type_transformer.dart'; part 'api_client.dart'; part 'api_helper.dart'; @@ -28,4 +29,3 @@ part 'model/user.dart'; ApiClient defaultApiClient = new ApiClient(); - diff --git a/samples/client/petstore/dart/swagger/lib/api_client.dart b/samples/client/petstore/dart/swagger/lib/api_client.dart index 9552cef10d8..6c292b973f0 100644 --- a/samples/client/petstore/dart/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/swagger/lib/api_client.dart @@ -16,7 +16,7 @@ class ApiClient { Map _authentications = {}; final dson = new Dartson.JSON() - ..addTransformer(new DateTimeParser(), DateTime); + ..addTransformer(new DateTimeParser(), DateTime); final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); @@ -121,7 +121,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = new MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -146,7 +146,7 @@ class ApiClient { } /// Update query and header parameters based on authentication settings. - /// @param authNames The authentications to apply + /// @param authNames The authentications to apply void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; diff --git a/samples/client/petstore/dart/swagger/lib/api_helper.dart b/samples/client/petstore/dart/swagger/lib/api_helper.dart index 7d2c3471a9f..6da2530b1b2 100644 --- a/samples/client/petstore/dart/swagger/lib/api_helper.dart +++ b/samples/client/petstore/dart/swagger/lib/api_helper.dart @@ -41,4 +41,4 @@ String _parameterToString(dynamic value) { } else { return value.toString(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/swagger/lib/model/api_response.dart index b2ac2c2577e..7cb79fb8aef 100644 --- a/samples/client/petstore/dart/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/swagger/lib/model/api_response.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class ApiResponse { @@ -21,6 +20,5 @@ class ApiResponse { String toString() { return 'ApiResponse[code=$code, type=$type, message=$message, ]'; } - } diff --git a/samples/client/petstore/dart/swagger/lib/model/category.dart b/samples/client/petstore/dart/swagger/lib/model/category.dart index 9ab2a96fc37..26b90273163 100644 --- a/samples/client/petstore/dart/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/swagger/lib/model/category.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class Category { @@ -17,6 +16,5 @@ class Category { String toString() { return 'Category[id=$id, name=$name, ]'; } - } diff --git a/samples/client/petstore/dart/swagger/lib/model/order.dart b/samples/client/petstore/dart/swagger/lib/model/order.dart index d7ea97b3bad..84e4a972d57 100644 --- a/samples/client/petstore/dart/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/swagger/lib/model/order.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class Order { @@ -33,6 +32,5 @@ class Order { String toString() { return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; } - } diff --git a/samples/client/petstore/dart/swagger/lib/model/pet.dart b/samples/client/petstore/dart/swagger/lib/model/pet.dart index 03e13743763..f2b4108b892 100644 --- a/samples/client/petstore/dart/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/swagger/lib/model/pet.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class Pet { @@ -33,6 +32,5 @@ class Pet { String toString() { return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; } - } diff --git a/samples/client/petstore/dart/swagger/lib/model/tag.dart b/samples/client/petstore/dart/swagger/lib/model/tag.dart index 485de92a615..45f3668b3e7 100644 --- a/samples/client/petstore/dart/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/swagger/lib/model/tag.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class Tag { @@ -17,6 +16,5 @@ class Tag { String toString() { return 'Tag[id=$id, name=$name, ]'; } - } diff --git a/samples/client/petstore/dart/swagger/lib/model/user.dart b/samples/client/petstore/dart/swagger/lib/model/user.dart index f529d9432c1..77c02114428 100644 --- a/samples/client/petstore/dart/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/swagger/lib/model/user.dart @@ -1,6 +1,5 @@ part of swagger.api; - @Entity() class User { @@ -41,6 +40,5 @@ class User { String toString() { return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; } - } From 488aa989bf1f8f3436b89c5f5d8bd04e933a3331 Mon Sep 17 00:00:00 2001 From: Taylor Brown Date: Mon, 16 Oct 2017 09:07:57 -0500 Subject: [PATCH 160/197] Adding a new Scala client codegen (#6572) * Adding a Scalaz codegen client * Fixing imports and removing commented code * Adding the bash file and updating the Pet store samples for Scalaz. * Finalizing Scalaz generation so that it works for the Petstore.yaml * Removing some unnecessary files and comments * Removing some files that were accidentally generated for the wrong Scala --- bin/scalaz-petstore.sh | 31 ++ .../languages/ScalazClientCodegen.java | 250 ++++++++++++ .../services/io.swagger.codegen.CodegenConfig | 1 + .../resources/scalaz/HelperCodecs.mustache | 15 + .../scalaz/QueryParamTypeclass.mustache | 15 + .../src/main/resources/scalaz/api.mustache | 83 ++++ .../main/resources/scalaz/build.sbt.mustache | 19 + .../resources/scalaz/clientFunction.mustache | 1 + .../resources/scalaz/dateTimeCodecs.mustache | 19 + .../src/main/resources/scalaz/model.mustache | 56 +++ .../scalaz/operationReturnType.mustache | 1 + .../petstore/scalaz/.swagger-codegen-ignore | 23 ++ .../petstore/scalaz/.swagger-codegen/VERSION | 1 + samples/client/petstore/scalaz/build.sbt | 19 + .../io/swagger/client/api/ApiResponse.scala | 23 ++ .../io/swagger/client/api/Category.scala | 22 ++ .../swagger/client/api/DateTimeCodecs.scala | 19 + .../io/swagger/client/api/HelperCodecs.scala | 15 + .../scala/io/swagger/client/api/Order.scala | 52 +++ .../scala/io/swagger/client/api/Pet.scala | 52 +++ .../scala/io/swagger/client/api/PetApi.scala | 357 ++++++++++++++++++ .../client/api/QueryParamTypeClass.scala | 15 + .../io/swagger/client/api/StoreApi.scala | 201 ++++++++++ .../scala/io/swagger/client/api/Tag.scala | 22 ++ .../scala/io/swagger/client/api/User.scala | 29 ++ .../scala/io/swagger/client/api/UserApi.scala | 349 +++++++++++++++++ 26 files changed, 1690 insertions(+) create mode 100755 bin/scalaz-petstore.sh create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/HelperCodecs.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/QueryParamTypeclass.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/api.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/build.sbt.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/clientFunction.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/dateTimeCodecs.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/model.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scalaz/operationReturnType.mustache create mode 100644 samples/client/petstore/scalaz/.swagger-codegen-ignore create mode 100644 samples/client/petstore/scalaz/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/scalaz/build.sbt create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/ApiResponse.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Category.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/DateTimeCodecs.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/HelperCodecs.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Order.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Pet.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/PetApi.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/QueryParamTypeClass.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/StoreApi.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Tag.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/User.scala create mode 100644 samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/UserApi.scala diff --git a/bin/scalaz-petstore.sh b/bin/scalaz-petstore.sh new file mode 100755 index 00000000000..266e8cbf9e7 --- /dev/null +++ b/bin/scalaz-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/scalaz -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scalaz -o samples/client/petstore/scalaz" + +java $JAVA_OPTS -jar $executable $ags 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 new file mode 100644 index 00000000000..30f984464c1 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java @@ -0,0 +1,250 @@ +package io.swagger.codegen.languages; + +import com.google.common.base.CaseFormat; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; + +import io.swagger.codegen.*; + +import io.swagger.models.auth.SecuritySchemeDefinition; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.DateTimeProperty; +import io.swagger.models.properties.DoubleProperty; +import io.swagger.models.properties.FloatProperty; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.LongProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.Property; +import io.swagger.models.properties.StringProperty; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.util.*; + +import org.apache.commons.lang3.StringUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ScalazClientCodegen extends AbstractScalaCodegen implements CodegenConfig { + + public ScalazClientCodegen() { + super(); + outputFolder = "generated-code/scalaz"; + embeddedTemplateDir = templateDir = "scalaz"; + apiPackage = "io.swagger.client.api"; + modelPackage = "io.swagger.client.api"; + + modelTemplateFiles.put("model.mustache", ".scala"); + apiTemplateFiles.put("api.mustache", ".scala"); + + 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") + ); + + additionalProperties.put("apiPackage", apiPackage); + + supportingFiles.add(new SupportingFile("build.sbt.mustache", "", "build.sbt")); + supportingFiles.add(new SupportingFile("dateTimeCodecs.mustache", (sourceFolder + File.separator + apiPackage).replace(".", File.separator), "DateTimeCodecs.scala")); + supportingFiles.add(new SupportingFile("HelperCodecs.mustache", (sourceFolder + File.separator + apiPackage).replace(".", File.separator), "HelperCodecs.scala")); + supportingFiles.add(new SupportingFile("QueryParamTypeclass.mustache", (sourceFolder + File.separator + apiPackage).replace(".", File.separator), "QueryParamTypeclass.scala")); + + 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("number", "BigDecimal"); + typeMapping.put("date-time", "DateTime"); + typeMapping.put("date", "DateTime"); + + + //instantiationTypes.put("array", "ListBuffer"); + instantiationTypes.put("array", "ListBuffer"); + instantiationTypes.put("map", "HashMap"); + + additionalProperties.put("fnEnumEntry", new EnumEntryLambda()); + + cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase")); + } + + @Override + public void processOpts() { + super.processOpts(); + if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { + setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); + } + } + + public void setModelPropertyNaming(String naming) { + if ("original".equals(naming) || "camelCase".equals(naming) || + "PascalCase".equals(naming) || "snake_case".equals(naming)) { + this.modelPropertyNaming = naming; + } else { + throw new IllegalArgumentException("Invalid model property naming '" + + naming + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + } + + public String getModelPropertyNaming() { + return this.modelPropertyNaming; + } + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + if("_".equals(name)) { + name = "_u"; + } + + // if it's all uppper case, do nothing + if (name.matches("^[A-Z_]*$")) { + return name; + } + + name = getNameUsingModelPropertyNaming(name); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + return name; + } + + @Override + public String toParamName(String name) { + // should be the same as variable name + return toVarName(name); + } + + @Override + public String toEnumName(CodegenProperty property) { + return formatIdentifier(property.baseName, true); + } + + public String getNameUsingModelPropertyNaming(String name) { + switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { + case original: return name; + case camelCase: return camelize(name, true); + case PascalCase: return camelize(name); + case snake_case: return underscore(name); + default: throw new IllegalArgumentException("Invalid model property naming '" + + name + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "scalaz"; + } + + @Override + public String getHelp() { + return "Generates a Scalaz client library that uses http4s"; + } + + @Override + public String toOperationId(String operationId) { + // throw exception if method name is empty + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + throw new RuntimeException(operationId + " (reserved word) cannot be used as method name"); + } + + return camelize(operationId, true); + } + + @Override + public String toModelName(final String name) { + final String sanitizedName = sanitizeName(modelNamePrefix + this.stripPackageName(name) + modelNameSuffix); + + // camelize the model name + // phone_number => PhoneNumber + final String camelizedName = camelize(sanitizedName); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + final String modelName = "Model" + camelizedName; + LOGGER.warn(camelizedName + " (reserved word) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + // model name starts with number + if (name.matches("^\\d.*")) { + final String modelName = "Model" + camelizedName; // e.g. 200Response => Model200Response (after camelize) + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); + return modelName; + } + + return camelizedName; + } + + private static abstract class CustomLambda implements Mustache.Lambda { + @Override + public void execute(Template.Fragment frag, Writer out) throws IOException { + final StringWriter tempWriter = new StringWriter(); + frag.execute(tempWriter); + out.write(formatFragment(tempWriter.toString())); + } + + 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) { + return formatIdentifier(fragment, true); + } + } +} 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 a584a5cd5b3..356c310e1df 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 @@ -58,6 +58,7 @@ io.swagger.codegen.languages.RubyClientCodegen io.swagger.codegen.languages.RustClientCodegen io.swagger.codegen.languages.ScalaClientCodegen io.swagger.codegen.languages.ScalatraServerCodegen +io.swagger.codegen.languages.ScalazClientCodegen io.swagger.codegen.languages.SilexServerCodegen io.swagger.codegen.languages.SinatraServerCodegen io.swagger.codegen.languages.SlimFrameworkServerCodegen diff --git a/modules/swagger-codegen/src/main/resources/scalaz/HelperCodecs.mustache b/modules/swagger-codegen/src/main/resources/scalaz/HelperCodecs.mustache new file mode 100644 index 00000000000..9bb400b9bda --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/HelperCodecs.mustache @@ -0,0 +1,15 @@ +package {{apiPackage}} + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ + +import org.joda.time.DateTime + +object HelperCodecs { + implicit def returnTypeDecoder[A: EncodeJson]: EntityEncoder[List[A]] = jsonEncoderOf[List[A]] +} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/QueryParamTypeclass.mustache b/modules/swagger-codegen/src/main/resources/scalaz/QueryParamTypeclass.mustache new file mode 100644 index 00000000000..6ce8ee71291 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/QueryParamTypeclass.mustache @@ -0,0 +1,15 @@ +package {{apiPackage}} + +trait QueryParam[A] { + def toParamString(a: A): String +} + +object QueryParam { + implicit def strQueryParam: QueryParam[String] = new QueryParam[String] { + def toParamString(s: String): String = s + } + + implicit def listStrQueryParam: QueryParam[List[String]] = new QueryParam[List[String]] { + def toParamString(s: List[String]): String = s.mkString(",") + } +} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/api.mustache b/modules/swagger-codegen/src/main/resources/scalaz/api.mustache new file mode 100644 index 00000000000..9eeba0a96ee --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/api.mustache @@ -0,0 +1,83 @@ +package {{package}} + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import java.io.File +import java.net.URLEncoder +import java.util.UUID + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.http4s.client._ +import org.http4s.client.blaze.PooledHttp1Client +import org.http4s.headers._ + +import org.joda.time.DateTime + +import scalaz.concurrent.Task + +import HelperCodecs._ + +{{#operations}} +object {{classname}} { + + val client = PooledHttp1Client() + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + {{#operation}} + def {{nickname}}(host: String{{#allParams}}{{#-first}}, {{/-first}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#queryParams}}{{#-first}}(implicit {{/-first}}{{paramName}}Query: QueryParam[{{dataType}}]{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/queryParams}}: {{>operationReturnType}}{{#returnType}} implicit val returnTypeDecoder: EntityDecoder[{{returnType}}] = jsonOf[{{returnType}}] + +{{/returnType}} + val path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} + + val httpMethod = Method.{{httpMethod}} + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + {{#headerParams}}Header("{{baseName}}", {{paramName}}){{^-last}}, {{/-last}}{{/headerParams}}) + val queryParams = Query( + {{#queryParams}}("{{paramName}}", Some({{baseName}}Query.toParamString({{baseName}}))){{^-last}}, {{/-last}}{{/queryParams}}) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)){{#bodyParam}}.withBody({{paramName}}){{/bodyParam}} + {{>clientFunction}} + } yield resp + } + + {{/operation}} +} + +class HttpService{{classname}}(service: HttpService) { + val client = Client.fromHttpService(service) + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + {{#operation}} + def {{nickname}}({{#allParams}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#queryParams}}{{#-first}}(implicit {{/-first}}{{paramName}}Query: QueryParam[{{dataType}}]{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/queryParams}}: {{>operationReturnType}}{{#returnType}} implicit val returnTypeDecoder: EntityDecoder[{{returnType}}] = jsonOf[{{returnType}}] + +{{/returnType}} + val path = "{{path}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",escape({{paramName}}.toString)){{/pathParams}} + + val httpMethod = Method.{{httpMethod}} + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + {{#headerParams}}Header("{{baseName}}", {{paramName}}){{^-last}}, {{/-last}}{{/headerParams}}) + val queryParams = Query( + {{#queryParams}}("{{paramName}}", Some({{baseName}}Query.toParamString({{baseName}}))){{^-last}}, {{/-last}}{{/queryParams}}) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)){{#bodyParam}}.withBody({{paramName}}){{/bodyParam}} + {{>clientFunction}} + } yield resp + } + + {{/operation}} +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/scalaz/build.sbt.mustache new file mode 100644 index 00000000000..0153bb64d34 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/build.sbt.mustache @@ -0,0 +1,19 @@ +scalaVersion := "2.11.8" + +val http4sVersion = "0.15.12a" +val scalazVersion = "7.2.12" +val shapelessVersion = "2.3.2" +val argonautShapelessVersion = "1.2.0-M4" + +libraryDependencies ++= Seq( + "joda-time" % "joda-time" % "2.2", + "com.chuusai" %% "shapeless" % shapelessVersion, + "org.http4s" %% "http4s-argonaut" % http4sVersion, + "org.http4s" %% "http4s-dsl" % http4sVersion, + "org.http4s" %% "http4s-server-metrics" % http4sVersion, + "org.http4s" %% "http4s-blaze-client" % http4sVersion, + "org.scalaz" %% "scalaz-concurrent" % scalazVersion, + "org.scalaz" %% "scalaz-core" % scalazVersion, + "io.argonaut" %% "argonaut-scalaz" % "6.2", + "com.github.alexarchambault" %% "argonaut-shapeless_6.2" % argonautShapelessVersion +) diff --git a/modules/swagger-codegen/src/main/resources/scalaz/clientFunction.mustache b/modules/swagger-codegen/src/main/resources/scalaz/clientFunction.mustache new file mode 100644 index 00000000000..bd7c75b38d9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/clientFunction.mustache @@ -0,0 +1 @@ +{{#returnType}}resp <- client.expect[{{returnType}}](req){{/returnType}}{{^returnType}}resp <- client.fetch[Unit](req)(_ => Task.now(())){{/returnType}} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/dateTimeCodecs.mustache b/modules/swagger-codegen/src/main/resources/scalaz/dateTimeCodecs.mustache new file mode 100644 index 00000000000..fa73adb562e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/dateTimeCodecs.mustache @@ -0,0 +1,19 @@ +package {{apiPackage}} + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ + +import org.joda.time.DateTime + +object DateTimeCodecs { + implicit def dateTimeEncodeJson: EncodeJson[DateTime] = + EncodeJson[DateTime](dt => StringEncodeJson(dt.toString)) + + implicit def dateTimeDecodeJson: DecodeJson[DateTime] = + DecodeJson.of[String].map(DateTime.parse(_)) setName "org.joda.time.DateTime" +} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/model.mustache b/modules/swagger-codegen/src/main/resources/scalaz/model.mustache new file mode 100644 index 00000000000..e0725cb819d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/model.mustache @@ -0,0 +1,56 @@ +package {{package}} + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +{{#models}} +{{#model}} +import {{classname}}._ + +case class {{classname}} ( + {{#vars}}{{#description}}/* {{{description}}} */ + {{/description}}{{name}}: {{^required}}Option[{{/required}}{{^isEnum}}{{datatype}}{{/isEnum}}{{#isEnum}}{{datatypeWithEnum}}{{/isEnum}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}{{^hasMore}}){{/hasMore}} + {{/vars}} + +object {{classname}} { + import DateTimeCodecs._ + {{#hasEnums}} + {{#vars}} + {{#isEnum}} + sealed trait {{datatypeWithEnum}} + {{#_enum}} + case object {{#fnEnumEntry}}{{.}}{{/fnEnumEntry}} extends {{datatypeWithEnum}} + {{/_enum}} + + object {{datatypeWithEnum}} { + def to{{datatypeWithEnum}}(s: String): Option[{{datatypeWithEnum}}] = s match { +{{#_enum}} case "{{#fnEnumEntry}}{{.}}{{/fnEnumEntry}}" => Some({{#fnEnumEntry}}{{.}}{{/fnEnumEntry}}) +{{/_enum}} + case _ => None + } + + def from{{datatypeWithEnum}}(x: {{datatypeWithEnum}}): String = x match { +{{#_enum}} case {{#fnEnumEntry}}{{.}}{{/fnEnumEntry}} => "{{#fnEnumEntry}}{{.}}{{/fnEnumEntry}}" +{{/_enum}} + } + } + + implicit val {{datatypeWithEnum}}EnumEncoder: EncodeJson[{{datatypeWithEnum}}] = + EncodeJson[{{datatypeWithEnum}}](is => StringEncodeJson({{datatypeWithEnum}}.from{{datatypeWithEnum}}(is))) + + implicit val {{datatypeWithEnum}}EnumDecoder: DecodeJson[{{datatypeWithEnum}}] = + DecodeJson.optionDecoder[{{datatypeWithEnum}}](n => n.string.flatMap(jStr => {{datatypeWithEnum}}.to{{datatypeWithEnum}}(jStr)), "{{datatypeWithEnum}} failed to de-serialize") + {{/isEnum}} + {{/vars}} + {{/hasEnums}} + + implicit val {{classname}}CodecJson: CodecJson[{{classname}}] = CodecJson.derive[{{classname}}] + implicit val {{classname}}Decoder: EntityDecoder[{{classname}}] = jsonOf[{{classname}}] + implicit val {{classname}}Encoder: EntityEncoder[{{classname}}] = jsonEncoderOf[{{classname}}] +} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/scalaz/operationReturnType.mustache b/modules/swagger-codegen/src/main/resources/scalaz/operationReturnType.mustache new file mode 100644 index 00000000000..f224ea59ad0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalaz/operationReturnType.mustache @@ -0,0 +1 @@ +Task[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}] = { diff --git a/samples/client/petstore/scalaz/.swagger-codegen-ignore b/samples/client/petstore/scalaz/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/scalaz/.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/scalaz/.swagger-codegen/VERSION b/samples/client/petstore/scalaz/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/scalaz/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scalaz/build.sbt b/samples/client/petstore/scalaz/build.sbt new file mode 100644 index 00000000000..0153bb64d34 --- /dev/null +++ b/samples/client/petstore/scalaz/build.sbt @@ -0,0 +1,19 @@ +scalaVersion := "2.11.8" + +val http4sVersion = "0.15.12a" +val scalazVersion = "7.2.12" +val shapelessVersion = "2.3.2" +val argonautShapelessVersion = "1.2.0-M4" + +libraryDependencies ++= Seq( + "joda-time" % "joda-time" % "2.2", + "com.chuusai" %% "shapeless" % shapelessVersion, + "org.http4s" %% "http4s-argonaut" % http4sVersion, + "org.http4s" %% "http4s-dsl" % http4sVersion, + "org.http4s" %% "http4s-server-metrics" % http4sVersion, + "org.http4s" %% "http4s-blaze-client" % http4sVersion, + "org.scalaz" %% "scalaz-concurrent" % scalazVersion, + "org.scalaz" %% "scalaz-core" % scalazVersion, + "io.argonaut" %% "argonaut-scalaz" % "6.2", + "com.github.alexarchambault" %% "argonaut-shapeless_6.2" % argonautShapelessVersion +) diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/ApiResponse.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/ApiResponse.scala new file mode 100644 index 00000000000..7d4bd29011b --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/ApiResponse.scala @@ -0,0 +1,23 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import ApiResponse._ + +case class ApiResponse ( + code: Option[Integer], +_type: Option[String], +message: Option[String]) + +object ApiResponse { + import DateTimeCodecs._ + + implicit val ApiResponseCodecJson: CodecJson[ApiResponse] = CodecJson.derive[ApiResponse] + implicit val ApiResponseDecoder: EntityDecoder[ApiResponse] = jsonOf[ApiResponse] + implicit val ApiResponseEncoder: EntityEncoder[ApiResponse] = jsonEncoderOf[ApiResponse] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Category.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Category.scala new file mode 100644 index 00000000000..972b0dd02cd --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Category.scala @@ -0,0 +1,22 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import Category._ + +case class Category ( + id: Option[Long], +name: Option[String]) + +object Category { + import DateTimeCodecs._ + + implicit val CategoryCodecJson: CodecJson[Category] = CodecJson.derive[Category] + implicit val CategoryDecoder: EntityDecoder[Category] = jsonOf[Category] + implicit val CategoryEncoder: EntityEncoder[Category] = jsonEncoderOf[Category] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/DateTimeCodecs.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/DateTimeCodecs.scala new file mode 100644 index 00000000000..bcf5f2f3eae --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/DateTimeCodecs.scala @@ -0,0 +1,19 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ + +import org.joda.time.DateTime + +object DateTimeCodecs { + implicit def dateTimeEncodeJson: EncodeJson[DateTime] = + EncodeJson[DateTime](dt => StringEncodeJson(dt.toString)) + + implicit def dateTimeDecodeJson: DecodeJson[DateTime] = + DecodeJson.of[String].map(DateTime.parse(_)) setName "org.joda.time.DateTime" +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/HelperCodecs.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/HelperCodecs.scala new file mode 100644 index 00000000000..4276fa1654d --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/HelperCodecs.scala @@ -0,0 +1,15 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ + +import org.joda.time.DateTime + +object HelperCodecs { + implicit def returnTypeDecoder[A: EncodeJson]: EntityEncoder[List[A]] = jsonEncoderOf[List[A]] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Order.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Order.scala new file mode 100644 index 00000000000..653757a81f0 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Order.scala @@ -0,0 +1,52 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import Order._ + +case class Order ( + id: Option[Long], +petId: Option[Long], +quantity: Option[Integer], +shipDate: Option[DateTime], +/* Order Status */ + status: Option[Status], +complete: Option[Boolean]) + +object Order { + import DateTimeCodecs._ + sealed trait Status + case object Placed extends Status + case object Approved extends Status + case object Delivered extends Status + + object Status { + def toStatus(s: String): Option[Status] = s match { + case "Placed" => Some(Placed) + case "Approved" => Some(Approved) + case "Delivered" => Some(Delivered) + case _ => None + } + + def fromStatus(x: Status): String = x match { + case Placed => "Placed" + case Approved => "Approved" + case Delivered => "Delivered" + } + } + + implicit val StatusEnumEncoder: EncodeJson[Status] = + EncodeJson[Status](is => StringEncodeJson(Status.fromStatus(is))) + + implicit val StatusEnumDecoder: DecodeJson[Status] = + DecodeJson.optionDecoder[Status](n => n.string.flatMap(jStr => Status.toStatus(jStr)), "Status failed to de-serialize") + + implicit val OrderCodecJson: CodecJson[Order] = CodecJson.derive[Order] + implicit val OrderDecoder: EntityDecoder[Order] = jsonOf[Order] + implicit val OrderEncoder: EntityEncoder[Order] = jsonEncoderOf[Order] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Pet.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Pet.scala new file mode 100644 index 00000000000..ec00c7662bc --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Pet.scala @@ -0,0 +1,52 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import Pet._ + +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[Status]) + +object Pet { + import DateTimeCodecs._ + sealed trait Status + case object Available extends Status + case object Pending extends Status + case object Sold extends Status + + object Status { + def toStatus(s: String): Option[Status] = s match { + case "Available" => Some(Available) + case "Pending" => Some(Pending) + case "Sold" => Some(Sold) + case _ => None + } + + def fromStatus(x: Status): String = x match { + case Available => "Available" + case Pending => "Pending" + case Sold => "Sold" + } + } + + implicit val StatusEnumEncoder: EncodeJson[Status] = + EncodeJson[Status](is => StringEncodeJson(Status.fromStatus(is))) + + implicit val StatusEnumDecoder: DecodeJson[Status] = + DecodeJson.optionDecoder[Status](n => n.string.flatMap(jStr => Status.toStatus(jStr)), "Status failed to de-serialize") + + implicit val PetCodecJson: CodecJson[Pet] = CodecJson.derive[Pet] + implicit val PetDecoder: EntityDecoder[Pet] = jsonOf[Pet] + implicit val PetEncoder: EntityEncoder[Pet] = jsonEncoderOf[Pet] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/PetApi.scala new file mode 100644 index 00000000000..34508d07f84 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/PetApi.scala @@ -0,0 +1,357 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import java.io.File +import java.net.URLEncoder +import java.util.UUID + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.http4s.client._ +import org.http4s.client.blaze.PooledHttp1Client +import org.http4s.headers._ + +import org.joda.time.DateTime + +import scalaz.concurrent.Task + +import HelperCodecs._ + +object PetApi { + + val client = PooledHttp1Client() + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def addPet(host: String, body: Pet): Task[Unit] = { + val path = "/pet" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def deletePet(host: String, petId: Long, apiKey: String): Task[Unit] = { + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + Header("api_key", apiKey)) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def findPetsByStatus(host: String, status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] + + val path = "/pet/findByStatus" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("status", Some(statusQuery.toParamString(status)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[List[Pet]](req) + + } yield resp + } + + def findPetsByTags(host: String, tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] + + val path = "/pet/findByTags" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("tags", Some(tagsQuery.toParamString(tags)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[List[Pet]](req) + + } yield resp + } + + def getPetById(host: String, petId: Long): Task[Pet] = { + implicit val returnTypeDecoder: EntityDecoder[Pet] = jsonOf[Pet] + + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Pet](req) + + } yield resp + } + + def updatePet(host: String, body: Pet): Task[Unit] = { + val path = "/pet" + + val httpMethod = Method.PUT + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def updatePetWithForm(host: String, petId: Long, name: String, status: String): Task[Unit] = { + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def uploadFile(host: String, petId: Long, additionalMetadata: String, file: File): Task[ApiResponse] = { + implicit val returnTypeDecoder: EntityDecoder[ApiResponse] = jsonOf[ApiResponse] + + val path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[ApiResponse](req) + + } yield resp + } + +} + +class HttpServicePetApi(service: HttpService) { + val client = Client.fromHttpService(service) + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def addPet(body: Pet): Task[Unit] = { + val path = "/pet" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def deletePet(petId: Long, apiKey: String): Task[Unit] = { + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + Header("api_key", apiKey)) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def findPetsByStatus(status: List[String])(implicit statusQuery: QueryParam[List[String]]): Task[List[Pet]] = { + implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] + + val path = "/pet/findByStatus" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("status", Some(statusQuery.toParamString(status)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[List[Pet]](req) + + } yield resp + } + + def findPetsByTags(tags: List[String])(implicit tagsQuery: QueryParam[List[String]]): Task[List[Pet]] = { + implicit val returnTypeDecoder: EntityDecoder[List[Pet]] = jsonOf[List[Pet]] + + val path = "/pet/findByTags" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("tags", Some(tagsQuery.toParamString(tags)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[List[Pet]](req) + + } yield resp + } + + def getPetById(petId: Long): Task[Pet] = { + implicit val returnTypeDecoder: EntityDecoder[Pet] = jsonOf[Pet] + + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Pet](req) + + } yield resp + } + + def updatePet(body: Pet): Task[Unit] = { + val path = "/pet" + + val httpMethod = Method.PUT + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def updatePetWithForm(petId: Long, name: String, status: String): Task[Unit] = { + val path = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def uploadFile(petId: Long, additionalMetadata: String, file: File): Task[ApiResponse] = { + implicit val returnTypeDecoder: EntityDecoder[ApiResponse] = jsonOf[ApiResponse] + + val path = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}",escape(petId.toString)) + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[ApiResponse](req) + + } yield resp + } + +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/QueryParamTypeClass.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/QueryParamTypeClass.scala new file mode 100644 index 00000000000..2444a9376b2 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/QueryParamTypeClass.scala @@ -0,0 +1,15 @@ +package io.swagger.client.api + +trait QueryParam[A] { + def toParamString(a: A): String +} + +object QueryParam { + implicit def strQueryParam: QueryParam[String] = new QueryParam[String] { + def toParamString(s: String): String = s + } + + implicit def listStrQueryParam: QueryParam[List[String]] = new QueryParam[List[String]] { + def toParamString(s: List[String]): String = s.mkString(",") + } +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/StoreApi.scala new file mode 100644 index 00000000000..4136582c685 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -0,0 +1,201 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import java.io.File +import java.net.URLEncoder +import java.util.UUID + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.http4s.client._ +import org.http4s.client.blaze.PooledHttp1Client +import org.http4s.headers._ + +import org.joda.time.DateTime + +import scalaz.concurrent.Task + +import HelperCodecs._ + +object StoreApi { + + val client = PooledHttp1Client() + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def deleteOrder(host: String, orderId: String): Task[Unit] = { + val path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}",escape(orderId.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def getInventory(host: String): Task[Map[String, Integer]] = { + implicit val returnTypeDecoder: EntityDecoder[Map[String, Integer]] = jsonOf[Map[String, Integer]] + + val path = "/store/inventory" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Map[String, Integer]](req) + + } yield resp + } + + def getOrderById(host: String, orderId: Long): Task[Order] = { + implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] + + val path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}",escape(orderId.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Order](req) + + } yield resp + } + + def placeOrder(host: String, body: Order): Task[Order] = { + implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] + + val path = "/store/order" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.expect[Order](req) + + } yield resp + } + +} + +class HttpServiceStoreApi(service: HttpService) { + val client = Client.fromHttpService(service) + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def deleteOrder(orderId: String): Task[Unit] = { + val path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}",escape(orderId.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def getInventory(): Task[Map[String, Integer]] = { + implicit val returnTypeDecoder: EntityDecoder[Map[String, Integer]] = jsonOf[Map[String, Integer]] + + val path = "/store/inventory" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Map[String, Integer]](req) + + } yield resp + } + + def getOrderById(orderId: Long): Task[Order] = { + implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] + + val path = "/store/order/{orderId}".replaceAll("\\{" + "orderId" + "\\}",escape(orderId.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[Order](req) + + } yield resp + } + + def placeOrder(body: Order): Task[Order] = { + implicit val returnTypeDecoder: EntityDecoder[Order] = jsonOf[Order] + + val path = "/store/order" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.expect[Order](req) + + } yield resp + } + +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Tag.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Tag.scala new file mode 100644 index 00000000000..27b1ab18f2a --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/Tag.scala @@ -0,0 +1,22 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import Tag._ + +case class Tag ( + id: Option[Long], +name: Option[String]) + +object Tag { + import DateTimeCodecs._ + + implicit val TagCodecJson: CodecJson[Tag] = CodecJson.derive[Tag] + implicit val TagDecoder: EntityDecoder[Tag] = jsonOf[Tag] + implicit val TagEncoder: EntityEncoder[Tag] = jsonEncoderOf[Tag] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/User.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/User.scala new file mode 100644 index 00000000000..f1898cc37dc --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/User.scala @@ -0,0 +1,29 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.joda.time.DateTime +import 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], +/* User Status */ + userStatus: Option[Integer]) + +object User { + import DateTimeCodecs._ + + implicit val UserCodecJson: CodecJson[User] = CodecJson.derive[User] + implicit val UserDecoder: EntityDecoder[User] = jsonOf[User] + implicit val UserEncoder: EntityEncoder[User] = jsonEncoderOf[User] +} diff --git a/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/UserApi.scala new file mode 100644 index 00000000000..ea4619e01f5 --- /dev/null +++ b/samples/client/petstore/scalaz/src/main/scala/io/swagger/client/api/UserApi.scala @@ -0,0 +1,349 @@ +package io.swagger.client.api + +import argonaut._ +import argonaut.EncodeJson._ +import argonaut.DecodeJson._ + +import java.io.File +import java.net.URLEncoder +import java.util.UUID + +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ +import org.http4s.client._ +import org.http4s.client.blaze.PooledHttp1Client +import org.http4s.headers._ + +import org.joda.time.DateTime + +import scalaz.concurrent.Task + +import HelperCodecs._ + +object UserApi { + + val client = PooledHttp1Client() + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def createUser(host: String, body: User): Task[Unit] = { + val path = "/user" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def createUsersWithArrayInput(host: String, body: List[User]): Task[Unit] = { + val path = "/user/createWithArray" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def createUsersWithListInput(host: String, body: List[User]): Task[Unit] = { + val path = "/user/createWithList" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def deleteUser(host: String, username: String): Task[Unit] = { + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def getUserByName(host: String, username: String): Task[User] = { + implicit val returnTypeDecoder: EntityDecoder[User] = jsonOf[User] + + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[User](req) + + } yield resp + } + + def loginUser(host: String, username: String, password: String)(implicit usernameQuery: QueryParam[String], passwordQuery: QueryParam[String]): Task[String] = { + implicit val returnTypeDecoder: EntityDecoder[String] = jsonOf[String] + + val path = "/user/login" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("username", Some(usernameQuery.toParamString(username))), ("password", Some(passwordQuery.toParamString(password)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[String](req) + + } yield resp + } + + def logoutUser(host: String): Task[Unit] = { + val path = "/user/logout" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def updateUser(host: String, username: String, body: User): Task[Unit] = { + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.PUT + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(host + path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + +} + +class HttpServiceUserApi(service: HttpService) { + val client = Client.fromHttpService(service) + + def escape(value: String): String = URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") + + def createUser(body: User): Task[Unit] = { + val path = "/user" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def createUsersWithArrayInput(body: List[User]): Task[Unit] = { + val path = "/user/createWithArray" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def createUsersWithListInput(body: List[User]): Task[Unit] = { + val path = "/user/createWithList" + + val httpMethod = Method.POST + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def deleteUser(username: String): Task[Unit] = { + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.DELETE + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def getUserByName(username: String): Task[User] = { + implicit val returnTypeDecoder: EntityDecoder[User] = jsonOf[User] + + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[User](req) + + } yield resp + } + + def loginUser(username: String, password: String)(implicit usernameQuery: QueryParam[String], passwordQuery: QueryParam[String]): Task[String] = { + implicit val returnTypeDecoder: EntityDecoder[String] = jsonOf[String] + + val path = "/user/login" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ("username", Some(usernameQuery.toParamString(username))), ("password", Some(passwordQuery.toParamString(password)))) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.expect[String](req) + + } yield resp + } + + def logoutUser(): Task[Unit] = { + val path = "/user/logout" + + val httpMethod = Method.GET + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + + def updateUser(username: String, body: User): Task[Unit] = { + val path = "/user/{username}".replaceAll("\\{" + "username" + "\\}",escape(username.toString)) + + val httpMethod = Method.PUT + val contentType = `Content-Type`(MediaType.`application/json`) + val headers = Headers( + ) + val queryParams = Query( + ) + + for { + uri <- Task.fromDisjunction(Uri.fromString(path)) + uriWithParams = uri.copy(query = queryParams) + req = Request(method = httpMethod, uri = uriWithParams, headers = headers.put(contentType)).withBody(body) + resp <- client.fetch[Unit](req)(_ => Task.now(())) + + } yield resp + } + +} From 15450754ecd7df9209c3f1f16ca13e10d5315b41 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 16 Oct 2017 22:15:07 +0800 Subject: [PATCH 161/197] add tbrown1979 as template creator for scalaz --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9961dd9a4ac..65c55c254b6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ## Overview 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, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala**, **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) +- **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **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), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) @@ -987,6 +987,7 @@ Here is a list of template creators: * PowerShell: @beatcracker * R: @ramnov * Rust: @farcaller + * Scala (scalaz & http4s): @tbrown1979 * Swift: @tkqubo * Swift 3: @hexelon * Swift 4: @ehyche From 62794c1d60602da591f120825efcfd2ea7dce7ca Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 16 Oct 2017 22:23:26 +0800 Subject: [PATCH 162/197] add scalaz to cirleci --- pom.xml.circleci | 1 + samples/client/petstore/scalaz/pom.xml | 32 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 samples/client/petstore/scalaz/pom.xml diff --git a/pom.xml.circleci b/pom.xml.circleci index 9ae687499d7..862bd4cc880 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -823,6 +823,7 @@ samples/client/petstore/scala + samples/client/petstore/scalaz samples/client/petstore/clojure samples/client/petstore/java/feign samples/client/petstore/java/jersey1 diff --git a/samples/client/petstore/scalaz/pom.xml b/samples/client/petstore/scalaz/pom.xml new file mode 100644 index 00000000000..ca10b0bfe37 --- /dev/null +++ b/samples/client/petstore/scalaz/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + io.swagger + scalaz-petstore-client + pom + 1.0-SNAPSHOT + scalaz-petstore-client + + + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + sbt-test + integration-test + + exec + + + sbt + + test + + + + + + + + From 5c14f907d699d6f8c8230f8a34048ec12cfd7095 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 16 Oct 2017 22:33:12 +0800 Subject: [PATCH 163/197] add beta to scalaz generator --- .../java/io/swagger/codegen/languages/ScalazClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 30f984464c1..3a13d269ff0 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 @@ -181,7 +181,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a Scalaz client library that uses http4s"; + return "Generates a Scalaz client library (beta) that uses http4s"; } @Override From 381acd28ea42bf6e26e158bb3c8f82961ddfcc9c Mon Sep 17 00:00:00 2001 From: Hidetake Iwata Date: Tue, 17 Oct 2017 16:45:48 +0900 Subject: [PATCH 164/197] Add http://www.nttdata.com (#6713) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 65c55c254b6..96a9d2ad0ee 100644 --- a/README.md +++ b/README.md @@ -796,6 +796,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) +- [NTT DATA](http://www.nttdata.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) From 07b408a44a4b2373b34619d5dd5c6d955d57fff0 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Tue, 17 Oct 2017 22:22:49 +0900 Subject: [PATCH 165/197] [PHP] Fix #5338: InvalidArgumentException (#6685) * Add endpoint definition which reproduces #5338 bug * Update samples * Add test case which reproduces #5338 bug * Fix "InvalidArgumentException: Invalid resource type: object" * Update samples - ./bin/php-petstore.sh - ./bin/security/php-petstore.sh --- .../src/main/resources/php/api.mustache | 8 +- ...ith-fake-endpoints-models-for-testing.yaml | 21 ++ .../php/SwaggerClient-php/lib/Api/FakeApi.php | 8 +- .../petstore/php/SwaggerClient-php/README.md | 1 + .../php/SwaggerClient-php/docs/Api/FakeApi.md | 45 +++ .../lib/Api/AnotherFakeApi.php | 8 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 283 +++++++++++++++++- .../lib/Api/FakeClassnameTags123Api.php | 8 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 64 +++- .../SwaggerClient-php/lib/Api/StoreApi.php | 32 +- .../php/SwaggerClient-php/lib/Api/UserApi.php | 64 +++- .../tests/ParametersTest.php | 10 + 12 files changed, 488 insertions(+), 64 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index a360a0e87bf..7ba928ce184 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -417,8 +417,12 @@ use {{invokerPackage}}\ObjectSerializer; // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 2510e6cc9ef..c947e95d926 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -898,6 +898,27 @@ paths: responses: '200': description: successful operation + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + consumes: + - application/json + parameters: + - name: param + in: body + description: request body + required: true + schema: + type: object + additionalProperties: + type: string + responses: + '200': + description: successful operation /another-fake/dummy: patch: tags: 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 c2e0132a490..16ad474af26 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 @@ -246,8 +246,12 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 83b6d6e01a1..087c3105f8d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -83,6 +83,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store 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 20958d97da2..845ab2f8a02 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/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 @@ -371,6 +372,50 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties($param) + +test inline additionalProperties + + + +### Example +```php +testInlineAdditionalProperties($param); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testInlineAdditionalProperties: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **object**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **testJsonFormData** > testJsonFormData($param, $param2) 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 88ca1e9271f..a5980f76cc2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -288,8 +288,12 @@ protected function testSpecialTagsRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; 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 aec0a279a83..61d4e4a3095 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -278,8 +278,12 @@ protected function fakeOuterBooleanSerializeRequest($body = null) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -520,8 +524,12 @@ protected function fakeOuterCompositeSerializeRequest($body = null) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -762,8 +770,12 @@ protected function fakeOuterNumberSerializeRequest($body = null) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1004,8 +1016,12 @@ protected function fakeOuterStringSerializeRequest($body = null) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1256,8 +1272,12 @@ protected function testClientModelRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1654,8 +1674,12 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1937,8 +1961,12 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1981,6 +2009,225 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en ); } + /** + * Operation testInlineAdditionalProperties + * + * test inline additionalProperties + * + * @param object $param request body (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testInlineAdditionalProperties($param) + { + $this->testInlineAdditionalPropertiesWithHttpInfo($param); + } + + /** + * Operation testInlineAdditionalPropertiesWithHttpInfo + * + * test inline additionalProperties + * + * @param object $param request body (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function testInlineAdditionalPropertiesWithHttpInfo($param) + { + $returnType = ''; + $request = $this->testInlineAdditionalPropertiesRequest($param); + + try { + + try { + $response = $this->client->send($request); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testInlineAdditionalPropertiesAsync + * + * test inline additionalProperties + * + * @param object $param request body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineAdditionalPropertiesAsync($param) + { + return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($param) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testInlineAdditionalPropertiesAsyncWithHttpInfo + * + * test inline additionalProperties + * + * @param object $param request body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testInlineAdditionalPropertiesAsyncWithHttpInfo($param) + { + $returnType = ''; + $request = $this->testInlineAdditionalPropertiesRequest($param); + + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testInlineAdditionalProperties' + * + * @param object $param request body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testInlineAdditionalPropertiesRequest($param) + { + // verify the required parameter 'param' is set + if ($param === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $param when calling testInlineAdditionalProperties' + ); + } + + $resourcePath = '/fake/inline-additionalProperties'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($param)) { + $_tempBody = $param; + } + + if ($multipart) { + $headers= $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation testJsonFormData * @@ -2168,8 +2415,12 @@ protected function testJsonFormDataRequest($param, $param2) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; 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 d51d3fdf215..3e306d423a3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -288,8 +288,12 @@ protected function testClassnameRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; 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 08b0596b7d5..313e0f2882d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -251,8 +251,12 @@ protected function addPetRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -484,8 +488,12 @@ protected function deletePetRequest($pet_id, $api_key = null) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -744,8 +752,12 @@ protected function findPetsByStatusRequest($status) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1004,8 +1016,12 @@ protected function findPetsByTagsRequest($tags) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1265,8 +1281,12 @@ protected function getPetByIdRequest($pet_id) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1485,8 +1505,12 @@ protected function updatePetRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1727,8 +1751,12 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -2007,8 +2035,12 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; 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 684f67f65d4..9424f62693e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -256,8 +256,12 @@ protected function deleteOrderRequest($order_id) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -494,8 +498,12 @@ protected function getInventoryRequest() // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -763,8 +771,12 @@ protected function getOrderByIdRequest($order_id) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1015,8 +1027,12 @@ protected function placeOrderRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; 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 b2517fd4479..ce31171cef1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -251,8 +251,12 @@ protected function createUserRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -466,8 +470,12 @@ protected function createUsersWithArrayInputRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -681,8 +689,12 @@ protected function createUsersWithListInputRequest($body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -901,8 +913,12 @@ protected function deleteUserRequest($username) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1158,8 +1174,12 @@ protected function getUserByNameRequest($username) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1426,8 +1446,12 @@ protected function loginUserRequest($username, $password) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1627,8 +1651,12 @@ protected function logoutUserRequest() // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -1861,8 +1889,12 @@ protected function updateUserRequest($username, $body) // for model (json/xml) if (isset($_tempBody)) { - $httpBody = $_tempBody; // $_tempBody is the method argument, if present - + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php index 25e18742ed3..37877556d01 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php @@ -45,6 +45,16 @@ public function testHeaderParamCollection() $this->assertEquals(['string1,string2'], $headers['enum_header_string_array']); } + public function testInlineAdditionalProperties() + { + $param = new \stdClass(); + $param->foo = 'bar'; + $this->fakeApi->testInlineAdditionalProperties($param); + + $request = $this->fakeHttpClient->getLastRequest(); + $this->assertSame('{"foo":"bar"}', $request->getBody()->getContents()); + } + // missing example for collection path param in config // public function testPathParamCollection() // { From 62627f20bcc9b8feedc98fb6a4901ed114e7fa5b Mon Sep 17 00:00:00 2001 From: niku Date: Tue, 17 Oct 2017 22:59:25 +0900 Subject: [PATCH 166/197] [Elixir Client]Improve elixir client typings (#6665) * [Elixir Client] Improve primitive typings * [Elixir Client] Add type to models Fix following dialyzer warnings in the sample: ``` :0: Unknown type 'Elixir.SwaggerPetstore.Model.ApiResponse':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Client':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Order':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterBoolean':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterComposite':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterNumber':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterString':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.Pet':t/0 :0: Unknown type 'Elixir.SwaggerPetstore.Model.User':t/0 ``` --- .../languages/ElixirClientCodegen.java | 94 ++++++++++++++----- .../src/main/resources/elixir/model.mustache | 5 + .../elixir/lib/swagger_petstore/api/fake.ex | 50 +++++----- .../elixir/lib/swagger_petstore/api/pet.ex | 22 ++--- .../elixir/lib/swagger_petstore/api/store.ex | 4 +- .../elixir/lib/swagger_petstore/api/user.ex | 16 ++-- .../model/additional_properties_class.ex | 5 + .../lib/swagger_petstore/model/animal.ex | 5 + .../lib/swagger_petstore/model/animal_farm.ex | 4 + .../swagger_petstore/model/api_response.ex | 6 ++ .../model/array_of_array_of_number_only.ex | 4 + .../model/array_of_number_only.ex | 4 + .../lib/swagger_petstore/model/array_test.ex | 6 ++ .../swagger_petstore/model/capitalization.ex | 9 ++ .../elixir/lib/swagger_petstore/model/cat.ex | 6 ++ .../lib/swagger_petstore/model/category.ex | 5 + .../lib/swagger_petstore/model/class_model.ex | 4 + .../lib/swagger_petstore/model/client.ex | 4 + .../elixir/lib/swagger_petstore/model/dog.ex | 6 ++ .../lib/swagger_petstore/model/enum_arrays.ex | 5 + .../lib/swagger_petstore/model/enum_class.ex | 4 + .../lib/swagger_petstore/model/enum_test.ex | 7 ++ .../lib/swagger_petstore/model/format_test.ex | 16 ++++ .../model/has_only_read_only.ex | 5 + .../lib/swagger_petstore/model/map_test.ex | 5 + ...perties_and_additional_properties_class.ex | 6 ++ .../model/model_200_response.ex | 5 + .../elixir/lib/swagger_petstore/model/name.ex | 7 ++ .../lib/swagger_petstore/model/number_only.ex | 4 + .../lib/swagger_petstore/model/order.ex | 9 ++ .../swagger_petstore/model/outer_boolean.ex | 4 + .../swagger_petstore/model/outer_composite.ex | 6 ++ .../lib/swagger_petstore/model/outer_enum.ex | 4 + .../swagger_petstore/model/outer_number.ex | 4 + .../swagger_petstore/model/outer_string.ex | 4 + .../elixir/lib/swagger_petstore/model/pet.ex | 9 ++ .../swagger_petstore/model/read_only_first.ex | 5 + .../lib/swagger_petstore/model/return.ex | 4 + .../model/special_model_name.ex | 4 + .../elixir/lib/swagger_petstore/model/tag.ex | 5 + .../elixir/lib/swagger_petstore/model/user.ex | 11 +++ 41 files changed, 320 insertions(+), 72 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java index 90677e090fb..e0a5d001459 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ElixirClientCodegen.java @@ -3,9 +3,7 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.codegen.*; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; +import io.swagger.models.properties.*; import io.swagger.models.Info; import io.swagger.models.Model; import io.swagger.models.Swagger; @@ -32,7 +30,6 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig "{:poison, \">= 1.0.0\"}" ); - public ElixirClientCodegen() { super(); @@ -420,14 +417,77 @@ public String toOperationId(String operationId) { */ @Override public String getTypeDeclaration(Property p) { + // SubClasses of AbstractProperty + // + // ArrayProperty + // MapProperty + // PasswordProperty + // StringProperty + // EmailProperty + // ByteArrayProperty + // DateProperty + // UUIDProperty + // DateTimeProperty + // ObjectProperty + // AbstractNumericProperty + // BaseIntegerProperty + // IntegerProperty + // LongProperty + // DecimalProperty + // DoubleProperty + // FloatProperty + // BinaryProperty + // BooleanProperty + // RefProperty + // FileProperty if (p instanceof ArrayProperty) { ArrayProperty ap = (ArrayProperty) p; Property inner = ap.getItems(); - return getSwaggerType(p) + "[" + getTypeDeclaration(inner) + "]"; + return "[" + getTypeDeclaration(inner) + "]"; } else if (p instanceof MapProperty) { MapProperty mp = (MapProperty) p; Property inner = mp.getAdditionalProperties(); - return getSwaggerType(p) + "[String, " + getTypeDeclaration(inner) + "]"; + return "%{optional(String.t) => " + getTypeDeclaration(inner) + "}"; + } else if (p instanceof PasswordProperty) { + return "String.t"; + } else if (p instanceof EmailProperty) { + return "String.t"; + } else if (p instanceof ByteArrayProperty) { + return "binary()"; + } else if (p instanceof StringProperty) { + return "String.t"; + } else if (p instanceof DateProperty) { + return "Date.t"; + } else if (p instanceof UUIDProperty) { + return "String.t"; + } else if (p instanceof DateTimeProperty) { + return "DateTime.t"; + } else if (p instanceof ObjectProperty) { + // How to map it? + return super.getTypeDeclaration(p); + } else if (p instanceof IntegerProperty) { + return "integer()"; + } else if (p instanceof LongProperty) { + return "integer()"; + } else if (p instanceof BaseIntegerProperty) { + return "integer()"; + } else if (p instanceof DoubleProperty) { + return "float()"; + } else if (p instanceof FloatProperty) { + return "float()"; + } else if (p instanceof DecimalProperty) { + return "float()"; + } else if (p instanceof AbstractNumericProperty) { + return "number()"; + } else if (p instanceof BinaryProperty) { + return "binary()"; + } else if (p instanceof BooleanProperty) { + return "boolean()"; + } else if (p instanceof RefProperty) { + // How to map it? + return super.getTypeDeclaration(p); + } else if (p instanceof FileProperty) { + return "String.t"; } return super.getTypeDeclaration(p); } @@ -590,26 +650,8 @@ private void buildTypespec(CodegenParameter param, StringBuilder sb) { buildTypespec(param.items, sb); sb.append("}"); } else if (param.isPrimitiveType) { - // () OR .t - - // Primitive types in Elixir - // https://hexdocs.pm/elixir/1.5.2/typespecs.html#types-and-their-syntax - // - // NOTE: List, Tuple and Map are declared as primitive in a variable `languageSpecificPrimitives`. - HashMap map = new HashMap(); - map.put("Integer", "integer()"); - map.put("Float", "float()"); - map.put("Boolean", "boolean()"); - map.put("String", "String.t"); - map.put("List", "list()"); - map.put("Atom", "atom()"); - map.put("Map", "map()"); - map.put("Tuple", "tuple()"); - map.put("PID", "pid()"); - map.put("DateTime", "DateTime.t"); - - String dataType = (String) map.get(param.dataType); - sb.append(dataType); + // like `integer()`, `String.t` + sb.append(param.dataType); } else if (param.isFile) { sb.append("String.t"); } else { diff --git a/modules/swagger-codegen/src/main/resources/elixir/model.mustache b/modules/swagger-codegen/src/main/resources/elixir/model.mustache index 36b4458399b..ea43f78e0fc 100644 --- a/modules/swagger-codegen/src/main/resources/elixir/model.mustache +++ b/modules/swagger-codegen/src/main/resources/elixir/model.mustache @@ -9,6 +9,11 @@ {{#vars}}:"{{baseName}}"{{#hasMore}}, {{/hasMore}}{{/vars}} ] + + @type t :: %__MODULE__{ + {{#vars}}:"{{baseName}}" => {{{datatype}}}{{#hasMore}}, + {{/hasMore}}{{/vars}} + } end defimpl Poison.Decoder, for: {{moduleName}}.Model.{{classname}} do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index 1cc31a0764e..e25a05c4fb0 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -156,28 +156,28 @@ defmodule SwaggerPetstore.Api.Fake do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - number (Float): None - - double (Float): None - - pattern_without_delimiter (String): None - - byte (String): None + - number (float()): None + - double (float()): None + - pattern_without_delimiter (String.t): None + - byte (binary()): None - opts (KeywordList): [optional] Optional parameters - - :integer (Integer): None - - :int32 (Integer): None - - :int64 (Integer): None - - :float (Float): None - - :string (String): None - - :binary (String): None - - :date (DateTime): None - - :date_time (DateTime): None - - :password (String): None - - :callback (String): None + - :integer (integer()): None + - :int32 (integer()): None + - :int64 (integer()): None + - :float (float()): None + - :string (String.t): None + - :binary (binary()): None + - :date (Date.t): None + - :date_time (DateTime.t): None + - :password (String.t): None + - :callback (String.t): None ## Returns {:ok, %{}} on success {:error, info} on failure """ - @spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + @spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, binary(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do optional_params = %{ :"integer" => :form, @@ -212,14 +212,14 @@ defmodule SwaggerPetstore.Api.Fake do - connection (SwaggerPetstore.Connection): Connection to server - opts (KeywordList): [optional] Optional parameters - - :enum_form_string_array (List[String]): Form parameter enum test (string array) - - :enum_form_string (String): Form parameter enum test (string) - - :enum_header_string_array (List[String]): Header parameter enum test (string array) - - :enum_header_string (String): Header parameter enum test (string) - - :enum_query_string_array (List[String]): Query parameter enum test (string array) - - :enum_query_string (String): Query parameter enum test (string) - - :enum_query_integer (Integer): Query parameter enum test (double) - - :enum_query_double (Float): Query parameter enum test (double) + - :enum_form_string_array ([String.t]): Form parameter enum test (string array) + - :enum_form_string (String.t): Form parameter enum test (string) + - :enum_header_string_array ([String.t]): Header parameter enum test (string array) + - :enum_header_string (String.t): Header parameter enum test (string) + - :enum_query_string_array ([String.t]): Query parameter enum test (string array) + - :enum_query_string (String.t): Query parameter enum test (string) + - :enum_query_integer (integer()): Query parameter enum test (double) + - :enum_query_double (float()): Query parameter enum test (double) ## Returns @@ -254,8 +254,8 @@ defmodule SwaggerPetstore.Api.Fake do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - param (String): field1 - - param2 (String): field2 + - param (String.t): field1 + - param2 (String.t): field2 - opts (KeywordList): [optional] Optional parameters ## Returns diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex index 35024beef37..035ad7c8cb1 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/pet.ex @@ -44,9 +44,9 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - pet_id (Integer): Pet id to delete + - pet_id (integer()): Pet id to delete - opts (KeywordList): [optional] Optional parameters - - :api_key (String): + - :api_key (String.t): ## Returns @@ -74,7 +74,7 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - status (List[String]): Status values that need to be considered for filter + - status ([String.t]): Status values that need to be considered for filter - opts (KeywordList): [optional] Optional parameters ## Returns @@ -100,7 +100,7 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - tags (List[String]): Tags to filter by + - tags ([String.t]): Tags to filter by - opts (KeywordList): [optional] Optional parameters ## Returns @@ -126,7 +126,7 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - pet_id (Integer): ID of pet to return + - pet_id (integer()): ID of pet to return - opts (KeywordList): [optional] Optional parameters ## Returns @@ -177,10 +177,10 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - pet_id (Integer): ID of pet that needs to be updated + - pet_id (integer()): ID of pet that needs to be updated - opts (KeywordList): [optional] Optional parameters - - :name (String): Updated name of the pet - - :status (String): Updated status of the pet + - :name (String.t): Updated name of the pet + - :status (String.t): Updated status of the pet ## Returns @@ -209,10 +209,10 @@ defmodule SwaggerPetstore.Api.Pet do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - pet_id (Integer): ID of pet to update + - pet_id (integer()): ID of pet to update - opts (KeywordList): [optional] Optional parameters - - :additional_metadata (String): Additional data to pass to server - - :file (String): file to upload + - :additional_metadata (String.t): Additional data to pass to server + - :file (String.t): file to upload ## Returns diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex index 4ef2cfd3798..f604ecd82e7 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/store.ex @@ -18,7 +18,7 @@ defmodule SwaggerPetstore.Api.Store do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - order_id (String): ID of the order that needs to be deleted + - order_id (String.t): ID of the order that needs to be deleted - opts (KeywordList): [optional] Optional parameters ## Returns @@ -67,7 +67,7 @@ defmodule SwaggerPetstore.Api.Store do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - order_id (Integer): ID of pet that needs to be fetched + - order_id (integer()): ID of pet that needs to be fetched - opts (KeywordList): [optional] Optional parameters ## Returns diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex index b84c5ed51c2..cdcadfbea96 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/user.ex @@ -44,7 +44,7 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - body (List[User]): List of user object + - body ([User]): List of user object - opts (KeywordList): [optional] Optional parameters ## Returns @@ -70,7 +70,7 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - body (List[User]): List of user object + - body ([User]): List of user object - opts (KeywordList): [optional] Optional parameters ## Returns @@ -96,7 +96,7 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - username (String): The name that needs to be deleted + - username (String.t): The name that needs to be deleted - opts (KeywordList): [optional] Optional parameters ## Returns @@ -121,7 +121,7 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - username (String): The name that needs to be fetched. Use user1 for testing. + - username (String.t): The name that needs to be fetched. Use user1 for testing. - opts (KeywordList): [optional] Optional parameters ## Returns @@ -146,13 +146,13 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - username (String): The user name for login - - password (String): The password for login in clear text + - username (String.t): The user name for login + - password (String.t): The password for login in clear text - opts (KeywordList): [optional] Optional parameters ## Returns - {:ok, %SwaggerPetstore.Model.String{}} on success + {:ok, %SwaggerPetstore.Model.String.t{}} on success {:error, info} on failure """ @spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} @@ -198,7 +198,7 @@ defmodule SwaggerPetstore.Api.User do ## Parameters - connection (SwaggerPetstore.Connection): Connection to server - - username (String): name that need to be deleted + - username (String.t): name that need to be deleted - body (User): Updated user object - opts (KeywordList): [optional] Optional parameters diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex index cb61ee1b8b6..d2b5f44716b 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/additional_properties_class.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.AdditionalPropertiesClass do :"map_property", :"map_of_map_property" ] + + @type t :: %__MODULE__{ + :"map_property" => %{optional(String.t) => String.t}, + :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.AdditionalPropertiesClass do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex index a10f7e3446b..2e12d720311 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.Animal do :"className", :"color" ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Animal do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex index 571ff494530..322f16e6d4b 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/animal_farm.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.AnimalFarm do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.AnimalFarm do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex index 70f16c4ad7a..9ffda2b8c8a 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/api_response.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.ApiResponse do :"type", :"message" ] + + @type t :: %__MODULE__{ + :"code" => integer(), + :"type" => String.t, + :"message" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ApiResponse do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex index b5997b7f146..09b3e635a71 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_array_of_number_only.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.ArrayOfArrayOfNumberOnly do defstruct [ :"ArrayArrayNumber" ] + + @type t :: %__MODULE__{ + :"ArrayArrayNumber" => [[float()]] + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayOfArrayOfNumberOnly do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex index d33b4eb053c..f9c017f4be3 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_of_number_only.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.ArrayOfNumberOnly do defstruct [ :"ArrayNumber" ] + + @type t :: %__MODULE__{ + :"ArrayNumber" => [float()] + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayOfNumberOnly do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex index a04accd186a..d466a46f41d 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/array_test.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.ArrayTest do :"array_array_of_integer", :"array_array_of_model" ] + + @type t :: %__MODULE__{ + :"array_of_string" => [String.t], + :"array_array_of_integer" => [[integer()]], + :"array_array_of_model" => [[ReadOnlyFirst]] + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ArrayTest do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex index c51c313491c..062ac324923 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/capitalization.ex @@ -16,6 +16,15 @@ defmodule SwaggerPetstore.Model.Capitalization do :"SCA_ETH_Flow_Points", :"ATT_NAME" ] + + @type t :: %__MODULE__{ + :"smallCamel" => String.t, + :"CapitalCamel" => String.t, + :"small_Snake" => String.t, + :"Capital_Snake" => String.t, + :"SCA_ETH_Flow_Points" => String.t, + :"ATT_NAME" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Capitalization do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex index 4e150aa8422..20862cc4925 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/cat.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.Cat do :"color", :"declawed" ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t, + :"declawed" => boolean() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Cat do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex index 80aa58551a0..bbfefb6587c 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/category.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.Category do :"id", :"name" ] + + @type t :: %__MODULE__{ + :"id" => integer(), + :"name" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Category do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex index 5c3e7fb18eb..9410a44a94b 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/class_model.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.ClassModel do defstruct [ :"_class" ] + + @type t :: %__MODULE__{ + :"_class" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ClassModel do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex index 779bb7434b3..41875206b35 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/client.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.Client do defstruct [ :"client" ] + + @type t :: %__MODULE__{ + :"client" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Client do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex index 6ca69ec1af3..519e3a3bd4d 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/dog.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.Dog do :"color", :"breed" ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t, + :"breed" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Dog do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex index 3518b690924..baf424abaa1 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_arrays.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.EnumArrays do :"just_symbol", :"array_enum" ] + + @type t :: %__MODULE__{ + :"just_symbol" => String.t, + :"array_enum" => [String.t] + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumArrays do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex index cbd77d49053..e1f1c0029a8 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_class.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.EnumClass do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumClass do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex index efbc5dc8a12..0752b16e203 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/enum_test.ex @@ -14,6 +14,13 @@ defmodule SwaggerPetstore.Model.EnumTest do :"enum_number", :"outerEnum" ] + + @type t :: %__MODULE__{ + :"enum_string" => String.t, + :"enum_integer" => integer(), + :"enum_number" => float(), + :"outerEnum" => OuterEnum + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.EnumTest do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex index b612b5074c1..4d271718a14 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/format_test.ex @@ -23,6 +23,22 @@ defmodule SwaggerPetstore.Model.FormatTest do :"uuid", :"password" ] + + @type t :: %__MODULE__{ + :"integer" => integer(), + :"int32" => integer(), + :"int64" => integer(), + :"number" => float(), + :"float" => float(), + :"double" => float(), + :"string" => String.t, + :"byte" => binary(), + :"binary" => binary(), + :"date" => Date.t, + :"dateTime" => DateTime.t, + :"uuid" => String.t, + :"password" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.FormatTest do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex index f8f7a7d0b84..8af87de21b8 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/has_only_read_only.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.HasOnlyReadOnly do :"bar", :"foo" ] + + @type t :: %__MODULE__{ + :"bar" => String.t, + :"foo" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.HasOnlyReadOnly do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex index 59f2f0abe82..f8f1f15a159 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/map_test.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.MapTest do :"map_map_of_string", :"map_of_enum_string" ] + + @type t :: %__MODULE__{ + :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}}, + :"map_of_enum_string" => %{optional(String.t) => String.t} + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.MapTest do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex index f7cafcbab77..247f5fb1e56 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do :"dateTime", :"map" ] + + @type t :: %__MODULE__{ + :"uuid" => String.t, + :"dateTime" => DateTime.t, + :"map" => %{optional(String.t) => Animal} + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex index 0da12bc564e..32f64cbf37f 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/model_200_response.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.Model200Response do :"name", :"class" ] + + @type t :: %__MODULE__{ + :"name" => integer(), + :"class" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Model200Response do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex index 240ab5d51ab..07ed6555afa 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/name.ex @@ -14,6 +14,13 @@ defmodule SwaggerPetstore.Model.Name do :"property", :"123Number" ] + + @type t :: %__MODULE__{ + :"name" => integer(), + :"snake_case" => integer(), + :"property" => String.t, + :"123Number" => integer() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Name do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex index 75370482465..d924868e520 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/number_only.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.NumberOnly do defstruct [ :"JustNumber" ] + + @type t :: %__MODULE__{ + :"JustNumber" => float() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.NumberOnly do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex index f14a628b4cc..a91dd8dfa0d 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/order.ex @@ -16,6 +16,15 @@ defmodule SwaggerPetstore.Model.Order do :"status", :"complete" ] + + @type t :: %__MODULE__{ + :"id" => integer(), + :"petId" => integer(), + :"quantity" => integer(), + :"shipDate" => DateTime.t, + :"status" => String.t, + :"complete" => boolean() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Order do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex index 07d213b812c..67ae2d5b74d 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_boolean.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.OuterBoolean do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterBoolean do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex index 19f1086a014..3771cc731dc 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_composite.ex @@ -13,6 +13,12 @@ defmodule SwaggerPetstore.Model.OuterComposite do :"my_string", :"my_boolean" ] + + @type t :: %__MODULE__{ + :"my_number" => OuterNumber, + :"my_string" => OuterString, + :"my_boolean" => OuterBoolean + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterComposite do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex index df5c95fdcd3..58831c6f1ef 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_enum.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.OuterEnum do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterEnum do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex index 67defe1580e..d2f4e4957bb 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_number.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.OuterNumber do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterNumber do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex index 223c970d7bb..c610adfe7e9 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/outer_string.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.OuterString do defstruct [ ] + + @type t :: %__MODULE__{ + + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.OuterString do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex index c6a5542cbb7..abb240c6eea 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/pet.ex @@ -16,6 +16,15 @@ defmodule SwaggerPetstore.Model.Pet do :"tags", :"status" ] + + @type t :: %__MODULE__{ + :"id" => integer(), + :"category" => Category, + :"name" => String.t, + :"photoUrls" => [String.t], + :"tags" => [Tag], + :"status" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Pet do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex index bc0be16b863..2e41baa2442 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/read_only_first.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.ReadOnlyFirst do :"bar", :"baz" ] + + @type t :: %__MODULE__{ + :"bar" => String.t, + :"baz" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.ReadOnlyFirst do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex index 03b1e0d15f9..338325e73ef 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/return.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.Return do defstruct [ :"return" ] + + @type t :: %__MODULE__{ + :"return" => integer() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Return do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex index 0179846711e..03acfc69d24 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/special_model_name.ex @@ -11,6 +11,10 @@ defmodule SwaggerPetstore.Model.SpecialModelName do defstruct [ :"$special[property.name]" ] + + @type t :: %__MODULE__{ + :"$special[property.name]" => integer() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.SpecialModelName do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex index 6f323cfb601..f019b2f8a9a 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/tag.ex @@ -12,6 +12,11 @@ defmodule SwaggerPetstore.Model.Tag do :"id", :"name" ] + + @type t :: %__MODULE__{ + :"id" => integer(), + :"name" => String.t + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.Tag do diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex index ff634f44bbb..b568be8a563 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/model/user.ex @@ -18,6 +18,17 @@ defmodule SwaggerPetstore.Model.User do :"phone", :"userStatus" ] + + @type t :: %__MODULE__{ + :"id" => integer(), + :"username" => String.t, + :"firstName" => String.t, + :"lastName" => String.t, + :"email" => String.t, + :"password" => String.t, + :"phone" => String.t, + :"userStatus" => integer() + } end defimpl Poison.Decoder, for: SwaggerPetstore.Model.User do From 5143fb58a4c854c9c3da3dd47a4d89f2473a13ca Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 17 Oct 2017 22:31:06 +0800 Subject: [PATCH 167/197] revise go header, minor formatting fix (#6695) --- .../src/main/resources/go/api.mustache | 30 ++-- .../main/resources/go/partial_header.mustache | 10 +- .../additional_properties_class.go | 4 +- .../client/petstore/go/go-petstore/animal.go | 4 +- .../petstore/go/go-petstore/animal_farm.go | 4 +- .../go/go-petstore/another_fake_api.go | 22 +-- .../petstore/go/go-petstore/api_client.go | 4 +- .../petstore/go/go-petstore/api_response.go | 4 +- .../array_of_array_of_number_only.go | 4 +- .../go/go-petstore/array_of_number_only.go | 4 +- .../petstore/go/go-petstore/array_test.go | 4 +- .../petstore/go/go-petstore/capitalization.go | 4 +- samples/client/petstore/go/go-petstore/cat.go | 4 +- .../petstore/go/go-petstore/category.go | 4 +- .../petstore/go/go-petstore/class_model.go | 4 +- .../client/petstore/go/go-petstore/client.go | 4 +- .../petstore/go/go-petstore/configuration.go | 4 +- samples/client/petstore/go/go-petstore/dog.go | 4 +- .../petstore/go/go-petstore/enum_arrays.go | 4 +- .../petstore/go/go-petstore/enum_class.go | 4 +- .../petstore/go/go-petstore/enum_test.go | 4 +- .../petstore/go/go-petstore/fake_api.go | 144 +++++++++--------- .../go-petstore/fake_classname_tags123_api.go | 22 +-- .../petstore/go/go-petstore/format_test.go | 4 +- .../go/go-petstore/has_only_read_only.go | 4 +- .../client/petstore/go/go-petstore/list.go | 4 +- .../petstore/go/go-petstore/map_test.go | 4 +- ...perties_and_additional_properties_class.go | 4 +- .../go/go-petstore/model_200_response.go | 4 +- .../go/go-petstore/model_api_response.go | 4 +- .../petstore/go/go-petstore/model_return.go | 4 +- .../client/petstore/go/go-petstore/name.go | 4 +- .../petstore/go/go-petstore/number_only.go | 4 +- .../client/petstore/go/go-petstore/order.go | 4 +- .../petstore/go/go-petstore/outer_boolean.go | 4 +- .../go/go-petstore/outer_composite.go | 4 +- .../petstore/go/go-petstore/outer_enum.go | 4 +- .../petstore/go/go-petstore/outer_number.go | 4 +- .../petstore/go/go-petstore/outer_string.go | 4 +- samples/client/petstore/go/go-petstore/pet.go | 4 +- .../client/petstore/go/go-petstore/pet_api.go | 132 ++++++++-------- .../go/go-petstore/read_only_first.go | 4 +- .../go/go-petstore/special_model_name.go | 4 +- .../petstore/go/go-petstore/store_api.go | 76 ++++----- samples/client/petstore/go/go-petstore/tag.go | 4 +- .../client/petstore/go/go-petstore/user.go | 4 +- .../petstore/go/go-petstore/user_api.go | 124 +++++++-------- 47 files changed, 360 insertions(+), 356 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index 57c07808b4e..d061aef0cf6 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -57,22 +57,22 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{#required}} {{#minItems}} if len({{paramName}}) < {{minItems}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") } {{/minItems}} {{#maxItems}} if len({{paramName}}) > {{maxItems}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") } {{/maxItems}} {{#minLength}} if strlen({{paramName}}) < {{minLength}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") } {{/minLength}} {{#maxLength}} if strlen({{paramName}}) > {{maxLength}} { - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") } {{/maxLength}} {{#minimum}} @@ -83,7 +83,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{^isString}} if {{paramName}} < {{minimum}} { {{/isString}} - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") } {{/minimum}} {{#maximum}} @@ -94,7 +94,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C {{^isString}} if {{paramName}} > {{maximum}} { {{/isString}} - return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") + return {{#returnType}}successPayload, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") } {{/maximum}} {{/required}} @@ -206,18 +206,18 @@ func (a *{{{classname}}}Service) {{{nickname}}}({{#hasAuthMethods}}ctx context.C return {{#returnType}}successPayload, {{/returnType}}nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } {{#returnType}} - + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err + return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err } {{/returnType}} diff --git a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache index 83edccca9b2..d24dfec369d 100644 --- a/modules/swagger-codegen/src/main/resources/go/partial_header.mustache +++ b/modules/swagger-codegen/src/main/resources/go/partial_header.mustache @@ -7,7 +7,11 @@ * {{{appDescription}}} * {{/appDescription}} - * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} - * Generated by: https://github.com/swagger-api/swagger-codegen.git + {{#version}} + * API version: {{{version}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{infoEmail}}} + {{/infoEmail}} + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ 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 638857fb25f..ff018d60e14 100644 --- a/samples/client/petstore/go/go-petstore/additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/additional_properties_class.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/animal.go b/samples/client/petstore/go/go-petstore/animal.go index 40b5778704b..4ae6c33a58a 100644 --- a/samples/client/petstore/go/go-petstore/animal.go +++ b/samples/client/petstore/go/go-petstore/animal.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/animal_farm.go b/samples/client/petstore/go/go-petstore/animal_farm.go index 6b872ea1c42..5314c78829c 100644 --- a/samples/client/petstore/go/go-petstore/animal_farm.go +++ b/samples/client/petstore/go/go-petstore/animal_farm.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 5eb37c217fc..5dc5f833707 100644 --- a/samples/client/petstore/go/go-petstore/another_fake_api.go +++ b/samples/client/petstore/go/go-petstore/another_fake_api.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -74,17 +74,17 @@ func (a *AnotherFakeApiService) TestSpecialTags(body Client) (Client, *http.Res return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - 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 798424db7e6..cb3c1683c53 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index 03c6528380b..2e6e99e3e72 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 c268522aa9c..2ea01100c1b 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 @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 f04e5a2be6f..af7ceb14160 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 @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/array_test.go b/samples/client/petstore/go/go-petstore/array_test.go index bbb667e88b0..1b7a9a8a170 100644 --- a/samples/client/petstore/go/go-petstore/array_test.go +++ b/samples/client/petstore/go/go-petstore/array_test.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/capitalization.go b/samples/client/petstore/go/go-petstore/capitalization.go index 7e3f1910179..399f39b12b2 100644 --- a/samples/client/petstore/go/go-petstore/capitalization.go +++ b/samples/client/petstore/go/go-petstore/capitalization.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/cat.go b/samples/client/petstore/go/go-petstore/cat.go index a9192b03c7c..ac2e7e72db7 100644 --- a/samples/client/petstore/go/go-petstore/cat.go +++ b/samples/client/petstore/go/go-petstore/cat.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index 5dace4961ff..20d3921d22c 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/class_model.go b/samples/client/petstore/go/go-petstore/class_model.go index 2a01b0265ab..7982d3482c0 100644 --- a/samples/client/petstore/go/go-petstore/class_model.go +++ b/samples/client/petstore/go/go-petstore/class_model.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index e9331f3cd42..1053b95cecd 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index cd828fc90ca..2d1fb5427b4 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/dog.go b/samples/client/petstore/go/go-petstore/dog.go index 700c407d484..ae45406c754 100644 --- a/samples/client/petstore/go/go-petstore/dog.go +++ b/samples/client/petstore/go/go-petstore/dog.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_arrays.go b/samples/client/petstore/go/go-petstore/enum_arrays.go index 7dcf60043d3..0ff0813a1d2 100644 --- a/samples/client/petstore/go/go-petstore/enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/enum_arrays.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_class.go b/samples/client/petstore/go/go-petstore/enum_class.go index f96897cbd0a..4950a03e747 100644 --- a/samples/client/petstore/go/go-petstore/enum_class.go +++ b/samples/client/petstore/go/go-petstore/enum_class.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/enum_test.go b/samples/client/petstore/go/go-petstore/enum_test.go index bd547952198..58e4ea6a746 100644 --- a/samples/client/petstore/go/go-petstore/enum_test.go +++ b/samples/client/petstore/go/go-petstore/enum_test.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index 8dbceb67737..fff05137487 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -77,17 +77,17 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(localVarOptionals map[string] return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -144,17 +144,17 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(localVarOptionals map[strin return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -211,17 +211,17 @@ func (a *FakeApiService) FakeOuterNumberSerialize(localVarOptionals map[string]i return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -278,17 +278,17 @@ func (a *FakeApiService) FakeOuterStringSerialize(localVarOptionals map[string]i return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -343,17 +343,17 @@ func (a *FakeApiService) TestClientModel(body Client) (Client, *http.Response, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -395,16 +395,16 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarFormParams := url.Values{} if number < 32.1 { - return nil, reportError("number must be greater than 32.1") + return nil, reportError("number must be greater than 32.1") } if number > 543.2 { - return nil, reportError("number must be less than 543.2") + return nil, reportError("number must be less than 543.2") } if double < 67.8 { - return nil, reportError("double must be greater than 67.8") + return nil, reportError("double must be greater than 67.8") } if double > 123.4 { - return nil, reportError("double must be less than 123.4") + return nil, reportError("double must be less than 123.4") } if err := typeCheckParameter(localVarOptionals["integer"], "int32", "integer"); err != nil { return nil, err @@ -496,14 +496,14 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -600,14 +600,14 @@ func (a *FakeApiService) TestEnumParameters(localVarOptionals map[string]interfa return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -659,14 +659,14 @@ func (a *FakeApiService) TestJsonFormData(param string, param2 string) ( *http.R return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } 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 e159a49d4ac..d306797bfa0 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 @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -85,17 +85,17 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - 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 9ced730ad6d..b8bcb738fd6 100644 --- a/samples/client/petstore/go/go-petstore/format_test.go +++ b/samples/client/petstore/go/go-petstore/format_test.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 4ac6a1237a9..a9231320059 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 @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/list.go b/samples/client/petstore/go/go-petstore/list.go index c52e011d665..1d4033a09c0 100644 --- a/samples/client/petstore/go/go-petstore/list.go +++ b/samples/client/petstore/go/go-petstore/list.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/map_test.go b/samples/client/petstore/go/go-petstore/map_test.go index ede75865a72..c94c171040a 100644 --- a/samples/client/petstore/go/go-petstore/map_test.go +++ b/samples/client/petstore/go/go-petstore/map_test.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 ca571af65be..ea21910e4ee 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 @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 a596e8bd73b..ab8f557f377 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 603e2c92750..2ca2e3c8160 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index b6c387f4bce..b2cfff1d727 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/name.go b/samples/client/petstore/go/go-petstore/name.go index 0aa3a8c4b04..c4d3cd5a099 100644 --- a/samples/client/petstore/go/go-petstore/name.go +++ b/samples/client/petstore/go/go-petstore/name.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/number_only.go b/samples/client/petstore/go/go-petstore/number_only.go index 23a4c82d235..3c5adb8ba79 100644 --- a/samples/client/petstore/go/go-petstore/number_only.go +++ b/samples/client/petstore/go/go-petstore/number_only.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index 55c9cfd7898..8e6f48e265a 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_boolean.go b/samples/client/petstore/go/go-petstore/outer_boolean.go index 07b1230bfd9..dc9ceb0c67e 100644 --- a/samples/client/petstore/go/go-petstore/outer_boolean.go +++ b/samples/client/petstore/go/go-petstore/outer_boolean.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/outer_composite.go index db0ccece4b5..3b40bfc5b52 100644 --- a/samples/client/petstore/go/go-petstore/outer_composite.go +++ b/samples/client/petstore/go/go-petstore/outer_composite.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_enum.go b/samples/client/petstore/go/go-petstore/outer_enum.go index 569b3ecaafa..0e724d17c5c 100644 --- a/samples/client/petstore/go/go-petstore/outer_enum.go +++ b/samples/client/petstore/go/go-petstore/outer_enum.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_number.go b/samples/client/petstore/go/go-petstore/outer_number.go index c5d68320690..75aad986c34 100644 --- a/samples/client/petstore/go/go-petstore/outer_number.go +++ b/samples/client/petstore/go/go-petstore/outer_number.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/outer_string.go b/samples/client/petstore/go/go-petstore/outer_string.go index eeab75cd96c..f2a440337bd 100644 --- a/samples/client/petstore/go/go-petstore/outer_string.go +++ b/samples/client/petstore/go/go-petstore/outer_string.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index cf12df89663..11bf78166c5 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index ae565a8f511..bad7545d144 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -77,14 +77,14 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -144,14 +144,14 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -204,17 +204,17 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -269,17 +269,17 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -346,17 +346,17 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *htt return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -411,14 +411,14 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Respons return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -485,14 +485,14 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -563,17 +563,17 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - 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 ef235fe459f..ec46cccb099 100644 --- a/samples/client/petstore/go/go-petstore/read_only_first.go +++ b/samples/client/petstore/go/go-petstore/read_only_first.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore 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 b14a0d7f234..46f51fab939 100644 --- a/samples/client/petstore/go/go-petstore/special_model_name.go +++ b/samples/client/petstore/go/go-petstore/special_model_name.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index eaf6ea785cd..85b2f6900a0 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -74,14 +74,14 @@ func (a *StoreApiService) DeleteOrder(orderId string) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -143,17 +143,17 @@ func (a *StoreApiService) GetInventory(ctx context.Context, ) (map[string]int32, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -183,10 +183,10 @@ func (a *StoreApiService) GetOrderById(orderId int64) (Order, *http.Response, e localVarFormParams := url.Values{} if orderId < 1 { - return successPayload, nil, reportError("orderId must be greater than 1") + return successPayload, nil, reportError("orderId must be greater than 1") } if orderId > 5 { - return successPayload, nil, reportError("orderId must be less than 5") + return successPayload, nil, reportError("orderId must be less than 5") } // to determine the Content-Type header @@ -214,17 +214,17 @@ func (a *StoreApiService) GetOrderById(orderId int64) (Order, *http.Response, e return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -280,17 +280,17 @@ func (a *StoreApiService) PlaceOrder(body Order) (Order, *http.Response, error) return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - 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 2597fbd379b..4c0c279e41c 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 739a5f5bf40..6577365f61c 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index a2e37d35dbf..49b2e925558 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -3,9 +3,9 @@ * * 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: 1.0.0 + * API version: 1.0.0 * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package petstore @@ -75,14 +75,14 @@ func (a *UserApiService) CreateUser(body User) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -135,14 +135,14 @@ func (a *UserApiService) CreateUsersWithArrayInput(body []User) ( *http.Response return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -195,14 +195,14 @@ func (a *UserApiService) CreateUsersWithListInput(body []User) ( *http.Response, return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -254,14 +254,14 @@ func (a *UserApiService) DeleteUser(username string) ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -314,17 +314,17 @@ func (a *UserApiService) GetUserByName(username string) (User, *http.Response, return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -381,17 +381,17 @@ func (a *UserApiService) LoginUser(username string, password string) (string, * return successPayload, nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) - } - + } + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err + return successPayload, localVarHttpResponse, err } @@ -443,14 +443,14 @@ func (a *UserApiService) LogoutUser() ( *http.Response, error) { return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } @@ -505,14 +505,14 @@ func (a *UserApiService) UpdateUser(username string, body User) ( *http.Response return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } return localVarHttpResponse, err } From abe1be1a14fff193c7322c0b4f23aadc60435a4e Mon Sep 17 00:00:00 2001 From: Giacomo Date: Tue, 17 Oct 2017 16:51:37 +0200 Subject: [PATCH 168/197] JAXRS-SPEC: fix container return type (#6659) * JAXRS-SPEC: fix container return type * Run ./bin/jaxrs-spec-petstore-server.sh ./bin/jaxrs-spec-petstore-server-interface.sh --- .../JavaJaxRS/spec/apiInterface.mustache | 2 +- .../JavaJaxRS/spec/returnTypeInterface.mustache | 2 +- .../gen/java/io/swagger/api/AnotherFakeApi.java | 2 +- .../src/gen/java/io/swagger/api/FakeApi.java | 16 ++++++++-------- .../io/swagger/api/FakeClassnameTestApi.java | 2 +- .../src/gen/java/io/swagger/api/PetApi.java | 16 ++++++++-------- .../src/gen/java/io/swagger/api/StoreApi.java | 8 ++++---- .../src/gen/java/io/swagger/api/UserApi.java | 16 ++++++++-------- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache index 6d786768986..f0ad70a40ec 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -11,4 +11,4 @@ }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{#hasMore}}, {{/hasMore}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{#hasMore}},{{/hasMore}}{{/responses}} }) - {{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}); \ No newline at end of file + {{>returnTypeInterface}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) throws Exception; \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache index b317e750c56..1bfa056f0c1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/returnTypeInterface.mustache @@ -1 +1 @@ -{{#returnContainer}}{{{returnContainer}}}<{{/returnContainer}}{{{returnType}}}{{#returnContainer}}>{{/returnContainer}} \ No newline at end of file +{{{returnType}}} \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java index c0359617b45..9cf02d621bc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -23,5 +23,5 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", notes = "To test special tags", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testSpecialTags(@Valid Client body); + Client testSpecialTags(@Valid Client body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java index cc205a1d9b9..e9c28d5da5f 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeApi.java @@ -25,28 +25,28 @@ public interface FakeApi { @ApiOperation(value = "", notes = "Test serialization of outer boolean types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + Boolean fakeOuterBooleanSerialize(@Valid Boolean body) throws Exception; @POST @Path("/outer/composite") @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body); + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite body) throws Exception; @POST @Path("/outer/number") @ApiOperation(value = "", notes = "Test serialization of outer number types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body) throws Exception; @POST @Path("/outer/string") @ApiOperation(value = "", notes = "Test serialization of outer string types", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output string", response = String.class) }) - String fakeOuterStringSerialize(@Valid String body); + String fakeOuterStringSerialize(@Valid String body) throws Exception; @PATCH @Consumes({ "application/json" }) @@ -54,7 +54,7 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClientModel(@Valid Client body); + Client testClientModel(@Valid Client body) throws Exception; @POST @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @@ -65,7 +65,7 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback); + void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string,@FormParam(value = "binary") byte[] binary,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") Date dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) throws Exception; @GET @Consumes({ "*/*" }) @@ -74,7 +74,7 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble); + void testEnumParameters(@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString,@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@FormParam(value = "enum_query_double") Double enumQueryDouble) throws Exception; @GET @Path("/jsonFormData") @@ -82,5 +82,5 @@ public interface FakeApi { @ApiOperation(value = "test json serialization of form data", notes = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java index 710ea4c9b90..7a1df7ea2e2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/FakeClassnameTestApi.java @@ -24,5 +24,5 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Client testClassname(@Valid Client body); + Client testClassname(@Valid Client body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java index bd166d62b7f..271d68edbdc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void addPet(@Valid Pet body); + void addPet(@Valid Pet body) throws Exception; @DELETE @Path("/{petId}") @@ -42,7 +42,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) throws Exception; @GET @Path("/findByStatus") @@ -56,7 +56,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - List> findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + List findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status) throws Exception; @GET @Path("/findByTags") @@ -70,7 +70,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - List> findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + List findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) throws Exception; @GET @Path("/{petId}") @@ -82,7 +82,7 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) - Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId); + Pet getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId) throws Exception; @PUT @Consumes({ "application/json", "application/xml" }) @@ -97,7 +97,7 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - void updatePet(@Valid Pet body); + void updatePet(@Valid Pet body) throws Exception; @POST @Path("/{petId}") @@ -111,7 +111,7 @@ public interface PetApi { }, tags={ "pet", }) @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status); + void updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) throws Exception; @POST @Path("/{petId}/uploadImage") @@ -126,5 +126,5 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail); + @FormParam(value = "file") Attachment fileDetail) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java index ffa77a6cdc6..194e30dd955 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/StoreApi.java @@ -24,7 +24,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId); + void deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId) throws Exception; @GET @Path("/inventory") @@ -34,7 +34,7 @@ public interface StoreApi { }, tags={ "store", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - Map> getInventory(); + Map getInventory() throws Exception; @GET @Path("/order/{order_id}") @@ -44,7 +44,7 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) - Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId); + Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) @ApiParam("ID of pet that needs to be fetched") Long orderId) throws Exception; @POST @Path("/order") @@ -53,5 +53,5 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Order placeOrder(@Valid Order body); + Order placeOrder(@Valid Order body) throws Exception; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java index d6c30a1f3dc..0619dbc57cd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/UserApi.java @@ -22,7 +22,7 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUser(@Valid User body); + void createUser(@Valid User body) throws Exception; @POST @Path("/createWithArray") @@ -30,7 +30,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithArrayInput(@Valid List body); + void createUsersWithArrayInput(@Valid List body) throws Exception; @POST @Path("/createWithList") @@ -38,7 +38,7 @@ public interface UserApi { @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void createUsersWithListInput(@Valid List body); + void createUsersWithListInput(@Valid List body) throws Exception; @DELETE @Path("/{username}") @@ -47,7 +47,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username); + void deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username) throws Exception; @GET @Path("/{username}") @@ -57,7 +57,7 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username); + User getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing. ") String username) throws Exception; @GET @Path("/login") @@ -66,7 +66,7 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + String loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password) throws Exception; @GET @Path("/logout") @@ -74,7 +74,7 @@ public interface UserApi { @ApiOperation(value = "Logs out current logged in user session", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - void logoutUser(); + void logoutUser() throws Exception; @PUT @Path("/{username}") @@ -83,5 +83,5 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); + void updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body) throws Exception; } From d093a344996f68567bc8ae121bcd4fc3e428326f Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 17 Oct 2017 22:53:04 +0800 Subject: [PATCH 169/197] add jaxrs-spec-interface to circle ci --- pom.xml.circleci | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml.circleci b/pom.xml.circleci index 862bd4cc880..d1b7b94572c 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -864,6 +864,7 @@ 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 From be3e33f4729d05398bbe76eb431ed146fe314b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Ros=C3=A9?= Date: Tue, 17 Oct 2017 17:14:34 +0200 Subject: [PATCH 170/197] [C++] Sanitize operation ids. (#6664) * [C++] Sanitize operation ids. * [C++] Handle reserved words in `toOperationId`. * [C++] Re-order reserved words alphabetically. * [C++] Add missing reserved words. --- .../codegen/languages/AbstractCppCodegen.java | 92 ++++++++++++------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java index 7dcb9ed1464..1c44d1587c4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCppCodegen.java @@ -17,77 +17,90 @@ public AbstractCppCodegen() { */ setReservedWordsLowerCase( Arrays.asList( + "alignas", + "alignof", + "and", + "and_eq", + "asm", "auto", + "bitand", + "bitor", + "bool", "break", "case", + "catch", "char", + "char16_t", + "char32_t", + "class", + "compl", + "concept", "const", + "constexpr", + "const_cast", "continue", + "decltype", "default", + "delete", "do", "double", + "dynamic_cast", "else", "enum", + "explicit", + "export", "extern", + "false", "float", "for", + "friend", "goto", "if", + "inline", "int", "long", - "register", - "return", - "short", - "signed", - "sizeof", - "static", - "struct", - "switch", - "typedef", - "union", - "unsigned", - "void", - "volatile", - "while", - "asm", - "bool", - "catch", - "class", - "const_cast", - "delete", - "dynamic_cast", - "explicit", - "false", - "friend", - "inline", "mutable", "namespace", "new", + "noexcept", + "not", + "not_eq", + "nullptr", "operator", + "or", + "or_eq", "private", - "public", "protected", + "public", + "register", "reinterpret_cast", + "requires", + "return", + "short", + "signed", + "sizeof", + "static", + "static_assert", "static_cast", + "struct", + "switch", "template", "this", + "thread_local", "throw", "true", "try", + "typedef", "typeid", "typename", + "union", + "unsigned", "using", "virtual", + "void", + "volatile", "wchar_t", - "and", - "and_eq", - "bitand", - "bitor", - "compl", - "not", - "not_eq", - "or", - "or_eq", + "while", "xor", "xor_eq") ); @@ -127,6 +140,15 @@ public String escapeReservedWord(String name) { return sanitizeName("_" + name); } + @Override + public String toOperationId(String operationId) { + if (isReservedWord(operationId)) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + escapeReservedWord(operationId)); + return escapeReservedWord(operationId); + } + return sanitizeName(super.toOperationId(operationId)); + } + @Override public String toParamName(String name) { return sanitizeName(super.toParamName(name)); From ff9c72320834c572ffde470b60b1d1845b36bb72 Mon Sep 17 00:00:00 2001 From: alex-fisher Date: Tue, 17 Oct 2017 10:37:22 -0500 Subject: [PATCH 171/197] ContentType selection fix for csharp. (#6633) * ContentType selection fix for csharp. Updated to reflect java implementation. Previously any request body of type string was having the content type overridden to 'application/json'. This prevented custom json ContentTypes * updated the petshop codegen for C# * Fixed content type selection test for csharp * Replaced tabs with 4 spaces * Removed trailing space / string comparison --- .../main/resources/csharp/ApiClient.mustache | 51 +-- .../petstore/csharp/SwaggerClient/README.md | 12 +- .../SwaggerClient/docs/AnotherFakeApi.md | 70 ++++ .../docs/FakeClassnameTags123Api.md | 73 ++++ .../Api/AnotherFakeApiTests.cs | 81 +++++ .../Api/FakeClassnameTags123ApiTests.cs | 81 +++++ .../IO.Swagger.Test/Client/ApiClientTests.cs | 2 +- .../src/IO.Swagger/Api/AnotherFakeApi.cs | 321 +++++++++++++++++ .../IO.Swagger/Api/FakeClassnameTags123Api.cs | 331 ++++++++++++++++++ .../src/IO.Swagger/Client/ApiClient.cs | 36 +- 10 files changed, 1018 insertions(+), 40 deletions(-) create mode 100644 samples/client/petstore/csharp/SwaggerClient/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/csharp/SwaggerClient/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs create mode 100644 samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index cb6deb0c170..c0a8a132029 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -165,24 +165,12 @@ namespace {{packageName}}.Client if (postBody != null) // http body (model or byte[]) parameter { - if (postBody.GetType() == typeof(String)) - { - {{#netStandard}} - request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = "application/json" }); - {{/netStandard}} - {{^netStandard}} - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - {{/netStandard}} - } - else if (postBody.GetType() == typeof(byte[])) - { - {{#netStandard}} - request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); - {{/netStandard}} - {{^netStandard}} - request.AddParameter(contentType, postBody, ParameterType.RequestBody); - {{/netStandard}} - } + {{#netStandard}} + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); + {{/netStandard}} + {{^netStandard}} + request.AddParameter(contentType, postBody, ParameterType.RequestBody); + {{/netStandard}} } return request; @@ -399,9 +387,25 @@ namespace {{packageName}}.Client } } + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + /// /// Select the Content-Type header's value from the given content-type array: - /// if JSON exists in the given array, use it; + /// if JSON type exists in the given array, use it; /// otherwise use the first one defined in 'consumes' /// /// The Content-Type array to select from. @@ -409,11 +413,14 @@ namespace {{packageName}}.Client public String SelectHeaderContentType(String[] contentTypes) { if (contentTypes.Length == 0) - return null; - - if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase)) return "application/json"; + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + return contentTypes[0]; // use the first content type specified in 'consumes' } diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 257a7e86293..257d9c889f2 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -68,17 +68,18 @@ namespace Example public void main() { - var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); } } @@ -93,6 +94,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -101,7 +103,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*Fake_classname_tags123Api* | [**TestClassname**](docs/Fake_classname_tags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..89bc406754a --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/AnotherFakeApi.md @@ -0,0 +1,70 @@ +# IO.Swagger.Api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **TestSpecialTags** +> ModelClient TestSpecialTags (ModelClient body) + +To test special tags + +To test special tags + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestSpecialTagsExample + { + public void main() + { + var apiInstance = new AnotherFakeApi(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test special tags + ModelClient result = apiInstance.TestSpecialTags(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/SwaggerClient/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..5f1d0ca776b --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/FakeClassnameTags123Api.md @@ -0,0 +1,73 @@ +# IO.Swagger.Api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **TestClassname** +> ModelClient TestClassname (ModelClient body) + +To test class name in snake case + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class TestClassnameExample + { + public void main() + { + // Configure API key authorization: api_key_query + Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); + + var apiInstance = new FakeClassnameTags123Api(); + var body = new ModelClient(); // ModelClient | client model + + try + { + // To test class name in snake case + ModelClient result = apiInstance.TestClassname(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ModelClient**](ModelClient.md)| client model | + +### Return type + +[**ModelClient**](ModelClient.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs new file mode 100644 index 00000000000..070e217a0f5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/AnotherFakeApiTests.cs @@ -0,0 +1,81 @@ +/* + * 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: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing AnotherFakeApi + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class AnotherFakeApiTests + { + private AnotherFakeApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new AnotherFakeApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of AnotherFakeApi + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' AnotherFakeApi + //Assert.IsInstanceOfType(typeof(AnotherFakeApi), instance, "instance is a AnotherFakeApi"); + } + + + /// + /// Test TestSpecialTags + /// + [Test] + public void TestSpecialTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient body = null; + //var response = instance.TestSpecialTags(body); + //Assert.IsInstanceOf (response, "response is ModelClient"); + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs new file mode 100644 index 00000000000..36a5acb38a9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeClassnameTags123ApiTests.cs @@ -0,0 +1,81 @@ +/* + * 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: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing FakeClassnameTags123Api + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the API endpoint. + /// + [TestFixture] + public class FakeClassnameTags123ApiTests + { + private FakeClassnameTags123Api instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new FakeClassnameTags123Api(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of FakeClassnameTags123Api + /// + [Test] + public void InstanceTest() + { + // TODO uncomment below to test 'IsInstanceOfType' FakeClassnameTags123Api + //Assert.IsInstanceOfType(typeof(FakeClassnameTags123Api), instance, "instance is a FakeClassnameTags123Api"); + } + + + /// + /// Test TestClassname + /// + [Test] + public void TestClassnameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //ModelClient body = null; + //var response = instance.TestClassname(body); + //Assert.IsInstanceOf (response, "response is ModelClient"); + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Client/ApiClientTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Client/ApiClientTests.cs index 8b10afdeb0e..8f7c10d5e43 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Client/ApiClientTests.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Client/ApiClientTests.cs @@ -41,7 +41,7 @@ public void TestSelectHeaderContentType () Assert.AreEqual("application/xml", api.SelectHeaderContentType (contentTypes)); contentTypes = new String[] {}; - Assert.IsNull(api.SelectHeaderContentType (contentTypes)); + Assert.AreEqual("application/json", api.SelectHeaderContentType (contentTypes)); } /// diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs new file mode 100644 index 00000000000..815cfe4cfb6 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/AnotherFakeApi.cs @@ -0,0 +1,321 @@ +/* + * 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: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IAnotherFakeApi : IApiAccessor + { + #region Synchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestSpecialTags (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestSpecialTagsWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body); + + /// + /// To test special tags + /// + /// + /// To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class AnotherFakeApi : IAnotherFakeApi + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public AnotherFakeApi(String basePath) + { + this.Configuration = new Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public AnotherFakeApi(Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestSpecialTags (ModelClient body) + { + ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "/another-fake/dummy"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test special tags To test special tags + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags"); + + var localVarPath = "/another-fake/dummy"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs new file mode 100644 index 00000000000..264994669de --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeClassnameTags123Api.cs @@ -0,0 +1,331 @@ +/* + * 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: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace IO.Swagger.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFakeClassnameTags123Api : IApiAccessor + { + #region Synchronous Operations + /// + /// To test class name in snake case + /// + /// + /// + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + ModelClient TestClassname (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + ApiResponse TestClassnameWithHttpInfo (ModelClient body); + #endregion Synchronous Operations + #region Asynchronous Operations + /// + /// To test class name in snake case + /// + /// + /// + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + + /// + /// To test class name in snake case + /// + /// + /// + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FakeClassnameTags123Api : IFakeClassnameTags123Api + { + private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FakeClassnameTags123Api(String basePath) + { + this.Configuration = new Configuration { BasePath = basePath }; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FakeClassnameTags123Api(Configuration configuration = null) + { + if (configuration == null) // use the default one in Configuration + this.Configuration = Configuration.Default; + else + this.Configuration = configuration; + + ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] + public void SetBasePath(String basePath) + { + // do nothing + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Configuration Configuration {get; set;} + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public IO.Swagger.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Gets the default header. + /// + /// Dictionary of HTTP header + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] + public IDictionary DefaultHeader() + { + return new ReadOnlyDictionary(this.Configuration.DefaultHeader); + } + + /// + /// Add default header. + /// + /// Header field name. + /// Header field value. + /// + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] + public void AddDefaultHeader(string key, string value) + { + this.Configuration.AddDefaultHeader(key, value); + } + + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ModelClient + public ModelClient TestClassname (ModelClient body) + { + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// ApiResponse of ModelClient + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "/fake_classname_test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (api_key_query) required + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "api_key_query", Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ModelClient + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + { + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// To test class name in snake case + /// + /// Thrown when fails to make API call + /// client model + /// Task of ApiResponse (ModelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); + + var localVarPath = "/fake_classname_test"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + // authentication (api_key_query) required + if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key_query"))) + { + localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "api_key_query", Configuration.GetApiKeyWithPrefix("api_key_query"))); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestClassname", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs index f4c961cc61a..51042091e7d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs @@ -139,14 +139,7 @@ private RestRequest PrepareRequest( if (postBody != null) // http body (model or byte[]) parameter { - if (postBody.GetType() == typeof(String)) - { - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - } - else if (postBody.GetType() == typeof(byte[])) - { - request.AddParameter(contentType, postBody, ParameterType.RequestBody); - } + request.AddParameter(contentType, postBody, ParameterType.RequestBody); } return request; @@ -351,9 +344,25 @@ public String Serialize(object obj) } } + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json", StringComparison.InvariantCultureIgnoreCase)); + } + /// /// Select the Content-Type header's value from the given content-type array: - /// if JSON exists in the given array, use it; + /// if JSON type exists in the given array, use it; /// otherwise use the first one defined in 'consumes' /// /// The Content-Type array to select from. @@ -361,11 +370,14 @@ public String Serialize(object obj) public String SelectHeaderContentType(String[] contentTypes) { if (contentTypes.Length == 0) - return null; - - if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase)) return "application/json"; + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + return contentTypes[0]; // use the first content type specified in 'consumes' } From c4d5ba1533b8f7bbe6318d6f209440fdd8bd208d Mon Sep 17 00:00:00 2001 From: Asad Saeeduddin Date: Tue, 17 Oct 2017 21:58:36 -0400 Subject: [PATCH 172/197] Prefix local vars to prevent conflict with params (#6717) * Prefix local vars to prevent conflict with params Fixes #6698 * Update test snapshots --- .../resources/typescript-fetch/api.mustache | 68 +-- .../typescript-fetch/builds/es6-target/api.ts | 574 +++++++++--------- .../builds/with-npm-version/api.ts | 574 +++++++++--------- 3 files changed, 608 insertions(+), 608 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache index b209fed6add..2fe42a8dd16 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -98,14 +98,14 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur } {{/required}} {{/allParams}} - const path = `{{{path}}}`{{#pathParams}} + const localVarPath = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: '{{httpMethod}}' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: '{{httpMethod}}' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; {{#hasFormParams}} - const formParams = new url.URLSearchParams(); + const localVarFormParams = new url.URLSearchParams(); {{/hasFormParams}} {{#authMethods}} @@ -113,34 +113,34 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{#isApiKey}} {{#isKeyInHeader}} if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("{{keyParamName}}") : configuration.apiKey; - headerParameter["{{keyParamName}}"] = apiKeyValue; + localVarHeaderParameter["{{keyParamName}}"] = localVarApiKeyValue; } {{/isKeyInHeader}} {{#isKeyInQuery}} if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("{{keyParamName}}") : configuration.apiKey; - queryParameter["{{keyParamName}}"] = apiKeyValue; + localVarQueryParameter["{{keyParamName}}"] = localVarApiKeyValue; } {{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} // http basic authentication required if (configuration && (configuration.username || configuration.password)) { - headerParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password); + localVarHeaderParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password); } {{/isBasic}} {{#isOAuth}} // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } {{/isOAuth}} @@ -149,24 +149,24 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{#isListContainer}} if ({{paramName}}) { {{#isCollectionFormatMulti}} - queryParameter['{{baseName}}'] = {{paramName}}; + localVarQueryParameter['{{baseName}}'] = {{paramName}}; {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - queryParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]); + localVarQueryParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - queryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); {{/isDateTime}} {{^isDateTime}} {{#isDate}} - queryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); {{/isDate}} {{^isDate}} - queryParameter['{{baseName}}'] = {{paramName}}; + localVarQueryParameter['{{baseName}}'] = {{paramName}}; {{/isDate}} {{/isDateTime}} } @@ -176,12 +176,12 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{#headerParams}} {{#isListContainer}} if ({{paramName}}) { - headerParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); + localVarHeaderParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined && {{paramName}} !== null) { - headerParameter['{{baseName}}'] = String({{paramName}}); + localVarHeaderParameter['{{baseName}}'] = String({{paramName}}); } {{/isListContainer}} @@ -191,43 +191,43 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - formParams.append('{{baseName}}', element as any); + localVarFormParams.append('{{baseName}}', element as any); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formParams.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); + localVarFormParams.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { - formParams.set('{{baseName}}', {{paramName}} as any); + localVarFormParams.set('{{baseName}}', {{paramName}} as any); } {{/isListContainer}} {{/formParams}} {{#hasFormParams}} - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; {{/hasFormParams}} {{#bodyParam}} - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; {{/bodyParam}} - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); {{#hasFormParams}} - requestOptions.body = formParams.toString(); + localVarRequestOptions.body = localVarFormParams.toString(); {{/hasFormParams}} {{#bodyParam}} - requestOptions.body = JSON.stringify({{paramName}} || {}); + localVarRequestOptions.body = JSON.stringify({{paramName}} || {}); {{/bodyParam}} return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, {{/operation}} @@ -254,9 +254,9 @@ export const {{classname}}Fp = function(configuration?: Configuration) { * @throws {RequiredError} */ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { - const fetchArgs = {{classname}}FetchParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); + const localVarFetchArgs = {{classname}}FetchParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response{{#returnType}}.json(){{/returnType}}; } else { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index b31bd51457e..16f039fab86 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -338,32 +338,32 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } - const path = `/pet`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -379,34 +379,34 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (apiKey !== undefined && apiKey !== null) { - headerParameter['api_key'] = String(apiKey); + localVarHeaderParameter['api_key'] = String(apiKey); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -421,33 +421,33 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (status === null || status === undefined) { throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } - const path = `/pet/findByStatus`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (status) { - queryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -462,33 +462,33 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (tags === null || tags === undefined) { throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } - const path = `/pet/findByTags`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (tags) { - queryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -503,29 +503,29 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication api_key required if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; - headerParameter["api_key"] = apiKeyValue; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -540,32 +540,32 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } - const path = `/pet`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'PUT' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -582,42 +582,42 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; - const formParams = new url.URLSearchParams(); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new url.URLSearchParams(); // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (name !== undefined) { - formParams.set('name', name as any); + localVarFormParams.set('name', name as any); } if (status !== undefined) { - formParams.set('status', status as any); + localVarFormParams.set('status', status as any); } - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = formParams.toString(); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams.toString(); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -634,42 +634,42 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } - const path = `/pet/{petId}/uploadImage` + const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; - const formParams = new url.URLSearchParams(); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new url.URLSearchParams(); // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata as any); + localVarFormParams.set('additionalMetadata', additionalMetadata as any); } if (file !== undefined) { - formParams.set('file', file as any); + localVarFormParams.set('file', file as any); } - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = formParams.toString(); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams.toString(); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -689,9 +689,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -709,9 +709,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -728,9 +728,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ findPetsByStatus(status: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -747,9 +747,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -766,9 +766,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -785,9 +785,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -806,9 +806,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -827,9 +827,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1063,21 +1063,21 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (orderId === null || orderId === undefined) { throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } - const path = `/store/order/{orderId}` + const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1087,28 +1087,28 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration * @throws {RequiredError} */ getInventory(options: any = {}): FetchArgs { - const path = `/store/inventory`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/store/inventory`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication api_key required if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; - headerParameter["api_key"] = apiKeyValue; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1123,21 +1123,21 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (orderId === null || orderId === undefined) { throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } - const path = `/store/order/{orderId}` + const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1152,23 +1152,23 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } - const path = `/store/order`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/store/order`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -1188,9 +1188,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1206,9 +1206,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { - const fetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1225,9 +1225,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1244,9 +1244,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(body, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1380,23 +1380,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } - const path = `/user`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1411,23 +1411,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - const path = `/user/createWithArray`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1442,23 +1442,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } - const path = `/user/createWithList`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/createWithList`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1473,21 +1473,21 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (username === null || username === undefined) { throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1502,21 +1502,21 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (username === null || username === undefined) { throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1536,28 +1536,28 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (password === null || password === undefined) { throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } - const path = `/user/login`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/login`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; if (username !== undefined) { - queryParameter['username'] = username; + localVarQueryParameter['username'] = username; } if (password !== undefined) { - queryParameter['password'] = password; + localVarQueryParameter['password'] = password; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1567,20 +1567,20 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) * @throws {RequiredError} */ logoutUser(options: any = {}): FetchArgs { - const path = `/user/logout`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/logout`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1600,24 +1600,24 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'PUT' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -1637,9 +1637,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1656,9 +1656,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1675,9 +1675,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1694,9 +1694,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1713,9 +1713,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1733,9 +1733,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1751,9 +1751,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1771,9 +1771,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index b31bd51457e..16f039fab86 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -338,32 +338,32 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } - const path = `/pet`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -379,34 +379,34 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (apiKey !== undefined && apiKey !== null) { - headerParameter['api_key'] = String(apiKey); + localVarHeaderParameter['api_key'] = String(apiKey); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -421,33 +421,33 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (status === null || status === undefined) { throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } - const path = `/pet/findByStatus`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (status) { - queryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -462,33 +462,33 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (tags === null || tags === undefined) { throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } - const path = `/pet/findByTags`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (tags) { - queryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -503,29 +503,29 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication api_key required if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; - headerParameter["api_key"] = apiKeyValue; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -540,32 +540,32 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } - const path = `/pet`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'PUT' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -582,42 +582,42 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } - const path = `/pet/{petId}` + const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; - const formParams = new url.URLSearchParams(); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new url.URLSearchParams(); // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (name !== undefined) { - formParams.set('name', name as any); + localVarFormParams.set('name', name as any); } if (status !== undefined) { - formParams.set('status', status as any); + localVarFormParams.set('status', status as any); } - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = formParams.toString(); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams.toString(); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -634,42 +634,42 @@ export const PetApiFetchParamCreator = function (configuration?: Configuration) if (petId === null || petId === undefined) { throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } - const path = `/pet/{petId}/uploadImage` + const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; - const formParams = new url.URLSearchParams(); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new url.URLSearchParams(); // authentication petstore_auth required // oauth required if (configuration && configuration.accessToken) { - const accessTokenValue = typeof configuration.accessToken === 'function' + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; - headerParameter["Authorization"] = "Bearer " + accessTokenValue; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } if (additionalMetadata !== undefined) { - formParams.set('additionalMetadata', additionalMetadata as any); + localVarFormParams.set('additionalMetadata', additionalMetadata as any); } if (file !== undefined) { - formParams.set('file', file as any); + localVarFormParams.set('file', file as any); } - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = formParams.toString(); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams.toString(); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -689,9 +689,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -709,9 +709,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -728,9 +728,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ findPetsByStatus(status: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -747,9 +747,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -766,9 +766,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -785,9 +785,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -806,9 +806,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -827,9 +827,9 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1063,21 +1063,21 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (orderId === null || orderId === undefined) { throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } - const path = `/store/order/{orderId}` + const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1087,28 +1087,28 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration * @throws {RequiredError} */ getInventory(options: any = {}): FetchArgs { - const path = `/store/inventory`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/store/inventory`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; // authentication api_key required if (configuration && configuration.apiKey) { - const apiKeyValue = typeof configuration.apiKey === 'function' + const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; - headerParameter["api_key"] = apiKeyValue; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1123,21 +1123,21 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (orderId === null || orderId === undefined) { throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } - const path = `/store/order/{orderId}` + const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1152,23 +1152,23 @@ export const StoreApiFetchParamCreator = function (configuration?: Configuration if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } - const path = `/store/order`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/store/order`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -1188,9 +1188,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1206,9 +1206,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { - const fetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1225,9 +1225,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1244,9 +1244,9 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(body, options); + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1380,23 +1380,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } - const path = `/user`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1411,23 +1411,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - const path = `/user/createWithArray`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1442,23 +1442,23 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } - const path = `/user/createWithList`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'POST' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/createWithList`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'POST' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1473,21 +1473,21 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (username === null || username === undefined) { throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'DELETE' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1502,21 +1502,21 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (username === null || username === undefined) { throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1536,28 +1536,28 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (password === null || password === undefined) { throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } - const path = `/user/login`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/login`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; if (username !== undefined) { - queryParameter['username'] = username; + localVarQueryParameter['username'] = username; } if (password !== undefined) { - queryParameter['password'] = password; + localVarQueryParameter['password'] = password; } - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1567,20 +1567,20 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) * @throws {RequiredError} */ logoutUser(options: any = {}): FetchArgs { - const path = `/user/logout`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'GET' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarPath = `/user/logout`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'GET' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, /** @@ -1600,24 +1600,24 @@ export const UserApiFetchParamCreator = function (configuration?: Configuration) if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } - const path = `/user/{username}` + const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'PUT' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; - headerParameter['Content-Type'] = 'application/json'; + localVarHeaderParameter['Content-Type'] = 'application/json'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete urlObj.search; - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = JSON.stringify(body || {}); + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = JSON.stringify(body || {}); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -1637,9 +1637,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1656,9 +1656,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1675,9 +1675,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1694,9 +1694,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1713,9 +1713,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1733,9 +1733,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response.json(); } else { @@ -1751,9 +1751,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { @@ -1771,9 +1771,9 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); + const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { From c783ec1d4166c21f0282fe0c27f58a4d1d3e908a Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 18 Oct 2017 10:10:44 +0800 Subject: [PATCH 173/197] update all petstore security samples --- bin/security/silex-petstore-server.sh | 2 +- bin/security/typescript-angular2.sh | 2 +- .../src/IO.Swagger/Client/ApiClient.cs | 36 +++++--- .../petstore-security-test/go/api_client.go | 6 +- .../petstore-security-test/go/api_response.go | 6 +- .../go/configuration.go | 6 +- .../petstore-security-test/go/fake_api.go | 20 ++-- .../petstore-security-test/go/model_return.go | 6 +- .../API/Client/FakeApi.js | 2 +- .../javascript/.swagger-codegen/VERSION | 2 +- .../javascript/README.md | 45 ++++++++- .../javascript/package.json | 2 +- .../javascript/src/ApiClient.js | 24 ++++- .../javascript/src/api/FakeApi.js | 6 +- .../javascript/src/index.js | 2 +- .../javascript/src/model/ModelReturn.js | 2 +- .../petstore-security-test/perl/README.md | 4 +- .../perl/deep_module_test/README.md | 4 +- .../perl/deep_module_test/docs/FakeApi.md | 8 +- .../lib/Something/Deep/FakeApi.pm | 8 +- .../perl/docs/FakeApi.md | 8 +- .../perl/lib/WWW/SwaggerClient/FakeApi.pm | 8 +- .../python/petstore_api/api_client.py | 6 +- .../python/petstore_api/configuration.py | 30 +++++- .../python/petstore_api/rest.py | 18 +++- .../qt5cpp/client/SWGFakeApi.cpp | 18 +++- .../qt5cpp/client/SWGFakeApi.h | 11 ++- .../qt5cpp/client/SWGHttpRequest.cpp | 13 +-- .../qt5cpp/client/SWGHttpRequest.h | 1 + .../qt5cpp/client/SWGReturn.cpp | 12 +-- .../qt5cpp/client/SWGReturn.h | 4 +- .../ruby/lib/petstore.rb | 1 + .../ruby/lib/petstore/api/fake_api.rb | 1 + .../ruby/lib/petstore/api_client.rb | 63 ++++++++----- .../ruby/lib/petstore/api_error.rb | 1 + .../ruby/lib/petstore/configuration.rb | 7 ++ .../ruby/lib/petstore/models/model_return.rb | 1 + .../ruby/lib/petstore/version.rb | 1 + .../ruby/petstore.gemspec | 7 +- .../petstore-security-test/scala/pom.xml | 10 +- .../scala/io/swagger/client/ApiInvoker.scala | 91 ++++++++++-------- .../scala/io/swagger/client/api/FakeApi.scala | 15 +-- .../typescript-angular/.gitignore | 1 + .../.swagger-codegen/VERSION | 2 +- .../typescript-angular/api.module.ts | 24 ++++- .../typescript-angular/api/api.ts | 6 +- .../typescript-angular/index.ts | 5 +- .../typescript-angular/model/ModelReturn.ts | 6 +- .../typescript-angular/model/models.ts | 2 +- .../.swagger-codegen/VERSION | 2 +- .../typescript-angular2/api.module.ts | 4 +- .../typescript-angular2/api/fake.service.ts | 92 ++++++------------- .../typescript-angular2/configuration.ts | 14 +-- .../typescript-angular2/model/ModelReturn.ts | 2 + .../typescript-angular2/variables.ts | 4 +- .../typescript-fetch/api.ts | 40 ++++---- .../typescript-fetch/configuration.ts | 2 +- .../typescript-fetch/index.ts | 2 +- .../typescript-node/api.ts | 3 +- .../silex/SwaggerServer/index.php | 2 +- 60 files changed, 444 insertions(+), 289 deletions(-) diff --git a/bin/security/silex-petstore-server.sh b/bin/security/silex-petstore-server.sh index a939c2da9a8..229eac1391c 100755 --- a/bin/security/silex-petstore-server.sh +++ b/bin/security/silex-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 -t modules/swagger-codegen/src/main/resources/silex -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l silex-PHP -o samples/server/petstore-security-test/silex" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/php-silex -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l php-silex -o samples/server/petstore-security-test/silex" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/typescript-angular2.sh b/bin/security/typescript-angular2.sh index 4bb954bae85..192932f1b3b 100755 --- a/bin/security/typescript-angular2.sh +++ b/bin/security/typescript-angular2.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/typescript-angular2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-angular -o samples/client/petstore-security-test/typescript-angular2" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-angular -o samples/client/petstore-security-test/typescript-angular2" java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs index f94789ba974..b5f0d4003b0 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/ApiClient.cs @@ -139,14 +139,7 @@ private RestRequest PrepareRequest( if (postBody != null) // http body (model or byte[]) parameter { - if (postBody.GetType() == typeof(String)) - { - request.AddParameter("application/json", postBody, ParameterType.RequestBody); - } - else if (postBody.GetType() == typeof(byte[])) - { - request.AddParameter(contentType, postBody, ParameterType.RequestBody); - } + request.AddParameter(contentType, postBody, ParameterType.RequestBody); } return request; @@ -351,9 +344,25 @@ public String Serialize(object obj) } } + /// + ///Check if the given MIME is a JSON MIME. + ///JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public bool IsJsonMime(String mime) + { + var jsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + return mime != null && (jsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json")); + } + /// /// Select the Content-Type header's value from the given content-type array: - /// if JSON exists in the given array, use it; + /// if JSON type exists in the given array, use it; /// otherwise use the first one defined in 'consumes' /// /// The Content-Type array to select from. @@ -361,11 +370,14 @@ public String Serialize(object obj) public String SelectHeaderContentType(String[] contentTypes) { if (contentTypes.Length == 0) - return null; - - if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase)) return "application/json"; + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType.ToLower())) + return contentType; + } + return contentTypes[0]; // use the first content type specified in 'consumes' } diff --git a/samples/client/petstore-security-test/go/api_client.go b/samples/client/petstore-security-test/go/api_client.go index 948f60420ea..db4d1d0757b 100644 --- a/samples/client/petstore-security-test/go/api_client.go +++ b/samples/client/petstore-security-test/go/api_client.go @@ -1,11 +1,11 @@ -/* +/* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * * 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 -- * - * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * API 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 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger diff --git a/samples/client/petstore-security-test/go/api_response.go b/samples/client/petstore-security-test/go/api_response.go index d2cd6766832..8b8f3b928ed 100644 --- a/samples/client/petstore-security-test/go/api_response.go +++ b/samples/client/petstore-security-test/go/api_response.go @@ -1,11 +1,11 @@ -/* +/* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * * 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 -- * - * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * API 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 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger diff --git a/samples/client/petstore-security-test/go/configuration.go b/samples/client/petstore-security-test/go/configuration.go index a36b57c4b55..bd7622870d4 100644 --- a/samples/client/petstore-security-test/go/configuration.go +++ b/samples/client/petstore-security-test/go/configuration.go @@ -1,11 +1,11 @@ -/* +/* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * * 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 -- * - * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * API 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 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger diff --git a/samples/client/petstore-security-test/go/fake_api.go b/samples/client/petstore-security-test/go/fake_api.go index b20c99c8014..6375ef8234e 100644 --- a/samples/client/petstore-security-test/go/fake_api.go +++ b/samples/client/petstore-security-test/go/fake_api.go @@ -1,11 +1,11 @@ -/* +/* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * * 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 -- * - * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * API 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 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger @@ -77,14 +77,14 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(localVarOptionals map[string]inte return nil, err } - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { return localVarHttpResponse, reportError(localVarHttpResponse.Status) - } + } 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 d2c0ccb2e81..d1a82197416 100644 --- a/samples/client/petstore-security-test/go/model_return.go +++ b/samples/client/petstore-security-test/go/model_return.go @@ -1,11 +1,11 @@ -/* +/* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * * 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 -- * - * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * API 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 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger diff --git a/samples/client/petstore-security-test/javascript-closure-angular/API/Client/FakeApi.js b/samples/client/petstore-security-test/javascript-closure-angular/API/Client/FakeApi.js index 061532b28b5..3256c954a05 100644 --- a/samples/client/petstore-security-test/javascript-closure-angular/API/Client/FakeApi.js +++ b/samples/client/petstore-security-test/javascript-closure-angular/API/Client/FakeApi.js @@ -8,7 +8,7 @@ * Generated by: io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen */ /** - * @license Apache 2.0 *_/ ' \" =end -- \\r\\n \\n \\r + * @license Apache-2.0 *_/ ' \" =end -- \\r\\n \\n \\r * http://www.apache.org/licenses/LICENSE-2.0.html *_/ ' \" =end -- \\r\\n \\n \\r */ diff --git a/samples/client/petstore-security-test/javascript/.swagger-codegen/VERSION b/samples/client/petstore-security-test/javascript/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore-security-test/javascript/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/javascript/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/javascript/README.md b/samples/client/petstore-security-test/javascript/README.md index 144c7dbfd55..4a9bd7e80db 100644 --- a/samples/client/petstore-security-test/javascript/README.md +++ b/samples/client/petstore-security-test/javascript/README.md @@ -23,6 +23,30 @@ Then install it via: npm install swagger_petstore____end____rn_n_r --save ``` +##### Local development + +To use the library locally without publishing to a remote npm registry, first install the dependencies by changing +into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: + +```shell +npm install +``` + +Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: + +```shell +npm link +``` + +Finally, switch to the directory you want to use your swagger_petstore____end____rn_n_r from, and run: + +```shell +npm link /path/to/ +``` + +You should now be able to `require('swagger_petstore____end____rn_n_r')` in javascript files from the directory you ran the last +command above from. + #### git # If the library is hosted at a git repository, e.g. @@ -37,7 +61,8 @@ then install it via: The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following the above steps with Node.js and installing browserify with `npm install -g browserify`, -perform the following (assuming *main.js* is your entry file): +perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually +use this library): ```shell browserify main.js > bundle.js @@ -45,6 +70,24 @@ browserify main.js > bundle.js Then include *bundle.js* in the HTML pages. +### Webpack Configuration + +Using Webpack you may encounter the following error: "Module not found: Error: +Cannot resolve module", most certainly you should disable AMD loader. Add/merge +the following section to your webpack config: + +```javascript +module: { + rules: [ + { + parser: { + amd: false + } + } + ] +} +``` + ## Getting Started Please follow the [installation](#installation) instruction and execute the following JS code: diff --git a/samples/client/petstore-security-test/javascript/package.json b/samples/client/petstore-security-test/javascript/package.json index 9bb9f494674..9fae64eb646 100644 --- a/samples/client/petstore-security-test/javascript/package.json +++ b/samples/client/petstore-security-test/javascript/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore____end____rn_n_r", "version": "1.0.0 *_/ =end -- \r\n \n \r", "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______", - "license": "Unlicense", + "license": "Apache-2.0 */ ' " =end -- \r\n \n \r", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore-security-test/javascript/src/ApiClient.js b/samples/client/petstore-security-test/javascript/src/ApiClient.js index b7eb8adcbdc..193dcfa683b 100644 --- a/samples/client/petstore-security-test/javascript/src/ApiClient.js +++ b/samples/client/petstore-security-test/javascript/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -362,6 +362,7 @@ * @param {String} httpMethod The HTTP method to use. * @param {Object.} pathParams A map of path parameters and their values. * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} collectionQueryParams A map of collection query parameters and their values. * @param {Object.} headerParams A map of header parameters and their values. * @param {Object.} formParams A map of form parameters and their values. * @param {Object} bodyParam The value to pass as the request body. @@ -374,7 +375,7 @@ * @returns {Object} The SuperAgent request object. */ exports.prototype.callApi = function callApi(path, httpMethod, pathParams, - queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) { var _this = this; @@ -384,6 +385,25 @@ // apply authentications this.applyAuthToRequest(request, authNames); + // set collection query parameters + for (var key in collectionQueryParams) { + if (collectionQueryParams.hasOwnProperty(key)) { + var param = collectionQueryParams[key]; + if (param.collectionFormat === 'csv') { + // SuperAgent normally percent-encodes all reserved characters in a query parameter. However, + // commas are used as delimiters for the 'csv' collectionFormat so they must not be encoded. We + // must therefore construct and encode 'csv' collection query parameters manually. + if (param.value != null) { + var value = param.value.map(this.paramToString).map(encodeURIComponent).join(','); + request.query(encodeURIComponent(key) + "=" + value); + } + } else { + // All other collection query parameters should be treated as ordinary query parameters. + queryParams[key] = this.buildCollectionParam(param.value, param.collectionFormat); + } + } + } + // set query parameters if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { queryParams['_'] = new Date().getTime(); diff --git a/samples/client/petstore-security-test/javascript/src/api/FakeApi.js b/samples/client/petstore-security-test/javascript/src/api/FakeApi.js index 4a5d37f908e..32e2c7ea1ec 100644 --- a/samples/client/petstore-security-test/javascript/src/api/FakeApi.js +++ b/samples/client/petstore-security-test/javascript/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -71,6 +71,8 @@ }; var queryParams = { }; + var collectionQueryParams = { + }; var headerParams = { }; var formParams = { @@ -84,7 +86,7 @@ return this.apiClient.callApi( '/fake', 'PUT', - pathParams, queryParams, headerParams, formParams, postBody, + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } diff --git a/samples/client/petstore-security-test/javascript/src/index.js b/samples/client/petstore-security-test/javascript/src/index.js index 24c45e90a68..4da0fef98ea 100644 --- a/samples/client/petstore-security-test/javascript/src/index.js +++ b/samples/client/petstore-security-test/javascript/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore-security-test/javascript/src/model/ModelReturn.js b/samples/client/petstore-security-test/javascript/src/model/ModelReturn.js index 40043ceb412..6e9c1fd3c72 100644 --- a/samples/client/petstore-security-test/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore-security-test/javascript/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore-security-test/perl/README.md b/samples/client/petstore-security-test/perl/README.md index c60bcf8bc30..090ffbd1f9a 100644 --- a/samples/client/petstore-security-test/perl/README.md +++ b/samples/client/petstore-security-test/perl/README.md @@ -251,10 +251,10 @@ use WWW::SwaggerClient::; my $api_instance = WWW::SwaggerClient::->new( ); -my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r +my $test_code_inject_*/_'_"_=end____\r\n_\n_\r = 'test_code_inject_*/_'_"_=end____\r\n_\n_\r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { - $api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r); + $api_instance->test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r); }; if ($@) { warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n"; diff --git a/samples/client/petstore-security-test/perl/deep_module_test/README.md b/samples/client/petstore-security-test/perl/deep_module_test/README.md index dfbd75f4abc..fa7a62f046a 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/README.md +++ b/samples/client/petstore-security-test/perl/deep_module_test/README.md @@ -251,10 +251,10 @@ use Something::Deep::; my $api_instance = Something::Deep::->new( ); -my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r +my $test_code_inject_*/_'_"_=end____\r\n_\n_\r = 'test_code_inject_*/_'_"_=end____\r\n_\n_\r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { - $api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r); + $api_instance->test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r); }; if ($@) { warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n"; diff --git a/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md b/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md index 35f56434164..bafb5c09467 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md +++ b/samples/client/petstore-security-test/perl/deep_module_test/docs/FakeApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **test_code_inject____end__rn_n_r** -> test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r) +> test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r) To test code injection */ ' \" =_end -- \\r\\n \\n \\r @@ -24,10 +24,10 @@ use Something::Deep::FakeApi; my $api_instance = Something::Deep::FakeApi->new( ); -my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r +my $test_code_inject_*/_'_"_=end____\r\n_\n_\r = 'test_code_inject_*/_'_"_=end____\r\n_\n_\r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { - $api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r); + $api_instance->test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r); }; if ($@) { warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n"; @@ -38,7 +38,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **test code inject */ ' " =end __ \r\n \n \r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional] + **test_code_inject_*/_'_"_=end____\r\n_\n_\r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional] ### Return type diff --git a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm index 33c0f7b3936..ef60e30b9a9 100644 --- a/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm +++ b/samples/client/petstore-security-test/perl/deep_module_test/lib/Something/Deep/FakeApi.pm @@ -53,10 +53,10 @@ sub new { # # To test code injection */ ' \" =_end -- \\r\\n \\n \\r # -# @param string $test code inject */ ' " =end __ \r\n \n \r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional) +# @param string $test_code_inject_*/_'_"_=end____\r\n_\n_\r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional) { my $params = { - 'test code inject */ ' " =end __ \r\n \n \r' => { + 'test_code_inject_*/_'_"_=end____\r\n_\n_\r' => { data_type => 'string', description => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r', required => '0', @@ -89,8 +89,8 @@ sub test_code_inject____end__rn_n_r { $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ \" =_end -- '); # form params - if ( exists $args{'test code inject */ ' " =end __ \r\n \n \r'} ) { - $form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end __ \r\n \n \r'}); + if ( exists $args{'test_code_inject_*/_'_"_=end____\r\n_\n_\r'} ) { + $form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test_code_inject_*/_'_"_=end____\r\n_\n_\r'}); } my $_body_data; diff --git a/samples/client/petstore-security-test/perl/docs/FakeApi.md b/samples/client/petstore-security-test/perl/docs/FakeApi.md index fbea6c1fc8d..ce7fac2f822 100644 --- a/samples/client/petstore-security-test/perl/docs/FakeApi.md +++ b/samples/client/petstore-security-test/perl/docs/FakeApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **test_code_inject____end__rn_n_r** -> test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r) +> test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r) To test code injection */ ' \" =_end -- \\r\\n \\n \\r @@ -24,10 +24,10 @@ use WWW::SwaggerClient::FakeApi; my $api_instance = WWW::SwaggerClient::FakeApi->new( ); -my $test code inject */ ' " =end __ \r\n \n \r = 'test code inject */ ' " =end __ \r\n \n \r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r +my $test_code_inject_*/_'_"_=end____\r\n_\n_\r = 'test_code_inject_*/_'_"_=end____\r\n_\n_\r_example'; # string | To test code injection */ ' \" =_end -- \\r\\n \\n \\r eval { - $api_instance->test_code_inject____end__rn_n_r(test code inject */ ' " =end __ \r\n \n \r => $test code inject */ ' " =end __ \r\n \n \r); + $api_instance->test_code_inject____end__rn_n_r(test_code_inject_*/_'_"_=end____\r\n_\n_\r => $test_code_inject_*/_'_"_=end____\r\n_\n_\r); }; if ($@) { warn "Exception when calling FakeApi->test_code_inject____end__rn_n_r: $@\n"; @@ -38,7 +38,7 @@ if ($@) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **test code inject */ ' " =end __ \r\n \n \r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional] + **test_code_inject_*/_'_"_=end____\r\n_\n_\r** | **string**| To test code injection */ ' \" =_end -- \\r\\n \\n \\r | [optional] ### Return type diff --git a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm index 79318d9180b..db8e379beec 100644 --- a/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore-security-test/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -53,10 +53,10 @@ sub new { # # To test code injection */ ' \" =_end -- \\r\\n \\n \\r # -# @param string $test code inject */ ' " =end __ \r\n \n \r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional) +# @param string $test_code_inject_*/_'_"_=end____\r\n_\n_\r To test code injection */ ' \" =_end -- \\r\\n \\n \\r (optional) { my $params = { - 'test code inject */ ' " =end __ \r\n \n \r' => { + 'test_code_inject_*/_'_"_=end____\r\n_\n_\r' => { data_type => 'string', description => 'To test code injection */ ' \" =_end -- \\r\\n \\n \\r', required => '0', @@ -89,8 +89,8 @@ sub test_code_inject____end__rn_n_r { $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ \" =_end -- '); # form params - if ( exists $args{'test code inject */ ' " =end __ \r\n \n \r'} ) { - $form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test code inject */ ' " =end __ \r\n \n \r'}); + if ( exists $args{'test_code_inject_*/_'_"_=end____\r\n_\n_\r'} ) { + $form_params->{'test code inject */ ' " =end -- \r\n \n \r'} = $self->{api_client}->to_form_value($args{'test_code_inject_*/_'_"_=end____\r\n_\n_\r'}); } my $_body_data; diff --git a/samples/client/petstore-security-test/python/petstore_api/api_client.py b/samples/client/petstore-security-test/python/petstore_api/api_client.py index 0325d3bad9e..ea9f0084ba5 100644 --- a/samples/client/petstore-security-test/python/petstore_api/api_client.py +++ b/samples/client/petstore-security-test/python/petstore_api/api_client.py @@ -283,7 +283,7 @@ def call_api(self, resource_path, method, _request_timeout=None): """ Makes the HTTP request (synchronous) and return the deserialized data. - To make an async request, define a function for callback. + To make an async request, set the async parameter. :param resource_path: Path to method endpoint. :param method: Method to call. @@ -307,10 +307,10 @@ def call_api(self, resource_path, method, :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: - If provide parameter callback, + If async parameter is True, the request will be called asynchronously. The method will return the request thread. - If parameter callback is None, + If parameter async is False or missing, then the method will return the response directly. """ if not async: diff --git a/samples/client/petstore-security-test/python/petstore_api/configuration.py b/samples/client/petstore-security-test/python/petstore_api/configuration.py index 3da74bb2f43..da9d119a09e 100644 --- a/samples/client/petstore-security-test/python/petstore_api/configuration.py +++ b/samples/client/petstore-security-test/python/petstore_api/configuration.py @@ -15,14 +15,30 @@ import urllib3 -import sys +import copy import logging +import multiprocessing +import sys from six import iteritems +from six import with_metaclass from six.moves import http_client as httplib +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default == None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) -class Configuration(object): + +class Configuration(with_metaclass(TypeWithDefault, object)): """ NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen @@ -75,6 +91,16 @@ def __init__(self): self.cert_file = None # client key file self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + # Proxy URL self.proxy = None diff --git a/samples/client/petstore-security-test/python/petstore_api/rest.py b/samples/client/petstore-security-test/python/petstore_api/rest.py index 46fbdbb63bb..8ccd6a6f5e5 100644 --- a/samples/client/petstore-security-test/python/petstore_api/rest.py +++ b/samples/client/petstore-security-test/python/petstore_api/rest.py @@ -56,7 +56,7 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=4): + def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 @@ -76,6 +76,16 @@ def __init__(self, configuration, pools_size=4, maxsize=4): # if not set certificate file, use Mozilla's root certificates. ca_certs = certifi.where() + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + # https pool manager if configuration.proxy: self.pool_manager = urllib3.ProxyManager( @@ -85,7 +95,8 @@ def __init__(self, configuration, pools_size=4, maxsize=4): ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, - proxy_url=configuration.proxy + proxy_url=configuration.proxy, + **addition_pool_args ) else: self.pool_manager = urllib3.PoolManager( @@ -94,7 +105,8 @@ def __init__(self, configuration, pools_size=4, maxsize=4): cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, - key_file=configuration.key_file + key_file=configuration.key_file, + **addition_pool_args ) def request(self, method, url, query_params=None, headers=None, diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.cpp b/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.cpp index e7d60bc8ba0..771940cd241 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.cpp +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.cpp @@ -29,7 +29,7 @@ SWGFakeApi::SWGFakeApi(QString host, QString basePath) { } void -SWGFakeApi::testCodeInject */ ' " =end \r\n \n \r(QString* test_code_inject____end____rn_n_r) { +SWGFakeApi::testCodeInject____end__rn_n_r(QString* test_code_inject____end____rn_n_r) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/fake"); @@ -45,16 +45,20 @@ SWGFakeApi::testCodeInject */ ' " =end \r\n \n \r(QString* test_c + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + connect(worker, &HttpRequestWorker::on_execution_finished, this, - &SWGFakeApi::testCodeInject */ ' " =end \r\n \n \rCallback); + &SWGFakeApi::testCodeInject____end__rn_n_rCallback); worker->execute(&input); } void -SWGFakeApi::testCodeInject */ ' " =end \r\n \n \rCallback(HttpRequestWorker * worker) { +SWGFakeApi::testCodeInject____end__rn_n_rCallback(HttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -68,8 +72,12 @@ SWGFakeApi::testCodeInject */ ' " =end \r\n \n \rCallback(HttpReq worker->deleteLater(); - emit testCodeInject */ ' " =end \r\n \n \rSignal(); - emit testCodeInject */ ' " =end \r\n \n \rSignalE(error_type, error_str); + if (worker->error_type == QNetworkReply::NoError) { + emit testCodeInject____end__rn_n_rSignal(); + } else { + emit testCodeInject____end__rn_n_rSignalE(error_type, error_str); + emit testCodeInject____end__rn_n_rSignalEFull(worker, error_type, error_str); + } } diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.h b/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.h index 5a28a4ce2c9..087e498423f 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.h +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGFakeApi.h @@ -31,16 +31,19 @@ class SWGFakeApi: public QObject { QString host; QString basePath; + QMap defaultHeaders; - void testCodeInject */ ' " =end \r\n \n \r(QString* test_code_inject____end____rn_n_r); + void testCodeInject____end__rn_n_r(QString* test_code_inject____end____rn_n_r); private: - void testCodeInject */ ' " =end \r\n \n \rCallback (HttpRequestWorker * worker); + void testCodeInject____end__rn_n_rCallback (HttpRequestWorker * worker); signals: - void testCodeInject */ ' " =end \r\n \n \rSignal(); + void testCodeInject____end__rn_n_rSignal(); - void testCodeInject */ ' " =end \r\n \n \rSignalE(QNetworkReply::NetworkError error_type, QString& error_str); + void testCodeInject____end__rn_n_rSignalE(QNetworkReply::NetworkError error_type, QString& error_str); + + void testCodeInject____end__rn_n_rSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); }; diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.cpp b/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.cpp index 2300fb2753b..7ad7930206c 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.cpp +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.cpp @@ -262,6 +262,9 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { // prepare connection QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); + if (HttpRequestWorker::sslDefaultConfiguration != nullptr) { + request.setSslConfiguration(*HttpRequestWorker::sslDefaultConfiguration); + } request.setRawHeader("User-Agent", "Swagger-Client"); foreach(QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); @@ -309,16 +312,14 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); - if (error_type == QNetworkReply::NoError) { - response = reply->readAll(); - } - else { - error_str = reply->errorString(); - } + response = reply->readAll(); + error_str = reply->errorString(); reply->deleteLater(); emit on_execution_finished(this); } +QSslConfiguration* HttpRequestWorker::sslDefaultConfiguration; + } diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.h b/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.h index 045bcd9c075..5e14062e162 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.h +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGHttpRequest.h @@ -73,6 +73,7 @@ class HttpRequestWorker : public QObject { QString http_attribute_encode(QString attribute_name, QString input); void execute(HttpRequestInput *input); + static QSslConfiguration* sslDefaultConfiguration; signals: void on_execution_finished(HttpRequestWorker *worker); diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.cpp b/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.cpp index fc4cd89e5aa..c549fb37ace 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.cpp +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.cpp @@ -37,7 +37,7 @@ SWGReturn::~SWGReturn() { void SWGReturn::init() { - return = 0; + _return = 0; } void @@ -56,7 +56,7 @@ SWGReturn::fromJson(QString &json) { void SWGReturn::fromJsonObject(QJsonObject &pJson) { - ::Swagger::setValue(&return, pJson["return"], "qint32", ""); + ::Swagger::setValue(&_return, pJson["return"], "qint32", ""); } QString @@ -73,18 +73,18 @@ QJsonObject* SWGReturn::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("return", QJsonValue(return)); + obj->insert("return", QJsonValue(_return)); return obj; } qint32 SWGReturn::getReturn() { - return return; + return _return; } void -SWGReturn::setReturn(qint32 return) { - this->return = return; +SWGReturn::setReturn(qint32 _return) { + this->_return = _return; } diff --git a/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.h b/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.h index 778899dbe3a..0988110ae28 100644 --- a/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.h +++ b/samples/client/petstore-security-test/qt5cpp/client/SWGReturn.h @@ -42,11 +42,11 @@ class SWGReturn: public SWGObject { SWGReturn* fromJson(QString &jsonString); qint32 getReturn(); - void setReturn(qint32 return); + void setReturn(qint32 _return); private: - qint32 return; + qint32 _return; }; } diff --git a/samples/client/petstore-security-test/ruby/lib/petstore.rb b/samples/client/petstore-security-test/ruby/lib/petstore.rb index c85b301c423..5c6e14b6a4a 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore.rb @@ -6,6 +6,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 =end diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore-security-test/ruby/lib/petstore/api/fake_api.rb index 9c15fc51e88..62ba6e73b8f 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/api/fake_api.rb @@ -6,6 +6,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 =end diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/api_client.rb b/samples/client/petstore-security-test/ruby/lib/petstore/api_client.rb index 8695f6e89c1..9c68cfea20d 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/api_client.rb @@ -6,6 +6,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 =end @@ -122,7 +123,9 @@ def build_request(http_method, path, opts = {}) end end - Typhoeus::Request.new(url, req_opts) + request = Typhoeus::Request.new(url, req_opts) + download_file(request) if opts[:return_type] == 'File' + request end # Check if the given MIME is a JSON MIME. @@ -143,14 +146,16 @@ def json_mime?(mime) # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]" def deserialize(response, return_type) body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + return nil if body.nil? || body.empty? # return response body directly for String return type return body if return_type == 'String' - # handle file downloading - save response body into a tmp file and return the File instance - return download_file(response) if return_type == 'File' - # ensuring a default content type content_type = response.headers['Content-Type'] || 'application/json' @@ -213,30 +218,38 @@ def convert_to_type(data, return_type) # Save response body into a file in (the defined) temporary folder, using the filename # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. # # @see Configuration#temp_folder_path - # @return [Tempfile] the file downloaded - def download_file(response) - content_disposition = response.headers['Content-Disposition'] - if content_disposition and content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - + def download_file(request) tempfile = nil - encoding = response.body.encoding - Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) do |file| - file.write(response.body) - tempfile = file + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition and content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" end - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - tempfile end # Sanitize filename by removing path. @@ -267,7 +280,7 @@ def build_request_body(header_params, form_params, body) data = {} form_params.each do |key, value| case value - when File, Array, nil + when ::File, ::Array, nil # let typhoeus handle File, Array and nil parameters data[key] = value else diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/api_error.rb b/samples/client/petstore-security-test/ruby/lib/petstore/api_error.rb index 27fc3cf9ad4..27fd7c1a8ef 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/api_error.rb @@ -6,6 +6,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 =end diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/configuration.rb b/samples/client/petstore-security-test/ruby/lib/petstore/configuration.rb index 630b1dd6681..78fcfc16030 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/configuration.rb @@ -6,6 +6,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 =end @@ -75,6 +76,11 @@ class Configuration # Default to 0 (never times out). attr_accessor :timeout + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + ### TLS/SSL setting # Set this to false to skip verifying SSL certificate when calling API from https server. # Default to true. @@ -128,6 +134,7 @@ def initialize @api_key = {} @api_key_prefix = {} @timeout = 0 + @client_side_validation = true @verify_ssl = true @verify_ssl_host = true @params_encoding = nil diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb index 9c4d50023c7..9e6ffd465a7 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb @@ -6,6 +6,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 =end diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/version.rb b/samples/client/petstore-security-test/ruby/lib/petstore/version.rb index 4b5eadf50a1..c6ba3189c52 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/version.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/version.rb @@ -6,6 +6,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 =end diff --git a/samples/client/petstore-security-test/ruby/petstore.gemspec b/samples/client/petstore-security-test/ruby/petstore.gemspec index eb2a20c6607..51d168e828b 100644 --- a/samples/client/petstore-security-test/ruby/petstore.gemspec +++ b/samples/client/petstore-security-test/ruby/petstore.gemspec @@ -8,6 +8,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 =end @@ -28,15 +29,15 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11' + s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/samples/client/petstore-security-test/scala/pom.xml b/samples/client/petstore-security-test/scala/pom.xml index 81bcd8887f4..eceb1e6fdc4 100644 --- a/samples/client/petstore-security-test/scala/pom.xml +++ b/samples/client/petstore-security-test/scala/pom.xml @@ -153,7 +153,7 @@ com.fasterxml.jackson.module - jackson-module-scala_2.10 + jackson-module-scala_2.11 ${jackson-version} @@ -189,7 +189,7 @@ org.scalatest - scalatest_2.10 + scalatest_2.11 ${scala-test-version} test @@ -211,16 +211,16 @@ com.wordnik.swagger - swagger-async-httpclient_2.10 + swagger-async-httpclient_2.11 ${swagger-async-httpclient-version} - 2.10.4 + 2.11.11 1.2 2.2 1.19 - 1.5.15 + 1.5.16 1.0.5 1.0.0 2.8.9 diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala index 182c49fc99d..5d31e36a762 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala @@ -28,7 +28,7 @@ import java.util.UUID import javax.ws.rs.core.MediaType import scala.collection.JavaConverters._ -import scala.collection.mutable.HashMap +import scala.collection.mutable import com.fasterxml.jackson.module.scala.DefaultScalaModule import com.fasterxml.jackson.datatype.joda.JodaModule @@ -41,8 +41,8 @@ object ScalaJsonUtil { def getJsonMapper = { val mapper = new ObjectMapper() mapper.registerModule(new DefaultScalaModule()) - mapper.registerModule(new JodaModule()); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.registerModule(new JodaModule()) + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT) mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -52,13 +52,14 @@ object ScalaJsonUtil { } class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, - httpHeaders: HashMap[String, String] = HashMap(), - hostMap: HashMap[String, Client] = HashMap(), + httpHeaders: mutable.HashMap[String, String] = mutable.HashMap(), + hostMap: mutable.HashMap[String, Client] = mutable.HashMap(), asyncHttpClient: Boolean = false, authScheme: String = "", - authPreemptive: Boolean = false) { + authPreemptive: Boolean = false +) { - var defaultHeaders: HashMap[String, String] = httpHeaders + var defaultHeaders: mutable.HashMap[String, String] = httpHeaders def escape(value: String): String = { URLEncoder.encode(value, "utf-8").replaceAll("\\+", "%20") @@ -68,11 +69,8 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, } def escape(value: Long): String = value.toString - def escape(value: Double): String = value.toString - def escape(value: Float): String = value.toString - def escape(value: UUID): String = value.toString def deserialize(json: String, containerType: String, cls: Class[_]) = { @@ -89,16 +87,16 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, } else { containerType.toLowerCase match { case "array" => - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList case "list" => - val typeInfo = mapper.getTypeFactory().constructCollectionType(classOf[java.util.List[_]], cls) + val typeInfo = mapper.getTypeFactory.constructCollectionType(classOf[java.util.List[_]], cls) val response = mapper.readValue(json, typeInfo).asInstanceOf[java.util.List[_]] response.asScala.toList case _ => json match { - case e: String if ("\"\"" == e) => null + case e: String if "\"\"" == e => null case _ => mapper.readValue(json, cls) } } @@ -111,16 +109,27 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, case e: List[_] => mapper.writeValueAsString(obj.asInstanceOf[List[_]].asJava) case _ => mapper.writeValueAsString(obj) } - } else null + } else { + null + } } - def invokeApi(host: String, path: String, method: String, queryParams: Map[String, String], formParams: Map[String, String], body: AnyRef, headerParams: Map[String, String], contentType: String): String = { + def invokeApi( + host: String, + path: String, + method: String, + queryParams: Map[String, String], + formParams: Map[String, String], + body: AnyRef, + headerParams: Map[String, String], + contentType: String +): String = { val client = getClient(host) - val querystring = queryParams.filter(k => k._2 != null).map(k => (escape(k._1) + "=" + escape(k._2))).mkString("?", "&", "") + val querystring = queryParams.filter(k => k._2 != null).map(k => escape(k._1) + "=" + escape(k._2)).mkString("?", "&", "") val builder = client.resource(host + path + querystring).accept(contentType) headerParams.map(p => builder.header(p._1, p._2)) - defaultHeaders.map(p => { + defaultHeaders.foreach(p => { headerParams.contains(p._1) match { case true => // override default with supplied header case false => if (p._2 != null) builder.header(p._1, p._2) @@ -129,18 +138,18 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, var formData: MultivaluedMapImpl = null if (contentType == "application/x-www-form-urlencoded") { formData = new MultivaluedMapImpl() - formParams.map(p => formData.add(p._1, p._2)) + formParams.foreach(p => formData.add(p._1, p._2)) } val response: ClientResponse = method match { case "GET" => builder.get(classOf[ClientResponse]).asInstanceOf[ClientResponse] case "POST" => - if (formData != null) { - builder.post(classOf[ClientResponse], formData) + if (formData != null && formData.size() > 0) { + builder.post(classOf[ClientResponse], formData) } else if (body != null && body.isInstanceOf[File]) { val file = body.asInstanceOf[File] val form = new FormDataMultiPart() - form.field("filename", file.getName()) + form.field("filename", file.getName) form.bodyPart(new FileDataBodyPart("file", file, MediaType.MULTIPART_FORM_DATA_TYPE)) builder.post(classOf[ClientResponse], form) } else { @@ -151,36 +160,37 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, } } case "PUT" => - if (formData != null) builder.post(classOf[ClientResponse], formData) - else if (body == null) builder.put(classOf[ClientResponse], null) - else builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) - case "DELETE" => builder.delete(classOf[ClientResponse]) - case "PATCH" => { if (formData != null) { - builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + builder.post(classOf[ClientResponse], formData) } else if (body == null) { + builder.put(classOf[ClientResponse], null) + } else { + builder.`type`(contentType).put(classOf[ClientResponse], serialize(body)) + } + case "DELETE" => builder.delete(classOf[ClientResponse]) + case "PATCH" => + if(formData != null) { + builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], formData) + } else if(body == null) { builder.header("X-HTTP-Method-Override", "PATCH").post(classOf[ClientResponse], null) } else { builder.header("X-HTTP-Method-Override", "PATCH").`type`(contentType).post(classOf[ClientResponse], serialize(body)) } - } case _ => null } - response.getStatusInfo().getStatusCode() match { + response.getStatusInfo.getStatusCode match { case 204 => "" - case code: Int if (Range(200, 299).contains(code)) => - response.hasEntity() match { + case code: Int if Range(200, 299).contains(code) => + response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "" } case _ => - val entity = response.hasEntity() match { + val entity = response.hasEntity match { case true => response.getEntity(classOf[String]) case false => "no data" } - throw new ApiException( - response.getStatusInfo().getStatusCode(), - entity) + throw new ApiException(response.getStatusInfo.getStatusCode, entity) } } @@ -192,7 +202,7 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, // client.addFilter(new LoggingFilter()) hostMap += host -> client client - } + } } def newClient(host: String): Client = asyncHttpClient match { @@ -204,9 +214,10 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, val config: DefaultAhcConfig = new DefaultAhcConfig() if (!authScheme.isEmpty) { val authSchemeEnum = Realm.AuthScheme.valueOf(authScheme) - config.getAsyncHttpClientConfigBuilder + config + .getAsyncHttpClientConfigBuilder .setRealm(new Realm.RealmBuilder().setScheme(authSchemeEnum) - .setUsePreemptiveAuth(authPreemptive).build) + .setUsePreemptiveAuth(authPreemptive).build) } AhcHttpClient.create(config) case _ => Client.create() @@ -215,8 +226,8 @@ class ApiInvoker(val mapper: ObjectMapper = ScalaJsonUtil.getJsonMapper, object ApiInvoker extends ApiInvoker( mapper = ScalaJsonUtil.getJsonMapper, - httpHeaders = HashMap(), - hostMap = HashMap(), + httpHeaders = mutable.HashMap(), + hostMap = mutable.HashMap(), asyncHttpClient = false, authScheme = "", authPreemptive = false diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala index 83acded275f..05a73b29609 100644 --- a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala +++ b/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala @@ -40,8 +40,10 @@ import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{Failure, Success, Try} -class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r", - defApiInvoker: ApiInvoker = ApiInvoker) { +class FakeApi( + val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r", + defApiInvoker: ApiInvoker = ApiInvoker +) { implicit val formats = new org.json4s.DefaultFormats { override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000") @@ -53,10 +55,12 @@ class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =e implicit val stringWriter = RequestWriters.StringWriter implicit val jsonWriter = JsonFormatsWriter - var basePath = defBasePath - var apiInvoker = defApiInvoker + var basePath: String = defBasePath + var apiInvoker: ApiInvoker = defApiInvoker - def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value + def addHeader(key: String, value: String): mutable.HashMap[String, String] = { + apiInvoker.defaultHeaders += key -> value + } val config = SwaggerConfig.forUrl(new URI(defBasePath)) val client = new RestClient(config) @@ -86,7 +90,6 @@ class FakeApi(val defBasePath: String = "https://petstore.swagger.io *_/ ' \" =e helper.testCodeInject * ' " =end rn n r(testCodeInjectEndRnNR) } - } class FakeApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { diff --git a/samples/client/petstore-security-test/typescript-angular/.gitignore b/samples/client/petstore-security-test/typescript-angular/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore-security-test/typescript-angular/.gitignore +++ b/samples/client/petstore-security-test/typescript-angular/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore-security-test/typescript-angular/.swagger-codegen/VERSION b/samples/client/petstore-security-test/typescript-angular/.swagger-codegen/VERSION index 6b4d1577382..f9f7450d135 100644 --- a/samples/client/petstore-security-test/typescript-angular/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/typescript-angular/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3 \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-angular/api.module.ts b/samples/client/petstore-security-test/typescript-angular/api.module.ts index daa111453ca..c3bde487bc4 100644 --- a/samples/client/petstore-security-test/typescript-angular/api.module.ts +++ b/samples/client/petstore-security-test/typescript-angular/api.module.ts @@ -1,7 +1,21 @@ -import * as api from './api/api'; -import * as angular from 'angular'; +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HttpModule } from '@angular/http'; +import { Configuration } from './configuration'; -const apiModule = angular.module('api', []) -.service('FakeApi', api.FakeApi) +import { FakeService } from './api/fake.service'; -export default apiModule; +@NgModule({ + imports: [ CommonModule, HttpModule ], + declarations: [], + exports: [], + providers: [ FakeService ] +}) +export class ApiModule { + public static forConfig(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ {provide: Configuration, useFactory: configurationFactory}] + } + } +} diff --git a/samples/client/petstore-security-test/typescript-angular/api/api.ts b/samples/client/petstore-security-test/typescript-angular/api/api.ts index 4c0b3c9f56b..1457e1d01f4 100644 --- a/samples/client/petstore-security-test/typescript-angular/api/api.ts +++ b/samples/client/petstore-security-test/typescript-angular/api/api.ts @@ -1,3 +1,3 @@ -export * from './FakeApi'; -import { FakeApi } from './FakeApi'; -export const APIS = [FakeApi]; +export * from './fake.service'; +import { FakeService } from './fake.service'; +export const APIS = [FakeService]; diff --git a/samples/client/petstore-security-test/typescript-angular/index.ts b/samples/client/petstore-security-test/typescript-angular/index.ts index 557365516ad..c312b70fa3e 100644 --- a/samples/client/petstore-security-test/typescript-angular/index.ts +++ b/samples/client/petstore-security-test/typescript-angular/index.ts @@ -1,2 +1,5 @@ export * from './api/api'; -export * from './model/models'; \ No newline at end of file +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-angular/model/ModelReturn.ts b/samples/client/petstore-security-test/typescript-angular/model/ModelReturn.ts index 0440a6393c6..e2360156a9d 100644 --- a/samples/client/petstore-security-test/typescript-angular/model/ModelReturn.ts +++ b/samples/client/petstore-security-test/typescript-angular/model/ModelReturn.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import * as models from './models'; + /** * Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r @@ -19,6 +19,8 @@ export interface ModelReturn { /** * property description *_/ ' \" =end -- \\r\\n \\n \\r */ - "return"?: number; + return?: number; + } + diff --git a/samples/client/petstore-security-test/typescript-angular/model/models.ts b/samples/client/petstore-security-test/typescript-angular/model/models.ts index df8a2d48008..bca4c78d6b0 100644 --- a/samples/client/petstore-security-test/typescript-angular/model/models.ts +++ b/samples/client/petstore-security-test/typescript-angular/model/models.ts @@ -1 +1 @@ -export * from './ModelReturn'; +export * from './modelReturn'; diff --git a/samples/client/petstore-security-test/typescript-angular2/.swagger-codegen/VERSION b/samples/client/petstore-security-test/typescript-angular2/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore-security-test/typescript-angular2/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/typescript-angular2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-angular2/api.module.ts b/samples/client/petstore-security-test/typescript-angular2/api.module.ts index 4ed0510d0d1..c3bde487bc4 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api.module.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api.module.ts @@ -12,10 +12,10 @@ import { FakeService } from './api/fake.service'; providers: [ FakeService ] }) export class ApiModule { - public static forConfig(configuration: Configuration): ModuleWithProviders { + public static forConfig(configurationFactory: () => Configuration): ModuleWithProviders { return { ngModule: ApiModule, - providers: [ {provide: Configuration, useValue: configuration}] + providers: [ {provide: Configuration, useFactory: configurationFactory}] } } } diff --git a/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts b/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts index ec12093e92c..ec51d332251 100644 --- a/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts +++ b/samples/client/petstore-security-test/typescript-angular2/api/fake.service.ts @@ -10,10 +10,10 @@ * Do not edit the class manually. */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; -import { Http, Headers, URLSearchParams } from '@angular/http'; -import { RequestMethod, RequestOptions, RequestOptionsArgs } from '@angular/http'; -import { Response, ResponseContentType } from '@angular/http'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; @@ -21,41 +21,26 @@ import '../rxjs-operators'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; - -/* tslint:disable:no-unused-variable member-ordering */ +import { CustomHttpUrlEncodingCodec } from '../encoder'; @Injectable() export class FakeService { + protected basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r'; - public defaultHeaders: Headers = new Headers(); - public configuration: Configuration = new Configuration(); + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); - constructor(protected http: Http, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; + this.basePath = basePath || configuration.basePath || this.basePath; } } - /** - * - * Extends object by coping non-existing properties. - * @param objA object to be extended - * @param objB source object - */ - private extendObj(objA: T1, objB: T2) { - for(let key in objB){ - if(objB.hasOwnProperty(key)){ - (objA as any)[key] = (objB as any)[key]; - } - } - return objA; - } - /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -70,21 +55,6 @@ export class FakeService { return false; } - /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - * - * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - */ - public testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any): Observable<{}> { - return this.testCodeInjectEndRnNRWithHttpInfo(test code inject * ' " =end rn n r, extraHttpRequestParams) - .map((response: Response) => { - if (response.status === 204) { - return undefined; - } else { - return response.json() || {}; - } - }); - } /** @@ -92,47 +62,37 @@ export class FakeService { * * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r */ - public testCodeInjectEndRnNRWithHttpInfo(test code inject * ' " =end rn n r?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + '/fake'; + public testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string): Observable<{}> { - let queryParameters = new URLSearchParams(); - let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 + let headers = this.defaultHeaders; // to determine the Content-Type header let consumes: string[] = [ - 'application/json', + 'application/json', '*_/ =end -- ' ]; - let canConsumeForm = this.canConsumeForm(consumes); + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; let useForm = false; - let formParams = new (useForm ? FormData : URLSearchParams as any)() as { - set(param: string, value: any): void; - }; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + - // to determine the Accept header - let produces: string[] = [ - 'application/json', - '*_/ =end -- ' - ]; - if (test code inject * ' " =end rn n r !== undefined) { - formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); + formParams = formParams.append('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r) || formParams; } - let requestOptions: RequestOptionsArgs = new RequestOptions({ - method: RequestMethod.Put, + return this.httpClient.put(`${this.basePath}/fake`, + convertFormParamsToString ? formParams.toString() : formParams, { headers: headers, - body: formParams.toString(), - search: queryParameters, - withCredentials:this.configuration.withCredentials + withCredentials: this.configuration.withCredentials, }); - // https://github.com/swagger-api/swagger-codegen/issues/4037 - if (extraHttpRequestParams) { - requestOptions = (Object).assign(requestOptions, extraHttpRequestParams); - } - - return this.http.request(path, requestOptions); } } diff --git a/samples/client/petstore-security-test/typescript-angular2/configuration.ts b/samples/client/petstore-security-test/typescript-angular2/configuration.ts index 0eed43fd575..005c3a26df3 100644 --- a/samples/client/petstore-security-test/typescript-angular2/configuration.ts +++ b/samples/client/petstore-security-test/typescript-angular2/configuration.ts @@ -2,18 +2,18 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string; + accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; } export class Configuration { - apiKeys: {[ key: string ]: string}; - username: string; - password: string; - accessToken: string | (() => string); - basePath: string; - withCredentials: boolean; + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; diff --git a/samples/client/petstore-security-test/typescript-angular2/model/ModelReturn.ts b/samples/client/petstore-security-test/typescript-angular2/model/ModelReturn.ts index 170661be61a..e2360156a9d 100644 --- a/samples/client/petstore-security-test/typescript-angular2/model/ModelReturn.ts +++ b/samples/client/petstore-security-test/typescript-angular2/model/ModelReturn.ts @@ -22,3 +22,5 @@ export interface ModelReturn { return?: number; } + + diff --git a/samples/client/petstore-security-test/typescript-angular2/variables.ts b/samples/client/petstore-security-test/typescript-angular2/variables.ts index b734b2e5918..6fe58549f39 100644 --- a/samples/client/petstore-security-test/typescript-angular2/variables.ts +++ b/samples/client/petstore-security-test/typescript-angular2/variables.ts @@ -1,4 +1,4 @@ -import { InjectionToken } from '@angular/core'; +import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { @@ -6,4 +6,4 @@ export const COLLECTION_FORMATS = { 'tsv': ' ', 'ssv': ' ', 'pipes': '|' -} \ No newline at end of file +} diff --git a/samples/client/petstore-security-test/typescript-fetch/api.ts b/samples/client/petstore-security-test/typescript-fetch/api.ts index 7e8b409725e..5146ea641b6 100644 --- a/samples/client/petstore-security-test/typescript-fetch/api.ts +++ b/samples/client/petstore-security-test/typescript-fetch/api.ts @@ -10,7 +10,7 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ - + import * as url from "url"; import * as isomorphicFetch from "isomorphic-fetch"; @@ -18,7 +18,11 @@ import { Configuration } from "./configuration"; const BASE_PATH = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r".replace(/\/+$/, ""); -const COLLECTION_FORMATS = { +/** + * + * @export + */ +export const COLLECTION_FORMATS = { csv: ",", ssv: " ", tsv: "\t", @@ -102,26 +106,28 @@ export const FakeApiFetchParamCreator = function (configuration?: Configuration) * @throws {RequiredError} */ testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options: any = {}): FetchArgs { - const path = `/fake`; - const urlObj = url.parse(path, true); - const requestOptions = Object.assign({ method: 'PUT' }, options); - const headerParameter = {} as any; - const queryParameter = {} as any; - const formParams = new url.URLSearchParams(); + const localVarPath = `/fake`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new url.URLSearchParams(); if (test code inject * ' " =end rn n r !== undefined) { - formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r as any); + localVarFormParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r as any); } - headerParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - urlObj.query = Object.assign({}, urlObj.query, queryParameter, options.query); - requestOptions.headers = Object.assign({}, headerParameter, options.headers); - requestOptions.body = formParams.toString(); + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams.toString(); return { - url: url.format(urlObj), - options: requestOptions, + url: url.format(localVarUrlObj), + options: localVarRequestOptions, }; }, } @@ -141,9 +147,9 @@ export const FakeApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = FakeApiFetchParamCreator(configuration).testCodeInjectEndRnNR(test code inject * ' " =end rn n r, options); + const localVarFetchArgs = FakeApiFetchParamCreator(configuration).testCodeInjectEndRnNR(test code inject * ' " =end rn n r, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { return response; } else { diff --git a/samples/client/petstore-security-test/typescript-fetch/configuration.ts b/samples/client/petstore-security-test/typescript-fetch/configuration.ts index 8dd6dd60c63..06288872871 100644 --- a/samples/client/petstore-security-test/typescript-fetch/configuration.ts +++ b/samples/client/petstore-security-test/typescript-fetch/configuration.ts @@ -10,7 +10,7 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ - + export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); diff --git a/samples/client/petstore-security-test/typescript-fetch/index.ts b/samples/client/petstore-security-test/typescript-fetch/index.ts index bcb691f7489..2670610eb94 100644 --- a/samples/client/petstore-security-test/typescript-fetch/index.ts +++ b/samples/client/petstore-security-test/typescript-fetch/index.ts @@ -10,7 +10,7 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ - + export * from "./api"; export * from "./configuration"; diff --git a/samples/client/petstore-security-test/typescript-node/api.ts b/samples/client/petstore-security-test/typescript-node/api.ts index 47fb8499ec1..dbc8f6e5c4b 100644 --- a/samples/client/petstore-security-test/typescript-node/api.ts +++ b/samples/client/petstore-security-test/typescript-node/api.ts @@ -269,8 +269,8 @@ export class FakeApi { this.authentications.petstore_auth.accessToken = token; } /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * + * @summary To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r */ public testCodeInjectEndRnNR (test code inject * ' " =end rn n r?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { @@ -280,7 +280,6 @@ export class FakeApi { let formParams: any = {}; - let useFormData = false; if (test code inject * ' " =end rn n r !== undefined) { diff --git a/samples/server/petstore-security-test/silex/SwaggerServer/index.php b/samples/server/petstore-security-test/silex/SwaggerServer/index.php index 23edb3a670c..7be322ca7ea 100644 --- a/samples/server/petstore-security-test/silex/SwaggerServer/index.php +++ b/samples/server/petstore-security-test/silex/SwaggerServer/index.php @@ -9,7 +9,7 @@ $app->PUT('/v2 *_/ ' \" =end -- \\r\\n \\n \\r/fake', function(Application $app, Request $request) { - $test code inject */ ' " =end __ \r\n \n \r = $request->get('test code inject */ ' " =end __ \r\n \n \r'); + $test_code_inject_*/_'_"_=end____\r\n_\n_\r = $request->get('test_code_inject_*/_'_"_=end____\r\n_\n_\r'); return new Response('How about implementing testCodeInject */ ' " =end \r\n \n \r as a PUT method ?'); }); From 7f9ae63880713ca027d8fca4f8fb91494c9d5d8f Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 18 Oct 2017 10:39:34 +0800 Subject: [PATCH 174/197] add resteasy-all shell script --- bin/java-petstore-resteasy-all.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/java-petstore-resteasy-all.sh diff --git a/bin/java-petstore-resteasy-all.sh b/bin/java-petstore-resteasy-all.sh new file mode 100755 index 00000000000..c1a346943f7 --- /dev/null +++ b/bin/java-petstore-resteasy-all.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +./bin/java-petstore-resteasy.sh +./bin/jaxrs-resteasy-eap-petstore-server.sh +./bin/jaxrs-resteasy-eap-java8-petstore-server.sh +./bin/jaxrs-resteasy-joda-petstore-server.sh +./bin/jaxrs-resteasy-eap-joda-petstore-server.sh +./bin/jaxrs-resteasy-petstore-server.sh* From 1ac04ae13a4457459da2bb0ce42004bd596450d6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 18 Oct 2017 10:46:01 +0800 Subject: [PATCH 175/197] new files genreated by security shell scripts --- .../.swagger-codegen/VERSION | 1 + .../javascript/.babelrc | 3 + .../perl/.swagger-codegen/VERSION | 1 + .../deep_module_test/.swagger-codegen/VERSION | 1 + .../qt5cpp/.swagger-codegen/VERSION | 1 + .../ruby/.swagger-codegen/VERSION | 1 + .../typescript-angular/api/fake.service.ts | 98 +++++++++++++++++++ .../typescript-angular/configuration.ts | 26 +++++ .../typescript-angular/encoder.ts | 18 ++++ .../typescript-angular/rxjs-operators.ts | 11 +++ .../typescript-angular/variables.ts | 9 ++ .../typescript-angular2/encoder.ts | 18 ++++ .../typescript-node/.swagger-codegen/VERSION | 1 + .../lumen/.swagger-codegen/VERSION | 1 + .../silex/.swagger-codegen/VERSION | 1 + .../slim/.swagger-codegen/VERSION | 1 + 16 files changed, 192 insertions(+) create mode 100644 samples/client/petstore-security-test/javascript-closure-angular/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/javascript/.babelrc create mode 100644 samples/client/petstore-security-test/perl/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/perl/deep_module_test/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/qt5cpp/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/ruby/.swagger-codegen/VERSION create mode 100644 samples/client/petstore-security-test/typescript-angular/api/fake.service.ts create mode 100644 samples/client/petstore-security-test/typescript-angular/configuration.ts create mode 100644 samples/client/petstore-security-test/typescript-angular/encoder.ts create mode 100644 samples/client/petstore-security-test/typescript-angular/rxjs-operators.ts create mode 100644 samples/client/petstore-security-test/typescript-angular/variables.ts create mode 100644 samples/client/petstore-security-test/typescript-angular2/encoder.ts create mode 100644 samples/client/petstore-security-test/typescript-node/.swagger-codegen/VERSION create mode 100644 samples/server/petstore-security-test/lumen/.swagger-codegen/VERSION create mode 100644 samples/server/petstore-security-test/silex/.swagger-codegen/VERSION create mode 100644 samples/server/petstore-security-test/slim/.swagger-codegen/VERSION diff --git a/samples/client/petstore-security-test/javascript-closure-angular/.swagger-codegen/VERSION b/samples/client/petstore-security-test/javascript-closure-angular/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/javascript-closure-angular/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/javascript/.babelrc b/samples/client/petstore-security-test/javascript/.babelrc new file mode 100644 index 00000000000..bcb6ee8de93 --- /dev/null +++ b/samples/client/petstore-security-test/javascript/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015", "stage-0"] +} \ No newline at end of file diff --git a/samples/client/petstore-security-test/perl/.swagger-codegen/VERSION b/samples/client/petstore-security-test/perl/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/perl/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/perl/deep_module_test/.swagger-codegen/VERSION b/samples/client/petstore-security-test/perl/deep_module_test/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/perl/deep_module_test/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/qt5cpp/.swagger-codegen/VERSION b/samples/client/petstore-security-test/qt5cpp/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/qt5cpp/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/ruby/.swagger-codegen/VERSION b/samples/client/petstore-security-test/ruby/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/ruby/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-angular/api/fake.service.ts b/samples/client/petstore-security-test/typescript-angular/api/fake.service.ts new file mode 100644 index 00000000000..ec51d332251 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular/api/fake.service.ts @@ -0,0 +1,98 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * 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 -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * 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. + */ + +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +import { Observable } from 'rxjs/Observable'; +import '../rxjs-operators'; + + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + + +@Injectable() +export class FakeService { + + protected basePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (basePath) { + this.basePath = basePath; + } + if (configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (let consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + + /** + * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * + * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + */ + public testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string): Observable<{}> { + + let headers = this.defaultHeaders; + + // to determine the Content-Type header + let consumes: string[] = [ + 'application/json', + '*_/ =end -- ' + ]; + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + + + + if (test code inject * ' " =end rn n r !== undefined) { + formParams = formParams.append('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r) || formParams; + } + + return this.httpClient.put(`${this.basePath}/fake`, + convertFormParamsToString ? formParams.toString() : formParams, { + headers: headers, + withCredentials: this.configuration.withCredentials, + }); + } + +} diff --git a/samples/client/petstore-security-test/typescript-angular/configuration.ts b/samples/client/petstore-security-test/typescript-angular/configuration.ts new file mode 100644 index 00000000000..005c3a26df3 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular/configuration.ts @@ -0,0 +1,26 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } +} diff --git a/samples/client/petstore-security-test/typescript-angular/encoder.ts b/samples/client/petstore-security-test/typescript-angular/encoder.ts new file mode 100644 index 00000000000..f1c6b78c9c8 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular/encoder.ts @@ -0,0 +1,18 @@ + import { HttpUrlEncodingCodec } from '@angular/common/http'; + +/** +* CustomHttpUrlEncodingCodec +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} + diff --git a/samples/client/petstore-security-test/typescript-angular/rxjs-operators.ts b/samples/client/petstore-security-test/typescript-angular/rxjs-operators.ts new file mode 100644 index 00000000000..5659cd0694f --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular/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-security-test/typescript-angular/variables.ts b/samples/client/petstore-security-test/typescript-angular/variables.ts new file mode 100644 index 00000000000..6fe58549f39 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore-security-test/typescript-angular2/encoder.ts b/samples/client/petstore-security-test/typescript-angular2/encoder.ts new file mode 100644 index 00000000000..f1c6b78c9c8 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-angular2/encoder.ts @@ -0,0 +1,18 @@ + import { HttpUrlEncodingCodec } from '@angular/common/http'; + +/** +* CustomHttpUrlEncodingCodec +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} + diff --git a/samples/client/petstore-security-test/typescript-node/.swagger-codegen/VERSION b/samples/client/petstore-security-test/typescript-node/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-node/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/lumen/.swagger-codegen/VERSION b/samples/server/petstore-security-test/lumen/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/server/petstore-security-test/lumen/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/silex/.swagger-codegen/VERSION b/samples/server/petstore-security-test/silex/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/server/petstore-security-test/silex/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/.swagger-codegen/VERSION b/samples/server/petstore-security-test/slim/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/server/petstore-security-test/slim/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file From 5219035b3a3b324a05fc71144c7feb06534b9fc8 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Tue, 17 Oct 2017 21:47:56 -0500 Subject: [PATCH 176/197] [haskell-http-client] handle Alias models + refactoring. (#6712) * handle Alias models with newtypes * add inlineConsumesContentTypes cli option * generate swagger.yaml instead of swagger.json * check for/validate unhandled authMethods * refactoring --- .../languages/HaskellHttpClientCodegen.java | 310 +- .../haskell-http-client/API.mustache | 312 +- .../haskell-http-client/Client.mustache | 149 +- .../haskell-http-client/Core.mustache | 522 ++++ .../haskell-http-client/LoggingKatip.mustache | 6 +- .../LoggingMonadLogger.mustache | 4 +- .../haskell-http-client/MimeTypes.mustache | 91 +- .../haskell-http-client/Model.mustache | 174 +- .../{Lens.mustache => ModelLens.mustache} | 8 +- .../haskell-http-client/README.mustache | 8 +- .../haskell-http-client/TopLevel.mustache | 18 +- .../haskell-http-client/_contentType.mustache | 1 + .../haskell-http-client.cabal.mustache | 9 +- .../haskell-http-client/swagger.mustache | 1 + .../tests/Instances.mustache | 18 +- .../HaskellHttpClientOptionsTest.java | 3 +- .../HaskellHttpClientOptionsProvider.java | 22 +- .../petstore/haskell-http-client/README.md | 8 +- .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-Client.html | 2 +- .../docs/SwaggerPetstore-Core.html | 4 + .../docs/SwaggerPetstore-Lens.html | 4 - .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 10 +- .../docs/SwaggerPetstore-ModelLens.html | 4 + .../docs/SwaggerPetstore.html | 2 +- .../docs/doc-index-45.html | 2 +- .../docs/doc-index-95.html | 2 +- .../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-H.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-R.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/doc-index-W.html | 2 +- .../haskell-http-client/docs/index.html | 2 +- .../docs/mini_SwaggerPetstore-API.html | 2 +- .../docs/mini_SwaggerPetstore-Client.html | 2 +- .../docs/mini_SwaggerPetstore-Core.html | 4 + .../docs/mini_SwaggerPetstore-Lens.html | 4 - .../docs/mini_SwaggerPetstore-MimeTypes.html | 2 +- .../docs/mini_SwaggerPetstore-Model.html | 2 +- .../docs/mini_SwaggerPetstore-ModelLens.html | 4 + .../docs/src/Paths_swagger_petstore.html | 8 +- .../docs/src/SwaggerPetstore.API.html | 2258 +++++++------- .../docs/src/SwaggerPetstore.Client.html | 453 ++- .../docs/src/SwaggerPetstore.Core.html | 533 ++++ .../docs/src/SwaggerPetstore.Lens.html | 642 ---- .../docs/src/SwaggerPetstore.Logging.html | 56 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 348 +-- .../docs/src/SwaggerPetstore.Model.html | 2741 ++++++++--------- .../docs/src/SwaggerPetstore.ModelLens.html | 638 ++++ .../docs/src/SwaggerPetstore.html | 32 +- .../lib/SwaggerPetstore.hs | 18 +- .../lib/SwaggerPetstore/API.hs | 352 +-- .../lib/SwaggerPetstore/Client.hs | 149 +- .../lib/SwaggerPetstore/Core.hs | 532 ++++ .../lib/SwaggerPetstore/Logging.hs | 6 +- .../lib/SwaggerPetstore/MimeTypes.hs | 91 +- .../lib/SwaggerPetstore/Model.hs | 447 +-- .../SwaggerPetstore/{Lens.hs => ModelLens.hs} | 8 +- .../swagger-petstore.cabal | 9 +- .../petstore/haskell-http-client/swagger.json | 1693 ---------- .../petstore/haskell-http-client/swagger.yaml | 1471 +++++++++ .../haskell-http-client/tests/Instances.hs | 25 +- 77 files changed, 7061 insertions(+), 7207 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/Core.mustache rename modules/swagger-codegen/src/main/resources/haskell-http-client/{Lens.mustache => ModelLens.mustache} (87%) create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/_contentType.mustache create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/swagger.mustache create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-ModelLens.html create 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-Lens.html create mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Core.hs rename samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/{Lens.hs => ModelLens.hs} (99%) delete mode 100644 samples/client/petstore/haskell-http-client/swagger.json create mode 100644 samples/client/petstore/haskell-http-client/swagger.yaml 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 45f3d08f471..23476ddf803 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 @@ -19,10 +19,8 @@ import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.SupportingFile; -import io.swagger.util.Json; - -import java.io.IOException; -import java.io.File; +import io.swagger.util.Yaml; +import com.fasterxml.jackson.core.JsonProcessingException; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringEscapeUtils; @@ -41,17 +39,18 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected Boolean useMonadLogger = false; - // CLI - public static final String ALLOW_FROMJSON_NULLS = "allowFromJsonNulls"; - public static final String ALLOW_TOJSON_NULLS = "allowToJsonNulls"; - public static final String DATETIME_FORMAT = "dateTimeFormat"; - public static final String DATE_FORMAT = "dateFormat"; - public static final String GENERATE_FORM_URLENCODED_INSTANCES = "generateFormUrlEncodedInstances"; - public static final String GENERATE_LENSES = "generateLenses"; - public static final String GENERATE_MODEL_CONSTRUCTORS = "generateModelConstructors"; - public static final String MODEL_DERIVING = "modelDeriving"; - public static final String STRICT_FIELDS = "strictFields"; - public static final String USE_MONAD_LOGGER = "useMonadLogger"; + // 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_DATETIME_FORMAT = "dateTimeFormat"; + public static final String PROP_DATE_FORMAT = "dateFormat"; + public static final String PROP_GENERATE_FORM_URLENCODED_INSTANCES = "generateFormUrlEncodedInstances"; + public static final String PROP_GENERATE_LENSES = "generateLenses"; + public static final String PROP_GENERATE_MODEL_CONSTRUCTORS = "generateModelConstructors"; + public static final String PROP_INLINE_CONSUMES_CONTENT_TYPES = "inlineConsumesContentTypes"; + public static final String PROP_MODEL_DERIVING = "modelDeriving"; + public static final String PROP_STRICT_FIELDS = "strictFields"; + public static final String PROP_USE_MONAD_LOGGER = "useMonadLogger"; // protected String MODEL_IMPORTS = "modelImports"; // protected String MODEL_EXTENSIONS = "modelExtensions"; @@ -59,8 +58,30 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC private static final Pattern LEADING_UNDERSCORE = Pattern.compile("^_+"); static final String MEDIA_TYPE = "mediaType"; - static final String MEDIA_DATA_TYPE = "x-mediaDataType"; - static final String MEDIA_IS_JSON = "x-mediaIsJson"; + + // vendor extensions + static final String X_ALL_UNIQUE_PARAMS = "x-allUniqueParams"; + static final String X_COLLECTION_FORMAT = "x-collectionFormat"; + static final String X_DUPLICATE = "x-duplicate"; + static final String X_HADDOCK_PATH = "x-haddockPath"; + static final String X_HAS_BODY_OR_FORM_PARAM = "x-hasBodyOrFormParam"; + static final String X_HAS_MIME_FORM_URL_ENCODED = "x-hasMimeFormUrlEncoded"; + static final String X_HAS_NEW_TAG = "x-hasNewTag"; + static final String X_HAS_OPTIONAL_PARAMS = "x-hasOptionalParams"; + static final String X_HAS_UNKNOWN_MIME_TYPES = "x-hasUnknownMimeTypes"; + static final String X_HAS_UNKNOWN_RETURN = "x-hasUnknownReturn"; + static final String X_INLINE_CONTENT_TYPE = "x-inlineContentType"; + static final String X_IS_BODY_OR_FORM_PARAM = "x-isBodyOrFormParam"; + static final String X_MEDIA_DATA_TYPE = "x-mediaDataType"; + static final String X_MEDIA_IS_JSON = "x-mediaIsJson"; + 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"; + static final String X_PATH = "x-path"; + static final String X_RETURN_TYPE = "x-returnType"; + 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"; protected Map uniqueParamsByName = new HashMap(); @@ -183,79 +204,82 @@ public HaskellHttpClientCodegen() { knownMimeDataTypes.put("*/*", "MimeAny"); importMapping.clear(); - importMapping.put("Map", "qualified Data.Map as Map"); cliOptions.add(CliOption.newString(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(CliOption.newString(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); - cliOptions.add(CliOption.newBoolean(ALLOW_FROMJSON_NULLS, "allow JSON Null during model decoding from JSON").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(CliOption.newBoolean(ALLOW_TOJSON_NULLS, "allow emitting JSON Null during model encoding to JSON").defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newBoolean(GENERATE_LENSES, "Generate Lens optics for Models").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(CliOption.newBoolean(GENERATE_MODEL_CONSTRUCTORS, "Generate smart constructors (only supply required fields) for models").defaultValue(Boolean.TRUE.toString())); - cliOptions.add(CliOption.newBoolean(GENERATE_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); + 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_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_FORM_URLENCODED_INSTANCES, "Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded").defaultValue(Boolean.TRUE.toString())); + cliOptions.add(CliOption.newBoolean(PROP_INLINE_CONSUMES_CONTENT_TYPES, "Inline (hardcode) the content-type on operations that do not have multiple content-types (Consumes)").defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newString(MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); - cliOptions.add(CliOption.newBoolean(STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.TRUE.toString()))); - cliOptions.add(CliOption.newBoolean(USE_MONAD_LOGGER, "Use the monad-logger package to provide logging (if false, use the katip logging package)").defaultValue((Boolean.FALSE.toString()))); + cliOptions.add(CliOption.newString(PROP_MODEL_DERIVING, "Additional classes to include in the deriving() clause of Models")); + cliOptions.add(CliOption.newBoolean(PROP_STRICT_FIELDS, "Add strictness annotations to all model fields").defaultValue((Boolean.TRUE.toString()))); + cliOptions.add(CliOption.newBoolean(PROP_USE_MONAD_LOGGER, "Use the monad-logger package to provide logging (if false, use the katip logging package)").defaultValue((Boolean.FALSE.toString()))); - cliOptions.add(CliOption.newString(DATETIME_FORMAT, "format string used to parse/render a datetime")); - cliOptions.add(CliOption.newString(DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); + cliOptions.add(CliOption.newString(PROP_DATETIME_FORMAT, "format string used to parse/render a datetime")); + cliOptions.add(CliOption.newString(PROP_DATE_FORMAT, "format string used to parse/render a date").defaultValue(defaultDateFormat)); cliOptions.add(CliOption.newBoolean(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "hides the timestamp when files were generated").defaultValue(Boolean.TRUE.toString())); } public void setAllowFromJsonNulls(Boolean value) { - additionalProperties.put(ALLOW_FROMJSON_NULLS, value); + additionalProperties.put(PROP_ALLOW_FROMJSON_NULLS, value); } public void setAllowToJsonNulls(Boolean value) { - additionalProperties.put(ALLOW_TOJSON_NULLS, value); + additionalProperties.put(PROP_ALLOW_TOJSON_NULLS, value); } public void setGenerateModelConstructors(Boolean value) { - additionalProperties.put(GENERATE_MODEL_CONSTRUCTORS, value); + additionalProperties.put(PROP_GENERATE_MODEL_CONSTRUCTORS, value); } public void setGenerateFormUrlEncodedInstances(Boolean value) { - additionalProperties.put(GENERATE_FORM_URLENCODED_INSTANCES, value); + additionalProperties.put(PROP_GENERATE_FORM_URLENCODED_INSTANCES, value); + } + public void setInlineConsumesContentTypes (Boolean value) { + additionalProperties.put(PROP_INLINE_CONSUMES_CONTENT_TYPES, value); } public void setGenerateLenses(Boolean value) { - additionalProperties.put(GENERATE_LENSES, value); + additionalProperties.put(PROP_GENERATE_LENSES, value); } public void setModelDeriving(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.remove(MODEL_DERIVING); + additionalProperties.remove(PROP_MODEL_DERIVING); } else { - additionalProperties.put(MODEL_DERIVING, StringUtils.join(value.split(" "), ",")); + additionalProperties.put(PROP_MODEL_DERIVING, StringUtils.join(value.split(" "), ",")); } } public void setDateTimeFormat(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.remove(DATETIME_FORMAT); + additionalProperties.remove(PROP_DATETIME_FORMAT); } else { - additionalProperties.put(DATETIME_FORMAT, value); + additionalProperties.put(PROP_DATETIME_FORMAT, value); } } public void setDateFormat(String value) { if (StringUtils.isBlank(value)) { - additionalProperties.remove(DATE_FORMAT); + additionalProperties.remove(PROP_DATE_FORMAT); } else { - additionalProperties.put(DATE_FORMAT, value); + additionalProperties.put(PROP_DATE_FORMAT, value); } } public void setStrictFields(Boolean value) { - additionalProperties.put("x-strictFields", value); + additionalProperties.put(X_STRICT_FIELDS, value); } public void setUseMonadLogger(Boolean value) { - additionalProperties.put("x-useMonadLogger", value); + additionalProperties.put(X_USE_MONAD_LOGGER, value); this.useMonadLogger = value; } @@ -269,61 +293,67 @@ public void processOpts() { additionalProperties.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, true); } - if (additionalProperties.containsKey(ALLOW_FROMJSON_NULLS)) { - setAllowFromJsonNulls(convertPropertyToBoolean(ALLOW_FROMJSON_NULLS)); + if (additionalProperties.containsKey(PROP_ALLOW_FROMJSON_NULLS)) { + setAllowFromJsonNulls(convertPropertyToBoolean(PROP_ALLOW_FROMJSON_NULLS)); } else { setAllowFromJsonNulls(true); } - if (additionalProperties.containsKey(ALLOW_TOJSON_NULLS)) { - setAllowToJsonNulls(convertPropertyToBoolean(ALLOW_TOJSON_NULLS)); + if (additionalProperties.containsKey(PROP_ALLOW_TOJSON_NULLS)) { + setAllowToJsonNulls(convertPropertyToBoolean(PROP_ALLOW_TOJSON_NULLS)); } else { setAllowToJsonNulls(false); } - if (additionalProperties.containsKey(GENERATE_MODEL_CONSTRUCTORS)) { - setGenerateModelConstructors(convertPropertyToBoolean(GENERATE_MODEL_CONSTRUCTORS)); + if (additionalProperties.containsKey(PROP_GENERATE_MODEL_CONSTRUCTORS)) { + setGenerateModelConstructors(convertPropertyToBoolean(PROP_GENERATE_MODEL_CONSTRUCTORS)); } else { setGenerateModelConstructors(true); } - if (additionalProperties.containsKey(GENERATE_FORM_URLENCODED_INSTANCES)) { - setGenerateFormUrlEncodedInstances(convertPropertyToBoolean(GENERATE_FORM_URLENCODED_INSTANCES)); + if (additionalProperties.containsKey(PROP_GENERATE_FORM_URLENCODED_INSTANCES)) { + setGenerateFormUrlEncodedInstances(convertPropertyToBoolean(PROP_GENERATE_FORM_URLENCODED_INSTANCES)); } else { setGenerateFormUrlEncodedInstances(true); } - if (additionalProperties.containsKey(GENERATE_LENSES)) { - setGenerateLenses(convertPropertyToBoolean(GENERATE_LENSES)); + if (additionalProperties.containsKey(PROP_INLINE_CONSUMES_CONTENT_TYPES)) { + setInlineConsumesContentTypes(convertPropertyToBoolean(PROP_INLINE_CONSUMES_CONTENT_TYPES)); + } else { + setInlineConsumesContentTypes(false); + } + + if (additionalProperties.containsKey(PROP_GENERATE_LENSES)) { + setGenerateLenses(convertPropertyToBoolean(PROP_GENERATE_LENSES)); } else { setGenerateLenses(true); } - if (additionalProperties.containsKey(MODEL_DERIVING)) { - setModelDeriving(additionalProperties.get(MODEL_DERIVING).toString()); + if (additionalProperties.containsKey(PROP_MODEL_DERIVING)) { + setModelDeriving(additionalProperties.get(PROP_MODEL_DERIVING).toString()); } else { setModelDeriving(""); } - if (additionalProperties.containsKey(DATETIME_FORMAT)) { - setDateTimeFormat(additionalProperties.get(DATETIME_FORMAT).toString()); + if (additionalProperties.containsKey(PROP_DATETIME_FORMAT)) { + setDateTimeFormat(additionalProperties.get(PROP_DATETIME_FORMAT).toString()); } else { setDateTimeFormat(null); // default should be null } - if (additionalProperties.containsKey(DATE_FORMAT)) { - setDateFormat(additionalProperties.get(DATE_FORMAT).toString()); + if (additionalProperties.containsKey(PROP_DATE_FORMAT)) { + setDateFormat(additionalProperties.get(PROP_DATE_FORMAT).toString()); } else { setDateFormat(defaultDateFormat); } - if (additionalProperties.containsKey(STRICT_FIELDS)) { - setStrictFields(convertPropertyToBoolean(STRICT_FIELDS)); + if (additionalProperties.containsKey(PROP_STRICT_FIELDS)) { + setStrictFields(convertPropertyToBoolean(PROP_STRICT_FIELDS)); } else { setStrictFields(true); } - if (additionalProperties.containsKey(USE_MONAD_LOGGER)) { - setUseMonadLogger(convertPropertyToBoolean(USE_MONAD_LOGGER)); + if (additionalProperties.containsKey(PROP_USE_MONAD_LOGGER)) { + setUseMonadLogger(convertPropertyToBoolean(PROP_USE_MONAD_LOGGER)); } else { setUseMonadLogger(false); } @@ -366,12 +396,14 @@ public void preprocessSwagger(Swagger swagger) { // root supportingFiles.add(new SupportingFile("haskell-http-client.cabal.mustache", "", cabalName + ".cabal")); + 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("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")); @@ -382,8 +414,8 @@ public void preprocessSwagger(Swagger swagger) { // apiTemplateFiles.put("Model.mustache", ".hs"); // lens - if ((boolean)additionalProperties.get(GENERATE_LENSES)) { - supportingFiles.add(new SupportingFile("Lens.mustache", "lib/" + apiName, "Lens.hs")); + if ((boolean)additionalProperties.get(PROP_GENERATE_LENSES)) { + supportingFiles.add(new SupportingFile("ModelLens.mustache", "lib/" + apiName, "ModelLens.hs")); } additionalProperties.put("title", apiName); @@ -394,11 +426,22 @@ public void preprocessSwagger(Swagger swagger) { additionalProperties.put("configType", apiName + "Config"); additionalProperties.put("swaggerVersion", swagger.getSwagger()); - WriteInputSwaggerToFile(swagger); - super.preprocessSwagger(swagger); } + @Override + public Map postProcessSupportingFileData(Map objs) { + Swagger swagger = (Swagger)objs.get("swagger"); + if(swagger != null) { + try { + objs.put("swagger-yaml", Yaml.mapper().writeValueAsString(swagger)); + } catch (JsonProcessingException e) { + LOGGER.error(e.getMessage(), e); + } + } + return super.postProcessSupportingFileData(objs); + } + @Override public String getTypeDeclaration(Property p) { @@ -417,15 +460,11 @@ public String getTypeDeclaration(Property p) { @Override public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); - String type = null; + if (typeMapping.containsKey(swaggerType)) { return typeMapping.get(swaggerType); - } else if (languageSpecificPrimitives.contains(type)) { - return type; } else if (swaggerType == "object") { return "A.Value"; -// } else if (typeMapping.containsValue(swaggerType)) { -// return toModelName(swaggerType) + "_"; } else { return toModelName(swaggerType); } @@ -459,21 +498,21 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op op.vendorExtensions = new LinkedHashMap(); String operationType = toTypeName("Op", op.operationId); - op.vendorExtensions.put("x-operationType", operationType); + op.vendorExtensions.put(X_OPERATION_TYPE, operationType); typeNames.add(operationType); - op.vendorExtensions.put("x-haddockPath", String.format("%s %s", op.httpMethod, op.path.replace("/", "\\/"))); - op.vendorExtensions.put("x-hasBodyOrFormParam", op.getHasBodyParam() || op.getHasFormParams()); + op.vendorExtensions.put(X_HADDOCK_PATH, String.format("%s %s", op.httpMethod, op.path.replace("/", "\\/"))); + op.vendorExtensions.put(X_HAS_BODY_OR_FORM_PARAM, op.getHasBodyParam() || op.getHasFormParams()); for (CodegenParameter param : op.allParams) { param.vendorExtensions = new LinkedHashMap(); // prevent aliasing/sharing - param.vendorExtensions.put("x-operationType", operationType); - param.vendorExtensions.put("x-isBodyOrFormParam", param.isBodyParam || param.isFormParam); + param.vendorExtensions.put(X_OPERATION_TYPE, operationType); + param.vendorExtensions.put(X_IS_BODY_OR_FORM_PARAM, param.isBodyParam || param.isFormParam); if (!StringUtils.isBlank(param.collectionFormat)) { - param.vendorExtensions.put("x-collectionFormat", mapCollectionFormat(param.collectionFormat)); + param.vendorExtensions.put(X_COLLECTION_FORMAT, mapCollectionFormat(param.collectionFormat)); } if(!param.required) { - op.vendorExtensions.put("x-hasOptionalParams", true); + op.vendorExtensions.put(X_HAS_OPTIONAL_PARAMS, true); } deduplicateParameter(param); @@ -508,10 +547,10 @@ public Map postProcessOperations(Map objs) { HashMap pathOps = (HashMap)ret.get("operations"); ArrayList ops = (ArrayList)pathOps.get("operation"); if(ops.size() > 0) { - ops.get(0).vendorExtensions.put("x-hasNewTag", true); + ops.get(0).vendorExtensions.put(X_HAS_NEW_TAG, true); } - additionalProperties.put("x-hasUnknownMimeTypes", !unknownMimeTypes.isEmpty()); + additionalProperties.put(X_HAS_UNKNOWN_MIME_TYPES, !unknownMimeTypes.isEmpty()); Collections.sort(unknownMimeTypes, new Comparator>() { @Override @@ -519,19 +558,19 @@ public int compare(Map o1, Map o2) { return o1.get(MEDIA_TYPE).compareTo(o2.get(MEDIA_TYPE)); } }); - additionalProperties.put("x-unknownMimeTypes", unknownMimeTypes); + additionalProperties.put(X_UNKNOWN_MIME_TYPES, unknownMimeTypes); ArrayList params = new ArrayList<>(uniqueParamsByName.values()); Collections.sort(params, new Comparator() { @Override public int compare(CodegenParameter o1, CodegenParameter o2) { return - ((String) o1.vendorExtensions.get("x-paramNameType")) + ((String) o1.vendorExtensions.get(X_PARAM_NAME_TYPE)) .compareTo( - (String) o2.vendorExtensions.get("x-paramNameType")); + (String) o2.vendorExtensions.get(X_PARAM_NAME_TYPE)); } }); - additionalProperties.put("x-allUniqueParams", params); + additionalProperties.put(X_ALL_UNIQUE_PARAMS, params); return ret; } @@ -543,8 +582,8 @@ public Map postProcessOperationsWithModels(Map o CodegenModel m = (CodegenModel) h.get("model"); if (modelMimeTypes.containsKey(m.classname)) { Set mimeTypes = modelMimeTypes.get(m.classname); - m.vendorExtensions.put("x-mimeTypes", mimeTypes); - if ((boolean)additionalProperties.get(GENERATE_FORM_URLENCODED_INSTANCES) && mimeTypes.contains("MimeFormUrlEncoded")) { + m.vendorExtensions.put(X_MIME_TYPES, mimeTypes); + if ((boolean)additionalProperties.get(PROP_GENERATE_FORM_URLENCODED_INSTANCES) && mimeTypes.contains("MimeFormUrlEncoded")) { Boolean hasMimeFormUrlEncoded = true; for (CodegenProperty v : m.vars) { if (!(v.isPrimitiveType || v.isString || v.isDate || v.isDateTime)) { @@ -552,7 +591,7 @@ public Map postProcessOperationsWithModels(Map o } } if (hasMimeFormUrlEncoded) { - m.vendorExtensions.put("x-hasMimeFormUrlEncoded", true); + m.vendorExtensions.put(X_HAS_MIME_FORM_URL_ENCODED, true); } } } @@ -614,22 +653,12 @@ public boolean isDataTypeBinary(final String dataType) { return dataType != null && dataType.equals("B.ByteString"); } - //copy input swagger to output folder - private void WriteInputSwaggerToFile(Swagger swagger) { - try { - String swaggerJson = Json.pretty(swagger); - FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); - } catch (IOException e) { - throw new RuntimeException(e.getMessage(), e.getCause()); - } - } - private void processReturnType(CodegenOperation op) { String returnType = op.returnType; if (returnType == null || returnType.equals("null")) { if(op.hasProduces) { returnType = "res"; - op.vendorExtensions.put("x-hasUnknownReturn", true); + op.vendorExtensions.put(X_HAS_UNKNOWN_RETURN, true); } else { returnType = "NoContent"; } @@ -637,13 +666,15 @@ private void processReturnType(CodegenOperation op) { if (returnType.indexOf(" ") >= 0) { returnType = "(" + returnType + ")"; } - op.vendorExtensions.put("x-returnType", returnType); + op.vendorExtensions.put(X_RETURN_TYPE, returnType); } private void processProducesConsumes(CodegenOperation op) { if (op.hasConsumes) { for (Map m : op.consumes) { processMediaType(op,m); + processInlineConsumesContentType(op, m); + } if (isMultipartOperation(op.consumes)) { op.isMultipart = Boolean.TRUE; @@ -656,6 +687,18 @@ private void processProducesConsumes(CodegenOperation op) { } } + private void processInlineConsumesContentType(CodegenOperation op, Map m) { + if ((boolean) additionalProperties.get(PROP_INLINE_CONSUMES_CONTENT_TYPES) + && op.consumes.size() == 1) { + op.vendorExtensions.put(X_INLINE_CONTENT_TYPE, m); + for (CodegenParameter param : op.allParams) { + if (param.isBodyParam && param.required) { + param.vendorExtensions.put(X_INLINE_CONTENT_TYPE, m); + } + } + } + } + private void deduplicateParameter(CodegenParameter param) { if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) { @@ -687,7 +730,7 @@ private void deduplicateParameter(CodegenParameter param) { uniqueParamsByName.put(paramNameType, param); } - param.vendorExtensions.put("x-paramNameType", paramNameType); + param.vendorExtensions.put(X_PARAM_NAME_TYPE, paramNameType); typeNames.add(paramNameType); } } @@ -695,7 +738,7 @@ private void deduplicateParameter(CodegenParameter param) { public Boolean checkParamForDuplicates(String paramNameType, CodegenParameter param) { CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType); if (lastParam != null && lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) { - param.vendorExtensions.put("x-duplicate", true); + param.vendorExtensions.put(X_DUPLICATE, true); return true; } return false; @@ -714,7 +757,7 @@ private void processPathExpr(CodegenOperation op) { xPath = xPath.replaceAll("^\\[,", "["); xPath = xPath.replaceAll(",\\]$", "]"); } - op.vendorExtensions.put("x-path", xPath); + op.vendorExtensions.put(X_PATH, xPath); } @@ -725,9 +768,9 @@ private void processMediaType(CodegenOperation op, Map m) { String mimeType = getMimeDataType(mediaType); typeNames.add(mimeType); - m.put(MEDIA_DATA_TYPE, mimeType); + m.put(X_MEDIA_DATA_TYPE, mimeType); if (isJsonMimeType(mediaType)) { - m.put(MEDIA_IS_JSON, "true"); + m.put(X_MEDIA_IS_JSON, "true"); } if (!knownMimeDataTypes.containsValue(mimeType) && !unknownMimeTypesContainsType(mimeType)) { @@ -744,7 +787,7 @@ private void processMediaType(CodegenOperation op, Map m) { private Boolean unknownMimeTypesContainsType(String mimeType) { for(Map m : unknownMimeTypes) { - String mimeType0 = m.get(MEDIA_DATA_TYPE); + String mimeType0 = m.get(X_MEDIA_DATA_TYPE); if(mimeType0 != null && mimeType0.equals(mimeType)) { return true; } @@ -913,31 +956,50 @@ public String toDefaultValue(Property p) { else return "True"; } - } else if (p instanceof DoubleProperty) { - DoubleProperty dp = (DoubleProperty) p; - if (dp.getDefault() != null) { - return dp.getDefault().toString(); - } - } else if (p instanceof FloatProperty) { - FloatProperty dp = (FloatProperty) p; - if (dp.getDefault() != null) { - return dp.getDefault().toString(); - } - } else if (p instanceof IntegerProperty) { - IntegerProperty dp = (IntegerProperty) p; - if (dp.getDefault() != null) { - return dp.getDefault().toString(); - } - } else if (p instanceof LongProperty) { - LongProperty dp = (LongProperty) p; - if (dp.getDefault() != null) { - return dp.getDefault().toString(); - } } return null; } + @Override + public String toEnumName(CodegenProperty property) { + return "Enum'" + toTypeName("", property.name); + } + + @Override + public String toEnumVarName(String value, String datatype) { + List num = new ArrayList<>(Arrays.asList("integer","int","double","long","float")); + if (value.length() == 0) { + return "E'Empty"; + } + + // for symbol, e.g. $, # + if (getSymbolName(value) != null) { + return "E'" + sanitizeName(getSymbolName(value)); + } + + // number + if (num.contains(datatype.toLowerCase())) { + String varName = "Num" + value; + varName = varName.replaceAll("-", "Minus_"); + varName = varName.replaceAll("\\+", "Plus_"); + varName = varName.replaceAll("\\.", "_Dot_"); + return "E'" + sanitizeName(varName); + } + + return "E'" + sanitizeName(value); + } + + @Override + public String toEnumValue(String value, String datatype) { + List num = new ArrayList<>(Arrays.asList("integer","int","double","long","float")); + if(num.contains(datatype.toLowerCase())) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + // override with any special text escaping logic @SuppressWarnings("static-method") public String escapeText(String input) { 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 d11e8b68a35..0ed4d1093a2 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 @@ -4,6 +4,7 @@ Module : {{title}}.API -} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} @@ -13,49 +14,38 @@ Module : {{title}}.API {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module {{title}}.API where - -import {{title}}.Model as M +import {{title}}.Core import {{title}}.MimeTypes -import {{title}}.Lens +import {{title}}.Model as M import qualified Data.Aeson as A - -import qualified Data.Time as TI - import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL import qualified Data.ByteString.Base64 as B64 - -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.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI +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.Set as Set 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 Control.Arrow as P (left) - 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 ((&)) @@ -83,11 +73,11 @@ import qualified Prelude as P -- Note: Has 'Produces' instances, but no response schema -- {{/vendorExtensions.x-hasUnknownReturn}} {{operationId}} - :: {{#vendorExtensions.x-hasBodyOrFormParam}}(Consumes {{{vendorExtensions.x-operationType}}} contentType{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender contentType {{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}}{{/required}}{{/isBodyParam}}{{/allParams}}) - => contentType -- ^ request content-type ('MimeType') - -> {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}} - -> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-hasBodyOrFormParam}}contentType{{/vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-hasBodyOrFormParam}}MimeNoContent{{/vendorExtensions.x-hasBodyOrFormParam}} {{vendorExtensions.x-returnType}} -{{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}_ {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-paramNameType}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= + :: {{#vendorExtensions.x-hasBodyOrFormParam}}(Consumes {{{vendorExtensions.x-operationType}}} {{>_contentType}}{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender {{>_contentType}} {{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}}{{/required}}{{/isBodyParam}}{{/allParams}}) + => {{^vendorExtensions.x-inlineContentType}}contentType -- ^ request content-type ('MimeType') + -> {{/vendorExtensions.x-inlineContentType}}{{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}} + -> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-hasBodyOrFormParam}}{{>_contentType}}{{/vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-hasBodyOrFormParam}}MimeNoContent{{/vendorExtensions.x-hasBodyOrFormParam}} {{vendorExtensions.x-returnType}} +{{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-inlineContentType}}_ {{/vendorExtensions.x-inlineContentType}}{{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-paramNameType}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= _mkRequest "{{httpMethod}}" {{{vendorExtensions.x-path}}}{{#authMethods}} `_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#allParams}}{{#required}}{{#isHeaderParam}} `setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}} @@ -117,240 +107,13 @@ instance Produces {{{vendorExtensions.x-operationType}}} {{{x-mediaDataType}}} {{/produces}}{{/hasProduces}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} --- * HasBodyParam - --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => {{requestType}} req contentType res -> param -> {{requestType}} req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} - - -- | Apply an optional parameter to a request - applyOptionalParam :: {{requestType}} req contentType res -> param -> {{requestType}} req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: {{requestType}} req contentType res -> param -> {{requestType}} req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * {{requestType}} - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data {{requestType}} req contentType res = {{requestType}} - { rMethod :: NH.Method -- ^ Method of {{requestType}} - , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of {{requestType}} - , rParams :: Params -- ^ params of {{requestType}} - , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods - } - deriving (P.Show) - --- | 'rMethod' Lens -rMethodL :: Lens_' ({{requestType}} req contentType res) NH.Method -rMethodL f {{requestType}}{..} = (\rMethod -> {{requestType}} { rMethod, ..} ) <$> f rMethod -{-# INLINE rMethodL #-} - --- | 'rUrlPath' Lens -rUrlPathL :: Lens_' ({{requestType}} req contentType res) [BCL.ByteString] -rUrlPathL f {{requestType}}{..} = (\rUrlPath -> {{requestType}} { rUrlPath, ..} ) <$> f rUrlPath -{-# INLINE rUrlPathL #-} - --- | 'rParams' Lens -rParamsL :: Lens_' ({{requestType}} req contentType res) Params -rParamsL f {{requestType}}{..} = (\rParams -> {{requestType}} { rParams, ..} ) <$> f rParams -{-# INLINE rParamsL #-} +-- * Parameter newtypes --- | 'rParams' Lens -rAuthTypesL :: Lens_' ({{requestType}} req contentType res) [P.TypeRep] -rAuthTypesL f {{requestType}}{..} = (\rAuthTypes -> {{requestType}} { rAuthTypes, ..} ) <$> f rAuthTypes -{-# INLINE rAuthTypesL #-} +{{#x-allUniqueParams}} +newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}}) +{{/x-allUniqueParams}} --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | 'paramsQuery' Lens -paramsQueryL :: Lens_' Params NH.Query -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 -{-# INLINE paramsHeadersL #-} - --- | 'paramsBody' Lens -paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody -{-# INLINE paramsBodyL #-} - --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** {{requestType}} Utils - -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> {{requestType}} req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = {{requestType}} m u _mkParams [] - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone - -setHeader :: {{requestType}} req contentType res -> [NH.Header] -> {{requestType}} req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) - -removeHeader :: {{requestType}} req contentType res -> [NH.HeaderName] -> {{requestType}} req contentType res -removeHeader req header = - req & - L.over - (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) - where - cifst = CI.mk . P.fst - - -_setContentTypeHeader :: forall req contentType res. MimeType contentType => {{requestType}} req contentType res -> {{requestType}} req contentType res -_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 => {{requestType}} req contentType res -> accept -> {{requestType}} req contentType res -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] - -setQuery :: {{requestType}} req contentType res -> [NH.QueryItem] -> {{requestType}} req contentType res -setQuery req query = - req & - L.over - (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) - where - cifst = CI.mk . P.fst - -addForm :: {{requestType}} req contentType res -> WH.Form -> {{requestType}} req contentType res -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) - -_addMultiFormPart :: {{requestType}} req contentType res -> NH.Part -> {{requestType}} req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) - -_setBodyBS :: {{requestType}} req contentType res -> B.ByteString -> {{requestType}} req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) - -_setBodyLBS :: {{requestType}} req contentType res -> BL.ByteString -> {{requestType}} req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) - -_hasAuthType :: AuthMethod authMethod => {{requestType}} req contentType res -> P.Proxy authMethod -> {{requestType}} req contentType res -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) - --- ** Params Utils - -toPath - :: 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] - -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 - --- *** Swagger `CollectionFormat` Utils - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') - -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 - where - 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 - -_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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - --- * AuthMethods - --- | Provides a method to apply auth methods to requests -class P.Typeable a => AuthMethod a where - applyAuthMethod :: {{requestType}} req contentType res -> a -> {{requestType}} req contentType res - --- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) - -instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a +-- * Auth Methods {{#authMethods}}{{#isBasic}}-- ** {{name}} data {{name}} = @@ -358,9 +121,11 @@ data {{name}} = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod {{name}} where - applyAuthMethod req a@({{name}} user pw) = + 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 ]) @@ -370,9 +135,11 @@ data {{name}} = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod {{name}} where - applyAuthMethod req a@({{name}} secret) = + 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}} @@ -381,9 +148,28 @@ data {{name}} = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod {{name}} where - applyAuthMethod req a@({{name}} secret) = + 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}} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache index 5e787e7c4a1..8282ec5724d 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Client.mustache @@ -15,102 +15,30 @@ Module : {{title}}.Client module {{title}}.Client where -import {{title}}.Model -import {{title}}.API -import {{title}}.MimeTypes +import {{title}}.Core import {{title}}.Logging +import {{title}}.MimeTypes +import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A +import qualified Control.Monad as P import qualified Data.Aeson.Types as A +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Data.Time as TI -import qualified Data.Map as Map import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH -import qualified Control.Exception.Safe as E --- * Config - --- | -data {{configType}} = {{configType}} - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance - , configLogContext :: LogContext -- ^ Configures the logger - , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods - } - --- | display the config -instance Show {{configType}} where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default {{configType}} --- --- configHost: --- --- @{{basePath}}@ --- --- configUserAgent: --- --- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}"@ --- -newConfig :: IO {{configType}} -newConfig = do - logCxt <- initLogContext - return $ {{configType}} - { configHost = "{{{basePath}}}" - , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" - , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt - , configAuthMethods = [] - } - --- | updates config use AuthMethod on matching requests -addAuthMethod :: AuthMethod auth => {{configType}} -> auth -> {{configType}} -addAuthMethod config@{{configType}} {configAuthMethods = as} a = - config { configAuthMethods = AnyAuthMethod a : as} - --- | updates the config to use stdout logging -withStdoutLogging :: {{configType}} -> IO {{configType}} -withStdoutLogging p = do - logCxt <- stdoutLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } - --- | updates the config to use stderr logging -withStderrLogging :: {{configType}} -> IO {{configType}} -withStderrLogging p = do - logCxt <- stderrLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } - --- | updates the config to disable logging -withNoLogging :: {{configType}} -> {{configType}} -withNoLogging p = p { configLogExecWithContext = runNullLogExec} +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) -- * Dispatch @@ -233,35 +161,28 @@ _toInitRequest -> {{requestType}} req contentType res -- ^ request -> accept -- ^ "accept" 'MimeType' -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _applyAuthMethods req0 config - & _setContentTypeHeader - & flip _setAcceptHeader accept - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) 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) - --- | apply all matching AuthMethods in config to request -_applyAuthMethods - :: {{requestType}} req contentType res - -> {{configType}} - -> {{requestType}} req contentType res -_applyAuthMethods req {{configType}} {configAuthMethods = as} = - foldl go req as - where - go r (AnyAuthMethod a) = r `applyAuthMethod` a +_toInitRequest config req0 accept = + 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.throwString $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & flip _setAcceptHeader accept + 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 + + pure (InitRequest outReq) -- | modify the underlying Request modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Core.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Core.mustache new file mode 100644 index 00000000000..ab870973a21 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Core.mustache @@ -0,0 +1,522 @@ +{{>partial_header}} +{-| +Module : {{title}}.Core +-} + +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-} + +module {{title}}.Core where + +import {{title}}.MimeTypes +import {{title}}.Logging + +import qualified Control.Arrow as P (left) +import qualified Control.DeepSeq as NF +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Base64.Lazy as BL64 +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.CaseInsensitive as CI +import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep) +import qualified Data.Foldable as P +import qualified Data.Ix as P +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 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.Types as NH +import qualified Prelude as P +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH +import qualified Text.Printf as T + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Foldable(foldlM) +import Data.Monoid ((<>)) +import Data.Text (Text) +import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor) + +-- * {{configType}} + +-- | +data {{configType}} = {{configType}} + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods + , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured + } + +-- | display the config +instance P.Show {{configType}} where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default {{configType}} +-- +-- configHost: +-- +-- @{{basePath}}@ +-- +-- configUserAgent: +-- +-- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}"@ +-- +newConfig :: IO {{configType}} +newConfig = do + logCxt <- initLogContext + return $ {{configType}} + { configHost = "{{{basePath}}}" + , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{artifactId}}}/{{{artifactVersion}}}{{/httpUserAgent}}" + , configLogExecWithContext = runDefaultLogExecWithContext + , configLogContext = logCxt + , configAuthMethods = [] + , configValidateAuthMethods = True + } + +-- | updates config use AuthMethod on matching requests +addAuthMethod :: AuthMethod auth => {{configType}} -> auth -> {{configType}} +addAuthMethod config@{{configType}} {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} + +-- | updates the config to use stdout logging +withStdoutLogging :: {{configType}} -> IO {{configType}} +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } + +-- | updates the config to use stderr logging +withStderrLogging :: {{configType}} -> IO {{configType}} +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } + +-- | updates the config to disable logging +withNoLogging :: {{configType}} -> {{configType}} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} + +-- * {{requestType}} + +-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. +data {{requestType}} req contentType res = {{requestType}} + { rMethod :: NH.Method -- ^ Method of {{requestType}} + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of {{requestType}} + , rParams :: Params -- ^ params of {{requestType}} + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' ({{requestType}} req contentType res) NH.Method +rMethodL f {{requestType}}{..} = (\rMethod -> {{requestType}} { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' ({{requestType}} req contentType res) [BCL.ByteString] +rUrlPathL f {{requestType}}{..} = (\rUrlPath -> {{requestType}} { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' ({{requestType}} req contentType res) Params +rParamsL f {{requestType}}{..} = (\rParams -> {{requestType}} { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + +-- | 'rParams' Lens +rAuthTypesL :: Lens_' ({{requestType}} req contentType res) [P.TypeRep] +rAuthTypesL f {{requestType}}{..} = (\rAuthTypes -> {{requestType}} { rAuthTypes, ..} ) <$> f rAuthTypes +{-# INLINE rAuthTypesL #-} + +-- * HasBodyParam + +-- | Designates the body parameter of a request +class HasBodyParam req param where + setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => {{requestType}} req contentType res -> param -> {{requestType}} req contentType res + 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 + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: {{requestType}} req contentType res -> param -> {{requestType}} req contentType res + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: {{requestType}} req contentType res -> param -> {{requestType}} req contentType res + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} + +infixl 2 -&- + +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) + +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) + +-- ** {{requestType}} Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> {{requestType}} req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = {{requestType}} m u _mkParams [] + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: {{requestType}} req contentType res -> [NH.Header] -> {{requestType}} req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) + +removeHeader :: {{requestType}} req contentType res -> [NH.HeaderName] -> {{requestType}} req contentType res +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res. MimeType contentType => {{requestType}} req contentType res -> {{requestType}} req contentType res +_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 => {{requestType}} req contentType res -> accept -> {{requestType}} req contentType res +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +setQuery :: {{requestType}} req contentType res -> [NH.QueryItem] -> {{requestType}} req contentType res +setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst + +addForm :: {{requestType}} req contentType res -> WH.Form -> {{requestType}} req contentType res +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: {{requestType}} req contentType res -> NH.Part -> {{requestType}} req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: {{requestType}} req contentType res -> B.ByteString -> {{requestType}} req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: {{requestType}} req contentType res -> BL.ByteString -> {{requestType}} req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + +_hasAuthType :: AuthMethod authMethod => {{requestType}} req contentType res -> P.Proxy authMethod -> {{requestType}} req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) + +-- ** Params Utils + +toPath + :: 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] + +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 + +-- *** Swagger `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 + where + 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 + +_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.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 + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => + AuthMethod a where + applyAuthMethod + :: {{configType}} + -> a + -> {{requestType}} req contentType res + -> IO ({{requestType}} req contentType res) + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req + +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: {{requestType}} req contentType res + -> {{configType}} + -> IO ({{requestType}} req contentType res) +_applyAuthMethods req config@({{configType}} {configAuthMethods = as}) = + foldlM go req as + where + 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 + where + 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 + +-- | Collapse (Just "") to Nothing +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_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 +{-# INLINE _memptyToNothing #-} + +-- * DateTime Formatting + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t +instance MimeRender MimeMultipartFormData DateTime where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ +_readDateTime :: (TI.ParseTime t, Monad m, {{^dateTimeFormat}}Alternative m{{/dateTimeFormat}}) => String -> m t +_readDateTime = + {{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} +{-# INLINE _readDateTime #-} + +-- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ +_showDateTime :: ({{^dateTimeFormat}}t ~ TI.UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String +_showDateTime = + {{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} +{-# INLINE _showDateTime #-} + +-- | parse an ISO8601 date-time string +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t +instance MimeRender MimeMultipartFormData Date where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @TI.parseTimeM True TI.defaultTimeLocale "{{{dateFormat}}}"@ +_readDate :: (TI.ParseTime t, Monad m) => String -> m t +_readDate = + TI.parseTimeM True TI.defaultTimeLocale "{{{dateFormat}}}" +{-# INLINE _readDate #-} + +-- | @TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}"@ +_showDate :: TI.FormatTime t => t -> String +_showDate = + TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray +instance MimeRender MimeMultipartFormData ByteArray where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 +instance MimeRender MimeMultipartFormData Binary where + mimeRender _ = unBinary + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} + +-- * 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 diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache index 3b3877a41ce..602775d4a3f 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -10,9 +10,6 @@ Katip Logging functions module {{title}}.Logging where -import Data.Text (Text) -import GHC.Exts (IsString(..)) - import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P import qualified Control.Monad.Trans.Reader as P @@ -20,6 +17,9 @@ import qualified Data.Text as T import qualified Lens.Micro as L import qualified System.IO as IO +import Data.Text (Text) +import GHC.Exts (IsString(..)) + import qualified Katip as LG -- * Type Aliases (for compatability) diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache index e0a15329c13..dccbaf0252a 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/LoggingMonadLogger.mustache @@ -10,13 +10,13 @@ monad-logger Logging functions module {{title}}.Logging where -import Data.Text (Text) - import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P import qualified Data.Text as T import qualified Data.Time as TI + import Data.Monoid ((<>)) +import Data.Text (Text) import qualified Control.Monad.Logger as LG 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 b111a1da1e5..751013b3f50 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 @@ -13,39 +13,35 @@ Module : {{title}}.MimeTypes module {{title}}.MimeTypes where -import {{title}}.Model as M - +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.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BCL - - -import qualified Network.HTTP.Media as ME - -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - import qualified Data.Data as P (Typeable) import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Text as T import qualified Data.String as P +import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) +import qualified Network.HTTP.Media as ME +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) import qualified Prelude as P --- * Content Negotiation --- | A type for responses without content-body. -data NoContent = NoContent - deriving (P.Show, P.Eq) +-- * Consumes Class + +class MimeType mtype => Consumes req mtype where --- ** Mime Types +-- * Produces Class + +class MimeType mtype => Produces req mtype where + +-- * Default Mime Types data MimeJSON = MimeJSON deriving (P.Typeable) data MimeXML = MimeXML deriving (P.Typeable) @@ -56,10 +52,12 @@ data MimeOctetStream = MimeOctetStream deriving (P.Typeable) data MimeNoContent = MimeNoContent deriving (P.Typeable) data MimeAny = MimeAny deriving (P.Typeable) -{{#x-unknownMimeTypes}}data {{{x-mediaDataType}}} = {{{x-mediaDataType}}} deriving (P.Typeable) -{{/x-unknownMimeTypes}} +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq, P.Typeable) + --- ** MimeType Class +-- * MimeType Class class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} @@ -81,7 +79,7 @@ class P.Typeable mtype => MimeType mtype where mimeTypes' :: mtype -> [ME.MediaType] mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) --- ** MimeType Instances +-- Default MimeType Instances -- | @application/json; charset=utf-8@ instance MimeType MimeJSON where @@ -107,16 +105,7 @@ instance MimeType MimeAny where instance MimeType MimeNoContent where mimeType _ = Nothing -{{#x-unknownMimeTypes}} --- | @{{{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}} - -{{/x-unknownMimeTypes}} - --- ** MimeRender Class +-- * MimeRender Class class MimeType mtype => MimeRender mtype x where mimeRender :: P.Proxy mtype -> x -> BL.ByteString @@ -124,7 +113,10 @@ class MimeType mtype => MimeRender mtype x where mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x --- ** MimeRender Instances +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 @@ -146,13 +138,9 @@ instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary -instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData DateTime where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData @@ -160,29 +148,18 @@ instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRende instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString -mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam - -- | @P.Right . P.const NoContent@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty --- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec --- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec --- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec --- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec -{{#x-unknownMimeTypes}} --- instance MimeRender {{{x-mediaDataType}}} T.Text where mimeRender _ = undefined -{{/x-unknownMimeTypes}} - --- ** MimeUnrender Class +-- * 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 --- ** MimeUnrender Instances +-- Default MimeUnrender Instances -- | @A.eitherDecode@ instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode @@ -204,16 +181,4 @@ instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.sho 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 - -{{#x-unknownMimeTypes}} --- instance MimeUnrender {{{x-mediaDataType}}} T.Text where mimeUnrender _ = undefined -{{/x-unknownMimeTypes}} - --- ** Request Consumes - -class MimeType mtype => Consumes req mtype where - --- ** Request Produces - -class MimeType mtype => Produces req mtype where +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent \ 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 c40e0e27184..ca63b567309 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 @@ -17,33 +17,30 @@ Module : {{title}}.Model module {{title}}.Model where +import {{title}}.Core + import Data.Aeson ((.:),(.:!),(.:?),(.=)) import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Base64.Lazy as BL64 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.Set as Set import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH -import qualified Control.DeepSeq as NF -import qualified Data.Ix as P +import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) -import Data.Text (Text) - import qualified Data.Time as TI -import qualified Data.Time.ISO8601 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 @@ -59,14 +56,16 @@ import qualified Prelude as P -- | {{classname}}{{#title}} -- {{{.}}} -- {{/title}}{{#description}} --- {{{.}}}{{/description}} +-- {{{.}}}{{/description}}{{#isAlias}} +newtype {{classname}} = {{classname}} + { un{{classname}} :: {{{dataType}}} + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}}{{^isAlias}} data {{classname}} = {{classname}} { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{datatype}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#readOnly}}/ReadOnly/ {{/readOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{#hasMore}} , {{/hasMore}}{{/vars}} - } deriving (P.Show,P.Eq,P.Typeable{{#modelDeriving}},{{modelDeriving}}{{/modelDeriving}}) + } deriving (P.Show, P.Eq, P.Typeable{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}} - --- | FromJSON {{classname}} +{{^isAlias}}-- | FromJSON {{classname}} instance A.FromJSON {{classname}} where parseJSON = A.withObject "{{classname}}" $ \o -> {{^hasVars}}pure {{/hasVars}}{{classname}} @@ -109,150 +108,9 @@ mk{{classname}} {{#requiredVars}}{{name}} {{/requiredVars}}= , {{/hasMore}}{{/vars}} } {{/generateModelConstructors}} - +{{/isAlias}} + {{/model}} {{/models}} --- * Parameter newtypes - -{{#x-allUniqueParams}} -newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}}) -{{/x-allUniqueParams}} - --- * 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 - where - 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 - --- | Collapse (Just "") to Nothing -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_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 -{-# INLINE _memptyToNothing #-} - --- * DateTime Formatting - -newtype DateTime = DateTime { unDateTime :: TI.UTCTime } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON DateTime where - parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) -instance A.ToJSON DateTime where - 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) -instance P.Show DateTime where - show (DateTime t) = _showDateTime t - --- | @{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ -_readDateTime :: (TI.ParseTime t, Monad m, {{^dateTimeFormat}}Alternative m{{/dateTimeFormat}}) => String -> m t -_readDateTime = - {{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} -{-# INLINE _readDateTime #-} - --- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ -_showDateTime :: ({{^dateTimeFormat}}t ~ TI.UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String -_showDateTime = - {{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}} -{-# INLINE _showDateTime #-} - --- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - -newtype Date = Date { unDate :: TI.Day } - deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON Date where - parseJSON = A.withText "Date" (_readDate . T.unpack) -instance A.ToJSON Date where - 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) -instance P.Show Date where - show (Date t) = _showDate t - --- | @TI.parseTimeM True TI.defaultTimeLocale "{{{dateFormat}}}"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t -_readDate = - TI.parseTimeM True TI.defaultTimeLocale "{{{dateFormat}}}" -{-# INLINE _readDate #-} - --- | @TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}"@ -_showDate :: TI.FormatTime t => t -> String -_showDate = - TI.formatTime TI.defaultTimeLocale "{{{dateFormat}}}" -{-# INLINE _showDate #-} - --- * Byte/Binary Formatting - - --- | base64 encoded characters -newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON ByteArray where - parseJSON = A.withText "ByteArray" _readByteArray -instance A.ToJSON ByteArray where - toJSON = A.toJSON . _showByteArray -instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray -instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray -instance P.Show ByteArray where - show = T.unpack . _showByteArray - --- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray -_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readByteArray #-} - --- | show base64 encoded characters -_showByteArray :: ByteArray -> Text -_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray -{-# INLINE _showByteArray #-} - --- | any sequence of octets -newtype Binary = Binary { unBinary :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON Binary where - parseJSON = A.withText "Binary" _readBinaryBase64 -instance A.ToJSON Binary where - toJSON = A.toJSON . _showBinaryBase64 -instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 -instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 -instance P.Show Binary where - show = T.unpack . _showBinaryBase64 - -_readBinaryBase64 :: Monad m => Text -> m Binary -_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readBinaryBase64 #-} -_showBinaryBase64 :: Binary -> Text -_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/ModelLens.mustache similarity index 87% rename from modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache rename to modules/swagger-codegen/src/main/resources/haskell-http-client/ModelLens.mustache index 458c33eb96b..9e509aeebb5 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Lens.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/ModelLens.mustache @@ -9,7 +9,7 @@ Module : {{title}}.Lens {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} -module {{title}}.Lens where +module {{title}}.ModelLens where import qualified Data.Aeson as A import qualified Data.ByteString.Lazy as BL @@ -24,11 +24,7 @@ import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePa import qualified Prelude as P import {{title}}.Model - --- * 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 +import {{title}}.Core {{#models}} {{#model}} 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 938a16c1ae5..ba1195d798a 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 @@ -70,6 +70,7 @@ These options allow some customization of the code generation process. | generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | {{{generateFormUrlEncodedInstances}}} | | generateLenses | Generate Lens optics for Models | true | {{{generateLenses}}} | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | {{{generateModelConstructors}}} | +| inlineConsumesContentTypes | Inline (hardcode) the content-type on operations that do not have multiple content-types (Consumes) | false | {{{inlineConsumesContentTypes}}} | | modelDeriving | Additional classes to include in the deriving() clause of Models | | {{{modelDeriving}}} | | strictFields | Add strictness annotations to all model fields | true | {{{x-strictFields}}} | | useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | {{{x-useMonadLogger}}} | @@ -109,10 +110,11 @@ This library is intended to be imported qualified. | MODULE | NOTES | | ------------------- | --------------------------------------------------- | | {{title}}.Client | use the "dispatch" functions to send requests | -| {{title}}.API | construct requetss | -| {{title}}.Model | describes models | +| {{title}}.Core | core funcions, config and request types | +| {{title}}.API | construct api requests | +| {{title}}.Model | describes api models | | {{title}}.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| {{title}}.Lens | lenses for model fields | +| {{title}}.ModelLens | lenses for model fields | | {{title}}.Logging | logging functions and utils | 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 2522a571fba..485b41c504c 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,17 +4,19 @@ Module : {{title}} -} module {{title}} - ( module {{title}}.Client - , module {{title}}.API - , module {{title}}.Model - , module {{title}}.MimeTypes - , module {{title}}.Lens + ( module {{title}}.API + , module {{title}}.Client + , module {{title}}.Core , module {{title}}.Logging + , module {{title}}.MimeTypes + , module {{title}}.Model + , module {{title}}.ModelLens ) where import {{title}}.API import {{title}}.Client -import {{title}}.Model -import {{title}}.MimeTypes -import {{title}}.Lens +import {{title}}.Core import {{title}}.Logging +import {{title}}.MimeTypes +import {{title}}.Model +import {{title}}.ModelLens diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/_contentType.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/_contentType.mustache new file mode 100644 index 00000000000..fcdf1460ce3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/_contentType.mustache @@ -0,0 +1 @@ +{{^vendorExtensions.x-inlineContentType}}contentType{{/vendorExtensions.x-inlineContentType}}{{#vendorExtensions.x-inlineContentType}}{{{x-mediaDataType}}}{{/vendorExtensions.x-inlineContentType}} \ 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 729bdb00abe..fb8d17763d5 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 @@ -29,7 +29,7 @@ cabal-version: >= 1.10 extra-source-files: README.md - swagger.json + swagger.yaml library hs-source-dirs: @@ -65,10 +65,11 @@ library {{title}} {{title}}.API {{title}}.Client - {{title}}.Model - {{title}}.MimeTypes - {{title}}.Lens + {{title}}.Core {{title}}.Logging + {{title}}.MimeTypes + {{title}}.Model + {{title}}.ModelLens other-modules: Paths_{{pathsName}} default-language: Haskell2010 diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/swagger.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/swagger.mustache new file mode 100644 index 00000000000..51560926bba --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/swagger.mustache @@ -0,0 +1 @@ +{{{swagger-yaml}}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache index c1752cc1644..f8d6a3c406f 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -2,10 +2,9 @@ module Instances where -import Control.Monad -import Data.Char (isSpace) -import Data.List (sort) -import Test.QuickCheck +import {{title}}.Model +import {{title}}.Core + import qualified Data.Aeson as A import qualified Data.ByteString.Lazy as BL import qualified Data.HashMap.Strict as HM @@ -14,8 +13,12 @@ import qualified Data.Text as T import qualified Data.Time as TI import qualified Data.Vector as V +import Control.Monad +import Data.Char (isSpace) +import Data.List (sort) +import Test.QuickCheck + import ApproxEq -import {{title}}.Model instance Arbitrary T.Text where arbitrary = T.pack <$> arbitrary @@ -90,9 +93,10 @@ instance ApproxEq TI.Day where {{#model}} instance Arbitrary {{classname}} where arbitrary = - {{^hasVars}}pure {{/hasVars}}{{classname}} + {{#isAlias}}{{classname}} <$> arbitrary{{/isAlias}}{{^isAlias}}{{^hasVars}} + pure {{/hasVars}}{{classname}} {{#hasVars}} <$>{{/hasVars}} {{#vars}}arbitrary -- {{name}} :: {{^required}}Maybe {{/required}}{{datatype}} - {{#hasMore}} <*> {{/hasMore}}{{/vars}} + {{#hasMore}} <*> {{/hasMore}}{{/vars}}{{/isAlias}} {{/model}} {{/models}} 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 fbd99027bfd..b79dbe398e0 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,7 +30,6 @@ protected void setExpectations() { times = 1; clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(HaskellHttpClientOptionsProvider.SORT_PARAMS_VALUE)); times = 1; - clientCodegen.setAllowFromJsonNulls(Boolean.valueOf(HaskellHttpClientOptionsProvider.ALLOW_FROMJSON_NULLS)); times = 1; clientCodegen.setAllowToJsonNulls(Boolean.valueOf(HaskellHttpClientOptionsProvider.ALLOW_TOJSON_NULLS)); @@ -41,6 +40,8 @@ protected void setExpectations() { times = 1; clientCodegen.setGenerateLenses(Boolean.valueOf(HaskellHttpClientOptionsProvider.GENERATE_LENSES)); times = 1; + clientCodegen.setInlineConsumesContentTypes(Boolean.valueOf(HaskellHttpClientOptionsProvider.INLINE_CONSUMES_CONTENT_TYPES)); + times = 1; clientCodegen.setModelDeriving(HaskellHttpClientOptionsProvider.MODEL_DERIVING); times = 1; clientCodegen.setDateTimeFormat(HaskellHttpClientOptionsProvider.DATETIME_FORMAT); 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 4695069a53d..1b776f43e13 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 @@ -23,6 +23,7 @@ public class HaskellHttpClientOptionsProvider implements OptionsProvider { public static final String GENERATE_FORM_URLENCODED_INSTANCES = "true"; public static final String GENERATE_LENSES = "true"; public static final String GENERATE_MODEL_CONSTRUCTORS = "true"; + public static final String INLINE_CONSUMES_CONTENT_TYPES = "false"; public static final String USE_MONAD_LOGGER = "false"; @Override @@ -40,16 +41,17 @@ public Map createOptions() { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, HIDE_GENERATION_TIMESTAMP) - .put(HaskellHttpClientCodegen.ALLOW_FROMJSON_NULLS, ALLOW_FROMJSON_NULLS) - .put(HaskellHttpClientCodegen.ALLOW_TOJSON_NULLS, ALLOW_TOJSON_NULLS) - .put(HaskellHttpClientCodegen.DATETIME_FORMAT, DATETIME_FORMAT) - .put(HaskellHttpClientCodegen.DATE_FORMAT, DATE_FORMAT) - .put(HaskellHttpClientCodegen.MODEL_DERIVING, MODEL_DERIVING) - .put(HaskellHttpClientCodegen.GENERATE_FORM_URLENCODED_INSTANCES, GENERATE_FORM_URLENCODED_INSTANCES) - .put(HaskellHttpClientCodegen.GENERATE_LENSES, GENERATE_LENSES) - .put(HaskellHttpClientCodegen.GENERATE_MODEL_CONSTRUCTORS, GENERATE_MODEL_CONSTRUCTORS) - .put(HaskellHttpClientCodegen.STRICT_FIELDS, STRICT_FIELDS) - .put(HaskellHttpClientCodegen.USE_MONAD_LOGGER, USE_MONAD_LOGGER) + .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) + .put(HaskellHttpClientCodegen.PROP_DATE_FORMAT, DATE_FORMAT) + .put(HaskellHttpClientCodegen.PROP_MODEL_DERIVING, MODEL_DERIVING) + .put(HaskellHttpClientCodegen.PROP_GENERATE_FORM_URLENCODED_INSTANCES, GENERATE_FORM_URLENCODED_INSTANCES) + .put(HaskellHttpClientCodegen.PROP_GENERATE_LENSES, GENERATE_LENSES) + .put(HaskellHttpClientCodegen.PROP_GENERATE_MODEL_CONSTRUCTORS, GENERATE_MODEL_CONSTRUCTORS) + .put(HaskellHttpClientCodegen.PROP_INLINE_CONSUMES_CONTENT_TYPES, INLINE_CONSUMES_CONTENT_TYPES) + .put(HaskellHttpClientCodegen.PROP_STRICT_FIELDS, STRICT_FIELDS) + .put(HaskellHttpClientCodegen.PROP_USE_MONAD_LOGGER, USE_MONAD_LOGGER) .build(); } diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 6bad5f06412..2f2a6b4ca70 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -70,6 +70,7 @@ These options allow some customization of the code generation process. | generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true | | generateLenses | Generate Lens optics for Models | true | true | | generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true | +| inlineConsumesContentTypes | Inline (hardcode) the content-type on operations that do not have multiple content-types (Consumes) | false | false | | modelDeriving | Additional classes to include in the deriving() clause of Models | | | | strictFields | Add strictness annotations to all model fields | true | true | | useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | false | @@ -109,10 +110,11 @@ This library is intended to be imported qualified. | MODULE | NOTES | | ------------------- | --------------------------------------------------- | | SwaggerPetstore.Client | use the "dispatch" functions to send requests | -| SwaggerPetstore.API | construct requetss | -| SwaggerPetstore.Model | describes models | +| SwaggerPetstore.Core | core funcions, config and request types | +| SwaggerPetstore.API | construct api requests | +| SwaggerPetstore.Model | describes api models | | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) | -| SwaggerPetstore.Lens | lenses for model fields | +| SwaggerPetstore.ModelLens | lenses for model fields | | SwaggerPetstore.Logging | logging functions and utils | 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 4c459fbdcff..4390d97a497 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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
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

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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)

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: PetId

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Status

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

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

:: PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet 
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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> PetId

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

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

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse 
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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: OrderIdText

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

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

:: OrderId

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Username

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res 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 -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

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 # 
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

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res

req: Request Type, res: Response Type

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

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

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

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

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

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

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

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

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

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res 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 :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +

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

request content-type (MimeType)

-> Client

"body" - client model

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

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> contentType

request content-type (MimeType)

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

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> contentType

request content-type (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res 
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

request content-type (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res 
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)

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

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

request content-type (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client 
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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

Pet

addPet

addPet Source #

Arguments

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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest AddPet contentType res 
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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

deletePet

deletePet Source #

Arguments

:: PetId

"petId" - Pet id to delete

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

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Status

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

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

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] 

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

:: PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet 
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

request content-type (MimeType)

-> Pet

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

-> SwaggerPetstoreRequest UpdatePet contentType res 
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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> contentType

request content-type (MimeType)

-> PetId

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

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

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> contentType

request content-type (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse 
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

HasOptionalParam UploadFile AdditionalMetadata Source #

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

Store

deleteOrder

deleteOrder Source #

Arguments

:: OrderIdText

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

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res 
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 :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #

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

:: OrderId

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

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order 
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

request content-type (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order 
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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

User

createUser

createUser Source #

Arguments

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

request content-type (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res 
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 -> User -> SwaggerPetstoreRequest CreateUser contentType res Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res 
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

request content-type (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res 
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

:: Username

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

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

Get user by user name

loginUser

loginUser Source #

Arguments

:: Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #

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

request content-type (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res 
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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

Parameter newtypes

newtype Body Source #

Constructors

Body 

Fields

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

newtype Name2 Source #

Constructors

Name2 

Fields

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 diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html index b7014dadad5..5d923cb5060 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Config

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

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreConfig -> SwaggerPetstoreRequest req contentType res Source #

apply all matching AuthMethods in config to request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Client

Description

 

Synopsis

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> SwaggerPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

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

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

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

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> SwaggerPetstoreConfig

config

-> SwaggerPetstoreRequest req contentType res

request

-> accept

"accept" MimeType

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> SwaggerPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ 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 new file mode 100644 index 00000000000..684f3ff14b6 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html @@ -0,0 +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 Source #

Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res) Source # 

Methods

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

show :: SwaggerPetstoreRequest req contentType res -> String #

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

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

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

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res -> User -> SwaggerPetstoreRequest UpdateUser contentType res 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 -> User -> SwaggerPetstoreRequest CreateUser contentType res 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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res 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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

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

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

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

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

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

Apply an optional parameter to a request

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

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

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 # 
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

req: Request Type, res: Response Type

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

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

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

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

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

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

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

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

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

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res 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

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreConfig -> IO (SwaggerPetstoreRequest req contentType res) 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-Lens.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html deleted file mode 100644 index 1bf236e5b61..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Lens.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.Lens

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Lens

Description

 

Synopsis

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 #

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/SwaggerPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html index e037820bcc8..c63828e7d60 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

 

Content Negotiation

Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
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 TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

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
Consumes UploadFile 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 # 

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

MimeType Instances

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 # 
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

MimeRender Instances

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

MimeUnrender Instances

Request Consumes

Request Produces

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
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

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 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 # 
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 # 
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 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 1b951745404..ebfe14e31db 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,8 +1,8 @@ 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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

mkOuterBoolean :: OuterBoolean Source #

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

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

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

OuterNumber

mkOuterNumber :: OuterNumber Source #

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

OuterString

mkOuterString :: OuterString Source #

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

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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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)

Parameter newtypes

newtype Body Source #

Constructors

Body 

Fields

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

newtype Name2 Source #

Constructors

Name2 

Fields

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

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 # 
\ 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

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 -> Client -> SwaggerPetstoreRequest TestClassname contentType res Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

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)

EnumClass

mkEnumClass :: EnumClass Source #

Construct a value of type EnumClass (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 -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res Source #

mkOrder :: Order Source #

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

OuterBoolean

OuterComposite

mkOuterComposite :: OuterComposite Source #

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

OuterEnum

mkOuterEnum :: OuterEnum Source #

Construct a value of type OuterEnum (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 -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res 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 -> Pet -> SwaggerPetstoreRequest AddPet contentType res 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 -> User -> SwaggerPetstoreRequest UpdateUser contentType res Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res -> User -> SwaggerPetstoreRequest CreateUser contentType res 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)

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

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.ModelLens

Description

 

Synopsis

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/SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html index 31238fe42e7..1680d0cb7b2 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore.html @@ -1,4 +1,4 @@ SwaggerPetstore

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file +

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

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore

Description

 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html b/samples/client/petstore/haskell-http-client/docs/doc-index-45.html index 49d982e2f0d..6e545c68a84 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-45.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-45.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.API, SwaggerPetstore
\ No newline at end of file +

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

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html b/samples/client/petstore/haskell-http-client/docs/doc-index-95.html index efe12d41b7a..e827808e2f3 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-95.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-95.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 - _

_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - _

_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-A.html b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html index 6a2d3e36fb4..b783b0ca86c 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

addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, 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

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
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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 f3fdd34d807..b7e2456a6ab 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.API, SwaggerPetstore
addAuthMethodSwaggerPetstore.Client, SwaggerPetstore
addFormSwaggerPetstore.API, 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.Lens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.Lens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.Lens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.Lens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, 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.Lens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.Lens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.Lens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.API, SwaggerPetstore
applyOptionalParamSwaggerPetstore.API, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.Lens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.Lens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, 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.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
setBodyParamSwaggerPetstore.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TabSeparatedSwaggerPetstore.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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, 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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.API, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.API, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Model, SwaggerPetstore
_mkParamsSwaggerPetstore.API, SwaggerPetstore
_mkRequestSwaggerPetstore.API, SwaggerPetstore
_omitNullsSwaggerPetstore.Model, SwaggerPetstore
_parseISO8601SwaggerPetstore.Model, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_readByteArraySwaggerPetstore.Model, SwaggerPetstore
_readDateSwaggerPetstore.Model, SwaggerPetstore
_readDateTimeSwaggerPetstore.Model, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.API, SwaggerPetstore
_setBodyBSSwaggerPetstore.API, SwaggerPetstore
_setBodyLBSSwaggerPetstore.API, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.API, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Model, SwaggerPetstore
_showByteArraySwaggerPetstore.Model, SwaggerPetstore
_showDateSwaggerPetstore.Model, SwaggerPetstore
_showDateTimeSwaggerPetstore.Model, SwaggerPetstore
_toCollSwaggerPetstore.API, SwaggerPetstore
_toCollASwaggerPetstore.API, SwaggerPetstore
_toCollA'SwaggerPetstore.API, SwaggerPetstore
_toFormItemSwaggerPetstore.Model, 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
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
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
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
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
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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
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
mkEnumClassSwaggerPetstore.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
mkOuterEnumSwaggerPetstore.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
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, SwaggerPetstore
toPathSwaggerPetstore.Core, SwaggerPetstore
toQuerySwaggerPetstore.Core, SwaggerPetstore
toQueryCollSwaggerPetstore.Core, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.API, 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 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 f96d57a9faf..36273731173 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.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 - 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 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 646bddf512c..8f6c4afb14d 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.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.Lens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.Lens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.Lens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.Lens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.Lens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.Lens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.Lens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.Lens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.Lens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.Lens, SwaggerPetstore
CollectionFormatSwaggerPetstore.API, SwaggerPetstore
CommaSeparatedSwaggerPetstore.API, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Client, SwaggerPetstore
configHostSwaggerPetstore.Client, SwaggerPetstore
configLogContextSwaggerPetstore.Client, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Client, SwaggerPetstore
configUserAgentSwaggerPetstore.Client, SwaggerPetstore
ConsumesSwaggerPetstore.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.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
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.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 32c2921e4d8..b66dd2ca70f 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.Lens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.Lens, 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, 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 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 7e9ba22e7ee..1fe9136d8ee 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

EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.Lens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.Lens, SwaggerPetstore
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.Lens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.Lens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.Lens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - E

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
EnumClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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 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 68faaa60a48..43bb244eb57 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.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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.Lens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.Lens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.Lens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.Lens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.Lens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.Lens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.Lens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.Lens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.Lens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html index d09d2dbedda..a5e96135f95 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-H.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-H.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - H)

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

Index - H

HasBodyParamSwaggerPetstore.API, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.Lens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.Lens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - H

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
\ 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 4ad3661f4b5..f3b5b707ff2 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.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 +

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 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 de449c7ec9c..2bbaa7de958 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.Lens, SwaggerPetstore
Lens_'SwaggerPetstore.Lens, 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, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.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 029952395b9..8286f28c991 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.Lens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.Lens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.Lens, 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
mkEnumClassSwaggerPetstore.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
mkOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkOuterEnumSwaggerPetstore.Model, SwaggerPetstore
mkOuterNumberSwaggerPetstore.Model, SwaggerPetstore
mkOuterStringSwaggerPetstore.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.Lens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.Lens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.Lens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.Lens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.API, 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.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
mkEnumClassSwaggerPetstore.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
mkOuterEnumSwaggerPetstore.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 31e7b08e56b..fb8cbd53997 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.Lens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.Lens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.Lens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.Lens, SwaggerPetstore
newConfigSwaggerPetstore.Client, 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.Lens, 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.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 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 9c5f5e9f313..ad118f965bc 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.Lens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.Lens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.Lens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.Lens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.Lens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.Lens, 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.Lens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.Lens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.Lens, SwaggerPetstore
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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.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
OuterEnum 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.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 bab1b0511dc..c1de26de955 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.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.API, SwaggerPetstore
ParamBodyBSwaggerPetstore.API, SwaggerPetstore
ParamBodyBLSwaggerPetstore.API, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.API, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.API, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.API, 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.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
paramsBodySwaggerPetstore.API, SwaggerPetstore
paramsBodyLSwaggerPetstore.API, SwaggerPetstore
paramsHeadersSwaggerPetstore.API, SwaggerPetstore
paramsHeadersLSwaggerPetstore.API, SwaggerPetstore
paramsQuerySwaggerPetstore.API, SwaggerPetstore
paramsQueryLSwaggerPetstore.API, 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.Lens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.Lens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.Lens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.Lens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.Lens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.Lens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.API, 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.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 diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html index 9c10460372e..fa74e0c7777 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-R.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-R.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - R)

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

Index - R

rAuthTypesSwaggerPetstore.API, SwaggerPetstore
rAuthTypesLSwaggerPetstore.API, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.Lens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.Lens, SwaggerPetstore
removeHeaderSwaggerPetstore.API, SwaggerPetstore
rMethodSwaggerPetstore.API, SwaggerPetstore
rMethodLSwaggerPetstore.API, SwaggerPetstore
rParamsSwaggerPetstore.API, SwaggerPetstore
rParamsLSwaggerPetstore.API, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.API, SwaggerPetstore
rUrlPathLSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

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

Index - R

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
\ 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 e987b83110d..8ae4f899aec 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.API, SwaggerPetstore
setHeaderSwaggerPetstore.API, SwaggerPetstore
setQuerySwaggerPetstore.API, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.API, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.Lens, 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.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
SwaggerPetstoreRequest 
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 - 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 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 c12f179e0e0..4a11f437a62 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.API, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.Lens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.Lens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, 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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.API, SwaggerPetstore
toFormCollSwaggerPetstore.API, SwaggerPetstore
toHeaderSwaggerPetstore.API, SwaggerPetstore
toHeaderCollSwaggerPetstore.API, SwaggerPetstore
toPathSwaggerPetstore.API, SwaggerPetstore
toQuerySwaggerPetstore.API, SwaggerPetstore
toQueryCollSwaggerPetstore.API, 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.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
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, 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 46de12dde75..9abedbd95b8 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

unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Model, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Model, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unDateSwaggerPetstore.Model, SwaggerPetstore
unDateTimeSwaggerPetstore.Model, 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
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, 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.Lens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.Lens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.Lens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.Lens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.Lens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.Lens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.Lens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.Lens, SwaggerPetstore
\ No newline at end of file +

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

Index - U

unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.API, 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 diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html index c117283a2a7..9b71d9683f2 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-W.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-W.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - W)

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

Index - W

withNoLoggingSwaggerPetstore.Client, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Client, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

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

Index - W

withNoLoggingSwaggerPetstore.Core, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Core, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Core, 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 ee514e08183..6fefe19a214 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

\ 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

\ 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 index 98718716a50..dc389c7b979 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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

HasBodyParam

class HasBodyParam req param

HasOptionalParam

class HasOptionalParam req param

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res

data Params

SwaggerPetstoreRequest Utils

Params Utils

Swagger CollectionFormat Utils

AuthMethods

class AuthMethod a

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

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 index a6a810c6a5f..05b8e27c414 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html @@ -1,4 +1,4 @@ SwaggerPetstore.Client

SwaggerPetstore.Client

\ No newline at end of file +

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 new file mode 100644 index 00000000000..27848471619 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Core.html @@ -0,0 +1,4 @@ +SwaggerPetstore.Core

SwaggerPetstore.Core

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

SwaggerPetstore.Lens

Type Aliases

type Lens_' s a

type Lens_ s t a b

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-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html index 4e2ccd9ed50..023970b51a8 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html @@ -1,4 +1,4 @@ SwaggerPetstore.MimeTypes

SwaggerPetstore.MimeTypes

Content Negotiation

Mime Types

data MimeXML

data MimeAny

MimeType Class

class MimeType mtype

MimeType Instances

MimeRender Class

class MimeRender mtype x

MimeRender Instances

MimeUnrender Class

class MimeUnrender mtype o

MimeUnrender Instances

Request Consumes

class Consumes req mtype

Request Produces

class Produces req mtype

\ No newline at end of file +

SwaggerPetstore.MimeTypes

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 index d6fd283f561..99d6cf89bf1 100644 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html @@ -1,4 +1,4 @@ SwaggerPetstore.Model

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

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

Utils

DateTime Formatting

Date Formatting

data Date

Byte/Binary Formatting

data Binary

\ No newline at end of file +

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

\ 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 new file mode 100644 index 00000000000..8eac8e6c4ae --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html @@ -0,0 +1,4 @@ +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/src/Paths_swagger_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html index 5a97d13ab1b..3bba33b677f 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_swagger_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "swagger_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ 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 d35b3e68321..1b60e4447ab 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 @@ -14,1264 +14,1094 @@ -} {-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE ExistentialQuantification #-} +{-# 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.Model as M -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens - -import qualified Data.Aeson as A - -import qualified Data.Time as TI - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Base64 as B64 - -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.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI -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.Set as Set -import qualified Data.Maybe as P -import qualified Data.Proxy as P (Proxy(..)) -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 GHC.Base as P (Alternative) -import qualified Control.Arrow as P (left) +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 -import qualified Lens.Micro as L +-- * Operations -import Data.Monoid ((<>)) -import Data.Function ((&)) -import Data.Text (Text) -import GHC.Base ((<|>)) + +-- ** AnotherFake + +-- *** testSpecialTags -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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestSpecialTags contentType Client -testSpecialTags _ body = - _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` body - -data TestSpecialTags +-- | @PATCH \/another-fake\/dummy@ +-- +-- To test special tags +-- +-- To test special tags +-- +testSpecialTags + :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestSpecialTags contentType Client +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 + --- | /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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber -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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString -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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClientModel contentType Client -testClientModel _ body = - _mkRequest "PATCH" ["/fake"] - `setBodyParam` body - -data TestClientModel +-- ** Fake + +-- *** fakeOuterBooleanSerialize + +-- | @POST \/fake\/outer\/boolean@ +-- +-- Test serialization of outer boolean types +-- +fakeOuterBooleanSerialize + :: (Consumes FakeOuterBooleanSerialize contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber +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 -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString +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 -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClientModel contentType Client +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 + --- | /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 -- ^ request content-type ('MimeType') - -> Number -- ^ "number" - None - -> ParamDouble -- ^ "double" - None - -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None - -> Byte -- ^ "byte" - None - -> SwaggerPetstoreRequest TestEndpointParameters contentType res -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 +-- *** 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 -- ^ request content-type ('MimeType') + -> Number -- ^ "number" - None + -> ParamDouble -- ^ "double" - None + -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None + -> Byte -- ^ "byte" - None + -> SwaggerPetstoreRequest TestEndpointParameters contentType res +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/ "integer" - None -instance HasOptionalParam TestEndpointParameters ParamInteger where - applyOptionalParam req (ParamInteger xs) = - req `addForm` toForm ("integer", xs) +-- | /Optional Param/ "int64" - None +instance HasOptionalParam TestEndpointParameters Int64 where + applyOptionalParam req (Int64 xs) = + req `addForm` toForm ("int64", xs) --- | /Optional Param/ "int32" - None -instance HasOptionalParam TestEndpointParameters Int32 where - applyOptionalParam req (Int32 xs) = - req `addForm` toForm ("int32", xs) +-- | /Optional Param/ "float" - None +instance HasOptionalParam TestEndpointParameters ParamFloat where + applyOptionalParam req (ParamFloat xs) = + req `addForm` toForm ("float", xs) --- | /Optional Param/ "int64" - None -instance HasOptionalParam TestEndpointParameters Int64 where - applyOptionalParam req (Int64 xs) = - req `addForm` toForm ("int64", xs) +-- | /Optional Param/ "string" - None +instance HasOptionalParam TestEndpointParameters ParamString where + applyOptionalParam req (ParamString xs) = + req `addForm` toForm ("string", xs) --- | /Optional Param/ "float" - None -instance HasOptionalParam TestEndpointParameters ParamFloat where - applyOptionalParam req (ParamFloat xs) = - req `addForm` toForm ("float", xs) +-- | /Optional Param/ "binary" - None +instance HasOptionalParam TestEndpointParameters ParamBinary where + applyOptionalParam req (ParamBinary xs) = + req `addForm` toForm ("binary", xs) --- | /Optional Param/ "string" - None -instance HasOptionalParam TestEndpointParameters ParamString where - applyOptionalParam req (ParamString xs) = - req `addForm` toForm ("string", xs) +-- | /Optional Param/ "date" - None +instance HasOptionalParam TestEndpointParameters ParamDate where + applyOptionalParam req (ParamDate xs) = + req `addForm` toForm ("date", xs) --- | /Optional Param/ "binary" - None -instance HasOptionalParam TestEndpointParameters ParamBinary where - applyOptionalParam req (ParamBinary xs) = - req `addForm` toForm ("binary", xs) +-- | /Optional Param/ "dateTime" - None +instance HasOptionalParam TestEndpointParameters ParamDateTime where + applyOptionalParam req (ParamDateTime xs) = + req `addForm` toForm ("dateTime", xs) --- | /Optional Param/ "date" - None -instance HasOptionalParam TestEndpointParameters ParamDate where - applyOptionalParam req (ParamDate xs) = - req `addForm` toForm ("date", xs) +-- | /Optional Param/ "password" - None +instance HasOptionalParam TestEndpointParameters Password where + applyOptionalParam req (Password xs) = + req `addForm` toForm ("password", xs) --- | /Optional Param/ "dateTime" - None -instance HasOptionalParam TestEndpointParameters ParamDateTime where - applyOptionalParam req (ParamDateTime xs) = - req `addForm` toForm ("dateTime", xs) +-- | /Optional Param/ "callback" - None +instance HasOptionalParam TestEndpointParameters Callback where + applyOptionalParam req (Callback xs) = + req `addForm` toForm ("callback", xs) --- | /Optional Param/ "password" - None -instance HasOptionalParam TestEndpointParameters Password where - applyOptionalParam req (Password xs) = - req `addForm` toForm ("password", xs) +-- | @application/xml; charset=utf-8@ +instance Consumes TestEndpointParameters MimeXmlCharsetutf8 +-- | @application/json; charset=utf-8@ +instance Consumes TestEndpointParameters MimeJsonCharsetutf8 --- | /Optional Param/ "callback" - None -instance HasOptionalParam TestEndpointParameters Callback where - applyOptionalParam req (Callback xs) = - req `addForm` toForm ("callback", xs) +-- | @application/xml; charset=utf-8@ +instance Produces TestEndpointParameters MimeXmlCharsetutf8 +-- | @application/json; charset=utf-8@ +instance Produces TestEndpointParameters MimeJsonCharsetutf8 --- | @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 -- ^ request content-type ('MimeType') - -> SwaggerPetstoreRequest TestEnumParameters contentType res -testEnumParameters _ = - _mkRequest "GET" ["/fake"] - -data TestEnumParameters + +-- *** testEnumParameters + +-- | @GET \/fake@ +-- +-- To test enum parameters +-- +-- To test enum parameters +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEnumParameters + :: (Consumes TestEnumParameters contentType) + => contentType -- ^ request content-type ('MimeType') + -> SwaggerPetstoreRequest TestEnumParameters contentType res +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_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_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_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" - Header parameter enum test (string) +instance HasOptionalParam TestEnumParameters EnumHeaderString where + applyOptionalParam req (EnumHeaderString xs) = + req `setHeader` toHeader ("enum_header_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_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_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" - 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_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_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_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_double" - Query parameter enum test (double) +instance HasOptionalParam TestEnumParameters EnumQueryDouble where + applyOptionalParam req (EnumQueryDouble xs) = + req `addForm` toForm ("enum_query_double", 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 - - --- *** testJsonFormData - --- | @GET \/fake\/jsonFormData@ --- --- test json serialization of form data --- --- --- -testJsonFormData - :: (Consumes TestJsonFormData contentType) - => contentType -- ^ request content-type ('MimeType') - -> Param -- ^ "param" - field1 - -> Param2 -- ^ "param2" - field2 - -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent -testJsonFormData _ (Param param) (Param2 param2) = - _mkRequest "GET" ["/fake/jsonFormData"] - `addForm` toForm ("param", param) - `addForm` toForm ("param2", param2) +-- | @*/*@ +instance Consumes TestEnumParameters MimeAny + +-- | @*/*@ +instance Produces TestEnumParameters MimeAny + + +-- *** testJsonFormData + +-- | @GET \/fake\/jsonFormData@ +-- +-- test json serialization of form data +-- +-- +-- +testJsonFormData + :: (Consumes TestJsonFormData contentType) + => contentType -- ^ request content-type ('MimeType') + -> Param -- ^ "param" - field1 + -> Param2 -- ^ "param2" - field2 + -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent +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 -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 -- ^ request content-type ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClassname contentType Client -testClassname _ body = - _mkRequest "PATCH" ["/fake_classname_test"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` body - -data TestClassname +-- | @PATCH \/fake_classname_test@ +-- +-- To test class name in snake case +-- +-- AuthMethod: 'AuthApiKeyApiKeyQuery' +-- +testClassname + :: (Consumes TestClassname contentType, MimeRender contentType Client) + => contentType -- ^ request content-type ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClassname contentType Client +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 + --- | /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 -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res -addPet _ body = - _mkRequest "POST" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body +-- ** 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 -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest AddPet contentType res +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 -data AddPet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam AddPet Pet +-- | @application/xml@ +instance Produces AddPet MimeXML +-- | @application/json@ +instance Produces AddPet MimeJSON --- | @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 - :: PetId -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res -deletePet (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + +-- *** deletePet + +-- | @DELETE \/pet\/{petId}@ +-- +-- Deletes a pet +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deletePet + :: PetId -- ^ "petId" - Pet id to delete + -> SwaggerPetstoreRequest DeletePet MimeNoContent res +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 + -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 - :: Status -- ^ "status" - Status values that need to be considered for filter - -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] -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 - :: Tags -- ^ "tags" - Tags to filter by - -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] -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 - :: PetId -- ^ "petId" - ID of pet to return - -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet -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 -- ^ request content-type ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res -updatePet _ body = - _mkRequest "PUT" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body +-- *** findPetsByStatus + +-- | @GET \/pet\/findByStatus@ +-- +-- Finds Pets by status +-- +-- Multiple status values can be provided with comma separated strings +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +findPetsByStatus + :: Status -- ^ "status" - Status values that need to be considered for filter + -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] +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 + :: Tags -- ^ "tags" - Tags to filter by + -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] +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 + :: PetId -- ^ "petId" - ID of pet to return + -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet +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 -- ^ request content-type ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest UpdatePet contentType res +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 -data UpdatePet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam UpdatePet Pet +-- | @application/xml@ +instance Produces UpdatePet MimeXML +-- | @application/json@ +instance Produces UpdatePet MimeJSON --- | @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 -- ^ request content-type ('MimeType') - -> PetId -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res -updatePetWithForm _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UpdatePetWithForm + +-- *** 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 -- ^ request content-type ('MimeType') + -> PetId -- ^ "petId" - ID of pet that needs to be updated + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res +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) --- | /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 -- ^ request content-type ('MimeType') - -> PetId -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse -uploadFile _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UploadFile +-- | @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 -- ^ request content-type ('MimeType') + -> PetId -- ^ "petId" - ID of pet to update + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse +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 --- | /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 - :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res -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 - :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) -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 - :: OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order -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 -- ^ request content-type ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order -placeOrder _ body = - _mkRequest "POST" ["/store/order"] - `setBodyParam` body +-- | @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 + :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res +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 + :: SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) +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 + :: OrderId -- ^ "orderId" - ID of pet that needs to be fetched + -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order +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 -- ^ request content-type ('MimeType') + -> Order -- ^ "body" - order placed for purchasing the pet + -> SwaggerPetstoreRequest PlaceOrder contentType Order +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 + -data PlaceOrder +-- ** User --- | /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 -- ^ request content-type ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res -createUser _ body = - _mkRequest "POST" ["/user"] - `setBodyParam` body +-- *** 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 -- ^ request content-type ('MimeType') + -> User -- ^ "body" - Created user object + -> SwaggerPetstoreRequest CreateUser contentType res +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 + -data CreateUser +-- *** createUsersWithArrayInput --- | /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 -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res -createUsersWithArrayInput _ body = - _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body +-- | @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 -- ^ request content-type ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res +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 + -data CreateUsersWithArrayInput +-- *** createUsersWithListInput --- | /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 -- ^ request content-type ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res -createUsersWithListInput _ body = - _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body +-- | @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 -- ^ request content-type ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res +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 + -data CreateUsersWithListInput +-- *** deleteUser --- | /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 - :: Username -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res -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 - :: Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User -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 - :: Username -- ^ "username" - The user name for login - -> Password -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text -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 - :: SwaggerPetstoreRequest LogoutUser MimeNoContent res -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 -- ^ request content-type ('MimeType') - -> Username -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res -updateUser _ (Username username) body = - _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body +-- | @DELETE \/user\/{username}@ +-- +-- Delete user +-- +-- This can only be done by the logged in user. +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deleteUser + :: Username -- ^ "username" - The name that needs to be deleted + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res +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 + :: Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + -> SwaggerPetstoreRequest GetUserByName MimeNoContent User +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 + :: Username -- ^ "username" - The user name for login + -> Password -- ^ "password" - The password for login in clear text + -> SwaggerPetstoreRequest LoginUser MimeNoContent Text +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 + :: SwaggerPetstoreRequest LogoutUser MimeNoContent res +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 -- ^ request content-type ('MimeType') + -> Username -- ^ "username" - name that need to be deleted + -> User -- ^ "body" - Updated user object + -> SwaggerPetstoreRequest UpdateUser contentType res +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 + -data UpdateUser - --- | /Body Param/ "body" - Updated user object -instance HasBodyParam UpdateUser User --- | @application/xml@ -instance Produces UpdateUser MimeXML --- | @application/json@ -instance Produces UpdateUser MimeJSON - - - --- * HasBodyParam - --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} - - -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * SwaggerPetstoreRequest - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest - { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , rParams :: Params -- ^ params of SwaggerPetstoreRequest - , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods - } - deriving (P.Show) - --- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod -{-# INLINE rMethodL #-} - --- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath -{-# INLINE rUrlPathL #-} - --- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams -{-# INLINE rParamsL #-} - --- | 'rParams' Lens -rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep] -rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes -{-# INLINE rAuthTypesL #-} + +-- * 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 :: Text } deriving (P.Eq, P.Show) +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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 --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | 'paramsQuery' Lens -paramsQueryL :: Lens_' Params NH.Query -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 -{-# INLINE paramsHeadersL #-} - --- | 'paramsBody' Lens -paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody -{-# INLINE paramsBodyL #-} - --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** SwaggerPetstoreRequest Utils - -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone - -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +-- ** 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) -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & - L.over - (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) - where - cifst = CI.mk . P.fst - - -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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 -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] - -setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -setQuery req query = - req & - L.over - (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) - where - cifst = CI.mk . P.fst - -addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) - -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) - -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) - -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) - -_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) - --- ** Params Utils - -toPath - :: 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] - -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 - --- *** Swagger `CollectionFormat` Utils - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') - -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 - where - 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 - -_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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - --- * AuthMethods - --- | Provides a method to apply auth methods to requests -class P.Typeable a => AuthMethod a where - applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res - --- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) - -instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a - --- ** AuthApiKeyApiKey -data AuthApiKeyApiKey = - AuthApiKeyApiKey Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod req a@(AuthApiKeyApiKey secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - else req - --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - 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 req a@(AuthOAuthPetstoreAuth secret) = - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - else req - - - \ No newline at end of file +-- | @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.Client.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html index f47f1bee7da..2c876b81d8a 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 @@ -25,273 +25,194 @@ module SwaggerPetstore.Client where -import SwaggerPetstore.Model -import SwaggerPetstore.API +import SwaggerPetstore.Core +import SwaggerPetstore.Logging import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Logging - + +import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A +import qualified Control.Monad as P import qualified Data.Aeson.Types as A -import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Data.Time as TI -import qualified Data.Map as Map -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB -import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH -import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH - -import qualified Control.Exception.Safe as E --- * Config - --- | -data SwaggerPetstoreConfig = SwaggerPetstoreConfig - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance - , configLogContext :: LogContext -- ^ Configures the logger - , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods - } - --- | display the config -instance Show SwaggerPetstoreConfig where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default SwaggerPetstoreConfig --- --- configHost: --- --- @http://petstore.swagger.io:80/v2@ --- --- configUserAgent: --- --- @"swagger-haskell-http-client/1.0.0"@ --- -newConfig :: IO SwaggerPetstoreConfig -newConfig = do - logCxt <- initLogContext - return $ SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io:80/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt - , configAuthMethods = [] - } +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) + +-- * Dispatch + +-- ** Lbs + +-- | send a request returning the raw http response +dispatchLbs + :: (Produces req accept, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbs manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- ** Mime + +-- | pair of decoded http body and http response +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + } + deriving (Show, Functor, Foldable, Traversable) + +-- | pair of unrender/parser error and http response +data MimeError = + MimeError { + mimeError :: String -- ^ unrender/parser error + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + } deriving (Eq, Show) + +-- | send a request returning the 'MimeResult' +dispatchMime + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request accept = do + httpResponse <- dispatchLbs manager config request accept + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do case mimeUnrender' 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) --- | updates config use AuthMethod on matching requests -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 } - --- | updates the config to use stderr logging -withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig -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} - --- * Dispatch - --- ** Lbs - --- | send a request returning the raw http response -dispatchLbs - :: (Produces req accept, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- ** Mime - --- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response - } - deriving (Show, Functor, Foldable, Traversable) - --- | pair of unrender/parser error and http response -data MimeError = - MimeError { - mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response - } deriving (Eq, Show) - --- | send a request returning the 'MimeResult' -dispatchMime - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request accept = do - httpResponse <- dispatchLbs manager config request accept - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do case mimeUnrender' 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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request accept = do - MimeResult parsedResult _ <- dispatchMime manager config request accept - 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) - => NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request accept = do - initReq <- _toInitRequest config request accept - dispatchInitUnsafe manager config initReq - --- | dispatch an InitRequest -dispatchInitUnsafe - :: NH.Manager -- ^ http-client Connection manager - -> SwaggerPetstoreConfig -- ^ config - -> 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 - where - 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) - _ -> "<RequestBody>") - 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 - { unInitRequest :: NH.Request - } deriving (Show) - --- | Build an http-client 'Request' record from the supplied config and request -_toInitRequest - :: (MimeType accept, MimeType contentType) - => SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res -- ^ request - -> accept -- ^ "accept" 'MimeType' - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _applyAuthMethods req0 config - & _setContentTypeHeader - & flip _setAcceptHeader accept - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) 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) - --- | apply all matching AuthMethods in config to request -_applyAuthMethods - :: SwaggerPetstoreRequest req contentType res - -> SwaggerPetstoreConfig - -> SwaggerPetstoreRequest req contentType res -_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = - foldl go req as - where - go r (AnyAuthMethod a) = r `applyAuthMethod` a - --- | 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) - --- | 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) - --- ** Logging - --- | Run a block using the configured logger instance -runConfigLog - :: 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 - \ No newline at end of file +-- | like 'dispatchMime', but only returns the decoded http body +dispatchMime' + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request accept = do + MimeResult parsedResult _ <- dispatchMime manager config request accept + 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) + => NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (NH.Response BCL.ByteString) -- ^ response +dispatchLbsUnsafe manager config request accept = do + initReq <- _toInitRequest config request accept + dispatchInitUnsafe manager config initReq + +-- | dispatch an InitRequest +dispatchInitUnsafe + :: NH.Manager -- ^ http-client Connection manager + -> SwaggerPetstoreConfig -- ^ config + -> 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 + where + 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) + _ -> "<RequestBody>") + 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 + { unInitRequest :: NH.Request + } deriving (Show) + +-- | Build an http-client 'Request' record from the supplied config and request +_toInitRequest + :: (MimeType accept, MimeType contentType) + => SwaggerPetstoreConfig -- ^ config + -> SwaggerPetstoreRequest req contentType res -- ^ request + -> accept -- ^ "accept" 'MimeType' + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 accept = + 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.throwString $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & flip _setAcceptHeader accept + 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 + + 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) + +-- | 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) + +-- ** Logging + +-- | Run a block using the configured logger instance +runConfigLog + :: 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 + \ 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 new file mode 100644 index 00000000000..c170e868212 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html @@ -0,0 +1,533 @@ +
{-
+   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.Core
+-}
+
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-}
+
+module SwaggerPetstore.Core where
+
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Logging
+
+import qualified Control.Arrow as P (left)
+import qualified Control.DeepSeq as NF
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Base64.Lazy as BL64
+import qualified Data.ByteString.Builder as BB
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Lazy.Char8 as BCL
+import qualified Data.CaseInsensitive as CI
+import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Ix as P
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Time as TI
+import qualified Data.Time.ISO8601 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.Types as NH
+import qualified Prelude as P
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+import qualified Text.Printf as T
+
+import Control.Applicative ((<|>))
+import Control.Applicative (Alternative)
+import Data.Function ((&))
+import Data.Foldable(foldlM)
+import Data.Monoid ((<>))
+import Data.Text (Text)
+import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor)
+
+-- * SwaggerPetstoreConfig
+
+-- | 
+data SwaggerPetstoreConfig = SwaggerPetstoreConfig
+  { configHost  :: BCL.ByteString -- ^ host supplied in the Request
+  , configUserAgent :: Text -- ^ user-agent supplied in the Request
+  , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
+  , configLogContext :: LogContext -- ^ Configures the logger
+  , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods
+  , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured
+  }
+
+-- | display the config
+instance P.Show SwaggerPetstoreConfig where
+  show c =
+    T.printf
+      "{ configHost = %v, configUserAgent = %v, ..}"
+      (show (configHost c))
+      (show (configUserAgent c))
+
+-- | constructs a default SwaggerPetstoreConfig
+--
+-- configHost:
+--
+-- @http://petstore.swagger.io:80/v2@
+--
+-- configUserAgent:
+--
+-- @"swagger-haskell-http-client/1.0.0"@
+--
+newConfig :: IO SwaggerPetstoreConfig
+newConfig = do
+    logCxt <- initLogContext
+    return $ SwaggerPetstoreConfig
+        { configHost = "http://petstore.swagger.io:80/v2"
+        , configUserAgent = "swagger-haskell-http-client/1.0.0"
+        , configLogExecWithContext = runDefaultLogExecWithContext
+        , 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}
+
+-- | updates the config to use stdout logging
+withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
+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 }
+
+-- | updates the config to disable logging
+withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
+withNoLogging p = p { configLogExecWithContext =  runNullLogExec}
+ 
+-- * SwaggerPetstoreRequest
+
+-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
+data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest
+  { rMethod  :: NH.Method   -- ^ Method of SwaggerPetstoreRequest
+  , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest
+  , rParams   :: Params -- ^ params of SwaggerPetstoreRequest
+  , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods
+  }
+  deriving (P.Show)
+
+-- | 'rMethod' Lens
+rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method
+rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod
+{-# INLINE rMethodL #-}
+
+-- | 'rUrlPath' Lens
+rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString]
+rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath
+{-# INLINE rUrlPathL #-}
+
+-- | 'rParams' Lens
+rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params
+rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams
+{-# INLINE rParamsL #-}
+
+-- | 'rParams' Lens
+rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [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. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  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
+  {-# MINIMAL applyOptionalParam | (-&-) #-}
+
+  -- | Apply an optional parameter to a request
+  applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  applyOptionalParam = (-&-)
+  {-# INLINE applyOptionalParam #-}
+
+  -- | infix operator \/ alias for 'addOptionalParam'
+  (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  (-&-) = applyOptionalParam
+  {-# INLINE (-&-) #-}
+
+infixl 2 -&-
+
+-- | Request Params
+data Params = Params
+  { paramsQuery :: NH.Query
+  , paramsHeaders :: NH.RequestHeaders
+  , paramsBody :: ParamBody
+  }
+  deriving (P.Show)
+
+-- | 'paramsQuery' Lens
+paramsQueryL :: Lens_' Params NH.Query
+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
+{-# INLINE paramsHeadersL #-}
+
+-- | 'paramsBody' Lens
+paramsBodyL :: Lens_' Params ParamBody
+paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
+{-# INLINE paramsBodyL #-}
+
+-- | Request Body
+data ParamBody
+  = ParamBodyNone
+  | ParamBodyB B.ByteString
+  | ParamBodyBL BL.ByteString
+  | ParamBodyFormUrlEncoded WH.Form
+  | ParamBodyMultipartFormData [NH.Part]
+  deriving (P.Show)
+
+-- ** SwaggerPetstoreRequest Utils
+
+_mkRequest :: NH.Method -- ^ Method 
+          -> [BCL.ByteString] -- ^ Endpoint
+          -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type
+_mkRequest m u = SwaggerPetstoreRequest m u _mkParams []
+
+_mkParams :: Params
+_mkParams = Params [] [] ParamBodyNone
+
+setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res
+setHeader req header =
+  req `removeHeader` P.fmap P.fst header &
+  L.over (rParamsL . paramsHeadersL) (header P.++)
+
+removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res
+removeHeader req header =
+  req &
+  L.over
+    (rParamsL . paramsHeadersL)
+    (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
+  where
+    cifst = CI.mk . P.fst
+
+
+_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
+_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
+_setAcceptHeader req accept =
+    case mimeType' accept of 
+        Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
+        Nothing -> req `removeHeader` ["accept"]
+
+setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res
+setQuery req query = 
+  req &
+  L.over
+    (rParamsL . paramsQueryL)
+    ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
+  where
+    cifst = CI.mk . P.fst
+
+addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res
+addForm req newform = 
+    let form = case paramsBody (rParams req) of
+            ParamBodyFormUrlEncoded _form -> _form
+            _ -> mempty
+    in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
+
+_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res
+_addMultiFormPart req newpart = 
+    let parts = case paramsBody (rParams req) of
+            ParamBodyMultipartFormData _parts -> _parts
+            _ -> []
+    in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))
+
+_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res
+_setBodyBS req body = 
+    req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)
+
+_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res
+_setBodyLBS req body = 
+    req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)
+
+_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res
+_hasAuthType req proxy =
+  req & L.over rAuthTypesL (P.typeRep proxy :)
+
+-- ** Params Utils
+
+toPath
+  :: 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]
+
+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
+
+-- *** Swagger `CollectionFormat` Utils
+
+-- | Determines the format of the array if type array is used.
+data CollectionFormat
+  = 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" ('NH.Query') or "formData" ('WH.Form')
+
+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
+  where
+    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
+
+_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.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
+    {-# INLINE go #-}
+    {-# INLINE expandList #-}
+    {-# INLINE combine #-}
+  
+-- * AuthMethods
+
+-- | Provides a method to apply auth methods to requests
+class P.Typeable a =>
+      AuthMethod a  where
+  applyAuthMethod
+    :: SwaggerPetstoreConfig
+    -> a
+    -> SwaggerPetstoreRequest req contentType res
+    -> IO (SwaggerPetstoreRequest req contentType res)
+
+-- | An existential wrapper for any AuthMethod
+data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable)
+
+instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req
+
+-- | apply all matching AuthMethods in config to request
+_applyAuthMethods
+  :: SwaggerPetstoreRequest req contentType res
+  -> SwaggerPetstoreConfig
+  -> IO (SwaggerPetstoreRequest req contentType res)
+_applyAuthMethods req config@(SwaggerPetstoreConfig {configAuthMethods = as}) =
+  foldlM go req as
+  where
+    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
+  where
+    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
+
+-- | Collapse (Just "") to Nothing
+_emptyToNothing :: Maybe String -> Maybe String
+_emptyToNothing (Just "") = Nothing
+_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
+{-# INLINE _memptyToNothing #-}
+
+-- * DateTime Formatting
+
+newtype DateTime = DateTime { unDateTime :: TI.UTCTime }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime)
+instance A.FromJSON DateTime where
+  parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)
+instance A.ToJSON DateTime where
+  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)
+instance P.Show DateTime where
+  show (DateTime t) = _showDateTime t
+instance MimeRender MimeMultipartFormData DateTime where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | @_parseISO8601@
+_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 =
+  TI.formatISO8601Millis
+{-# INLINE _showDateTime #-}
+
+-- | parse an ISO8601 date-time string
+_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
+_parseISO8601 t =
+  P.asum $
+  P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$>
+  ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]
+{-# INLINE _parseISO8601 #-}
+
+-- * Date Formatting
+
+newtype Date = Date { unDate :: TI.Day }
+  deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime)
+instance A.FromJSON Date where
+  parseJSON = A.withText "Date" (_readDate . T.unpack)
+instance A.ToJSON Date where
+  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)
+instance P.Show Date where
+  show (Date t) = _showDate t
+instance MimeRender MimeMultipartFormData Date where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@
+_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 TI.defaultTimeLocale "%Y-%m-%d"
+{-# INLINE _showDate #-}
+
+-- * Byte/Binary Formatting
+
+  
+-- | base64 encoded characters
+newtype ByteArray = ByteArray { unByteArray :: BL.ByteString }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
+
+instance A.FromJSON ByteArray where
+  parseJSON = A.withText "ByteArray" _readByteArray
+instance A.ToJSON ByteArray where
+  toJSON = A.toJSON . _showByteArray
+instance WH.FromHttpApiData ByteArray where
+  parseUrlPiece = P.left T.pack . _readByteArray
+instance WH.ToHttpApiData ByteArray where
+  toUrlPiece = _showByteArray
+instance P.Show ByteArray where
+  show = T.unpack . _showByteArray
+instance MimeRender MimeMultipartFormData ByteArray where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | read base64 encoded characters
+_readByteArray :: Monad m => Text -> m ByteArray
+_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8
+{-# INLINE _readByteArray #-}
+
+-- | show base64 encoded characters
+_showByteArray :: ByteArray -> Text
+_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray
+{-# INLINE _showByteArray #-}
+
+-- | any sequence of octets
+newtype Binary = Binary { unBinary :: BL.ByteString }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
+
+instance A.FromJSON Binary where
+  parseJSON = A.withText "Binary" _readBinaryBase64
+instance A.ToJSON Binary where
+  toJSON = A.toJSON . _showBinaryBase64
+instance WH.FromHttpApiData Binary where
+  parseUrlPiece = P.left T.pack . _readBinaryBase64
+instance WH.ToHttpApiData Binary where
+  toUrlPiece = _showBinaryBase64
+instance P.Show Binary where
+  show = T.unpack . _showBinaryBase64
+instance MimeRender MimeMultipartFormData Binary where
+  mimeRender _ = unBinary
+
+_readBinaryBase64 :: Monad m => Text -> m Binary
+_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8
+{-# INLINE _readBinaryBase64 #-}
+
+_showBinaryBase64 :: Binary -> Text
+_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
+{-# INLINE _showBinaryBase64 #-}
+
+-- * 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
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html deleted file mode 100644 index 8457b7f4eaf..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Lens.html +++ /dev/null @@ -1,642 +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: \" \\
-
-   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.Lens
--}
-
-{-# LANGUAGE KindSignatures #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
-
-module SwaggerPetstore.Lens where
-
-import qualified Data.Aeson as A
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.Data as P (Data, Typeable)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Time as TI
-
-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
-
-import SwaggerPetstore.Model
-
--- * 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
-
-
--- * AdditionalPropertiesClass
-
--- | 'additionalPropertiesClassMapProperty' Lens
-additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
-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
-{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
-
-
-
--- * Animal
-
--- | 'animalClassName' Lens
-animalClassNameL :: Lens_' Animal (Text)
-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
-{-# INLINE animalColorL #-}
-
-
-
--- * AnimalFarm
-
-
-
--- * ApiResponse
-
--- | 'apiResponseCode' Lens
-apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
-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
-{-# INLINE apiResponseTypeL #-}
-
--- | 'apiResponseMessage' Lens
-apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)
-apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage
-{-# INLINE apiResponseMessageL #-}
-
-
-
--- * ArrayOfArrayOfNumberOnly
-
--- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
-arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
-arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
-{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
-
-
-
--- * ArrayOfNumberOnly
-
--- | 'arrayOfNumberOnlyArrayNumber' Lens
-arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
-arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
-{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
-
-
-
--- * ArrayTest
-
--- | 'arrayTestArrayOfString' Lens
-arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
-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
-{-# INLINE arrayTestArrayArrayOfIntegerL #-}
-
--- | 'arrayTestArrayArrayOfModel' Lens
-arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])
-arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel
-{-# INLINE arrayTestArrayArrayOfModelL #-}
-
-
-
--- * Capitalization
-
--- | 'capitalizationSmallCamel' Lens
-capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
-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
-{-# INLINE capitalizationCapitalCamelL #-}
-
--- | 'capitalizationSmallSnake' Lens
-capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
-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
-{-# INLINE capitalizationCapitalSnakeL #-}
-
--- | 'capitalizationScaEthFlowPoints' Lens
-capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
-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
-{-# INLINE capitalizationAttNameL #-}
-
-
-
--- * Category
-
--- | 'categoryId' Lens
-categoryIdL :: Lens_' Category (Maybe Integer)
-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
-{-# INLINE categoryNameL #-}
-
-
-
--- * ClassModel
-
--- | 'classModelClass' Lens
-classModelClassL :: Lens_' ClassModel (Maybe Text)
-classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
-{-# INLINE classModelClassL #-}
-
-
-
--- * Client
-
--- | 'clientClient' Lens
-clientClientL :: Lens_' Client (Maybe Text)
-clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
-{-# INLINE clientClientL #-}
-
-
-
--- * EnumArrays
-
--- | 'enumArraysJustSymbol' Lens
-enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
-enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
-{-# INLINE enumArraysJustSymbolL #-}
-
--- | 'enumArraysArrayEnum' Lens
-enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
-enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
-{-# INLINE enumArraysArrayEnumL #-}
-
-
-
--- * EnumClass
-
-
-
--- * EnumTest
-
--- | 'enumTestEnumString' Lens
-enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
-enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
-{-# INLINE enumTestEnumStringL #-}
-
--- | 'enumTestEnumInteger' Lens
-enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
-enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
-{-# INLINE enumTestEnumIntegerL #-}
-
--- | 'enumTestEnumNumber' Lens
-enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
-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
-{-# INLINE enumTestOuterEnumL #-}
-
-
-
--- * FormatTest
-
--- | 'formatTestInteger' Lens
-formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
-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
-{-# INLINE formatTestInt32L #-}
-
--- | 'formatTestInt64' Lens
-formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
-formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
-{-# INLINE formatTestInt64L #-}
-
--- | 'formatTestNumber' Lens
-formatTestNumberL :: Lens_' FormatTest (Double)
-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
-{-# INLINE formatTestFloatL #-}
-
--- | 'formatTestDouble' Lens
-formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
-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
-{-# INLINE formatTestStringL #-}
-
--- | 'formatTestByte' Lens
-formatTestByteL :: Lens_' FormatTest (ByteArray)
-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
-{-# INLINE formatTestBinaryL #-}
-
--- | 'formatTestDate' Lens
-formatTestDateL :: Lens_' FormatTest (Date)
-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
-{-# INLINE formatTestDateTimeL #-}
-
--- | 'formatTestUuid' Lens
-formatTestUuidL :: Lens_' FormatTest (Maybe Text)
-formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
-{-# INLINE formatTestUuidL #-}
-
--- | 'formatTestPassword' Lens
-formatTestPasswordL :: Lens_' FormatTest (Text)
-formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
-{-# INLINE formatTestPasswordL #-}
-
-
-
--- * HasOnlyReadOnly
-
--- | 'hasOnlyReadOnlyBar' Lens
-hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
-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
-{-# INLINE hasOnlyReadOnlyFooL #-}
-
-
-
--- * MapTest
-
--- | 'mapTestMapMapOfString' Lens
-mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
-mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
-{-# INLINE mapTestMapMapOfStringL #-}
-
--- | 'mapTestMapOfEnumString' Lens
-mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
-mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
-{-# INLINE mapTestMapOfEnumStringL #-}
-
-
-
--- * MixedPropertiesAndAdditionalPropertiesClass
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
-mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
-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
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-}
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens
-mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal))
-mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
-
-
-
--- * Model200Response
-
--- | 'model200ResponseName' Lens
-model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
-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
-{-# INLINE model200ResponseClassL #-}
-
-
-
--- * ModelList
-
--- | 'modelList123List' Lens
-modelList123ListL :: Lens_' ModelList (Maybe Text)
-modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
-{-# INLINE modelList123ListL #-}
-
-
-
--- * ModelReturn
-
--- | 'modelReturnReturn' Lens
-modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
-modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
-{-# INLINE modelReturnReturnL #-}
-
-
-
--- * Name
-
--- | 'nameName' Lens
-nameNameL :: Lens_' Name (Int)
-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
-{-# INLINE nameSnakeCaseL #-}
-
--- | 'nameProperty' Lens
-namePropertyL :: Lens_' Name (Maybe Text)
-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
-{-# INLINE name123NumberL #-}
-
-
-
--- * NumberOnly
-
--- | 'numberOnlyJustNumber' Lens
-numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
-numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
-{-# INLINE numberOnlyJustNumberL #-}
-
-
-
--- * Order
-
--- | 'orderId' Lens
-orderIdL :: Lens_' Order (Maybe Integer)
-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
-{-# INLINE orderPetIdL #-}
-
--- | 'orderQuantity' Lens
-orderQuantityL :: Lens_' Order (Maybe Int)
-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
-{-# INLINE orderShipDateL #-}
-
--- | 'orderStatus' Lens
-orderStatusL :: Lens_' Order (Maybe Text)
-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
-{-# INLINE orderCompleteL #-}
-
-
-
--- * OuterBoolean
-
-
-
--- * OuterComposite
-
--- | 'outerCompositeMyNumber' Lens
-outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
-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
-{-# INLINE outerCompositeMyStringL #-}
-
--- | 'outerCompositeMyBoolean' Lens
-outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
-outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
-{-# INLINE outerCompositeMyBooleanL #-}
-
-
-
--- * OuterEnum
-
-
-
--- * OuterNumber
-
-
-
--- * OuterString
-
-
-
--- * Pet
-
--- | 'petId' Lens
-petIdL :: Lens_' Pet (Maybe Integer)
-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
-{-# INLINE petCategoryL #-}
-
--- | 'petName' Lens
-petNameL :: Lens_' Pet (Text)
-petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
-{-# INLINE petNameL #-}
-
--- | 'petPhotoUrls' Lens
-petPhotoUrlsL :: Lens_' Pet ([Text])
-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
-{-# INLINE petTagsL #-}
-
--- | 'petStatus' Lens
-petStatusL :: Lens_' Pet (Maybe Text)
-petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
-{-# INLINE petStatusL #-}
-
-
-
--- * ReadOnlyFirst
-
--- | 'readOnlyFirstBar' Lens
-readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
-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
-{-# INLINE readOnlyFirstBazL #-}
-
-
-
--- * SpecialModelName
-
--- | 'specialModelNameSpecialPropertyName' Lens
-specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
-specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
-{-# INLINE specialModelNameSpecialPropertyNameL #-}
-
-
-
--- * Tag
-
--- | 'tagId' Lens
-tagIdL :: Lens_' Tag (Maybe Integer)
-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
-{-# INLINE tagNameL #-}
-
-
-
--- * User
-
--- | 'userId' Lens
-userIdL :: Lens_' User (Maybe Integer)
-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
-{-# INLINE userUsernameL #-}
-
--- | 'userFirstName' Lens
-userFirstNameL :: Lens_' User (Maybe Text)
-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
-{-# INLINE userLastNameL #-}
-
--- | 'userEmail' Lens
-userEmailL :: Lens_' User (Maybe Text)
-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
-{-# INLINE userPasswordL #-}
-
--- | 'userPhone' Lens
-userPhoneL :: Lens_' User (Maybe Text)
-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
-{-# INLINE userUserStatusL #-}
-
-
-
--- * Cat
-
--- | 'catClassName' Lens
-catClassNameL :: Lens_' Cat (Text)
-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
-{-# INLINE catColorL #-}
-
--- | 'catDeclawed' Lens
-catDeclawedL :: Lens_' Cat (Maybe Bool)
-catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
-{-# INLINE catDeclawedL #-}
-
-
-
--- * Dog
-
--- | 'dogClassName' Lens
-dogClassNameL :: Lens_' Dog (Text)
-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
-{-# INLINE dogColorL #-}
-
--- | 'dogBreed' Lens
-dogBreedL :: Lens_' Dog (Maybe Text)
-dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
-{-# INLINE dogBreedL #-}
-
-
-
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html index ea28ef3ce77..3db61663db1 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Logging.html @@ -20,26 +20,26 @@ module SwaggerPetstore.Logging where -import Data.Text (Text) -import GHC.Exts (IsString(..)) - -import qualified Control.Exception.Safe as E -import qualified Control.Monad.IO.Class as P -import qualified Control.Monad.Trans.Reader as P -import qualified Data.Text as T -import qualified Lens.Micro as L -import qualified System.IO as IO +import qualified Control.Exception.Safe as E +import qualified Control.Monad.IO.Class as P +import qualified Control.Monad.Trans.Reader as P +import qualified Data.Text as T +import qualified Lens.Micro as L +import qualified System.IO as IO + +import Data.Text (Text) +import GHC.Exts (IsString(..)) import qualified Katip as LG -- * Type Aliases (for compatability) -- | Runs a Katip logging block with the Log environment -type LogExecWithContext = forall m. P.MonadIO m => - LogContext -> LogExec m +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m -- | A Katip logging block -type LogExec m = forall a. LG.KatipT m a -> m a +type LogExec m = forall a. LG.KatipT m a -> m a -- | A Katip Log environment type LogContext = LG.LogEnv @@ -65,9 +65,9 @@ -- | A Katip Log environment which targets stdout stdoutLoggingContext :: LogContext -> IO LogContext -stdoutLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 - LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt -- * stderr logger @@ -77,34 +77,34 @@ -- | A Katip Log environment which targets stderr stderrLoggingContext :: LogContext -> IO LogContext -stderrLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 - LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt -- * Null logger -- | Disables Katip logging runNullLogExec :: LogExecWithContext -runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) -- * Log Msg -- | Log a katip message -_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () -_log src level msg = do - LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) -- * Log Exceptions -- | re-throws exceptions after logging them logExceptions - :: (LG.Katip m, E.MonadCatch m, Applicative m) - => Text -> m a -> m a -logExceptions src = + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = E.handle - (\(e :: E.SomeException) -> do - _log src LG.ErrorS ((T.pack . show) e) - E.throw e) + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) -- * Log Level 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 ac47e939b1a..99e0a171a3c 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 @@ -23,208 +23,172 @@ module SwaggerPetstore.MimeTypes where -import SwaggerPetstore.Model as M - -import qualified Data.Aeson as A - -import qualified Data.ByteString as B +import qualified Control.Arrow as P (left) +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL - - -import qualified Network.HTTP.Media as ME - +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.Data as P (Typeable) +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Network.HTTP.Media as ME import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH -import qualified Data.Data as P (Typeable) -import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Text as T -import qualified Data.String as P -import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) - -import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) -import qualified Prelude as P +import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) +import qualified Prelude as P + + +-- * Consumes Class + +class MimeType mtype => Consumes req mtype where + +-- * Produces Class --- * Content Negotiation +class MimeType mtype => Produces req mtype where --- | A type for responses without content-body. -data NoContent = NoContent - deriving (P.Show, P.Eq) - --- ** Mime Types - -data MimeJSON = MimeJSON deriving (P.Typeable) -data MimeXML = MimeXML deriving (P.Typeable) -data MimePlainText = MimePlainText deriving (P.Typeable) -data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) -data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) -data MimeOctetStream = MimeOctetStream deriving (P.Typeable) -data MimeNoContent = MimeNoContent deriving (P.Typeable) -data MimeAny = MimeAny deriving (P.Typeable) +-- * Default Mime Types + +data MimeJSON = MimeJSON deriving (P.Typeable) +data MimeXML = MimeXML deriving (P.Typeable) +data MimePlainText = MimePlainText deriving (P.Typeable) +data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable) +data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable) +data MimeOctetStream = MimeOctetStream deriving (P.Typeable) +data MimeNoContent = MimeNoContent deriving (P.Typeable) +data MimeAny = MimeAny deriving (P.Typeable) + +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq, P.Typeable) -data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +-- * MimeType Class --- ** MimeType Class - -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] - Nothing -> [] - - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of - [] -> Nothing - (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) +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] + Nothing -> [] + + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of + [] -> Nothing + (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) + +-- Default MimeType Instances --- ** MimeType Instances - --- | @application/json; charset=utf-8@ -instance MimeType MimeJSON where - mimeType _ = Just $ P.fromString "application/json" --- | @application/xml; charset=utf-8@ -instance MimeType MimeXML where - mimeType _ = Just $ P.fromString "application/xml" --- | @application/x-www-form-urlencoded@ -instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" --- | @multipart/form-data@ -instance MimeType MimeMultipartFormData where - mimeType _ = Just $ P.fromString "multipart/form-data" --- | @text/plain; charset=utf-8@ -instance MimeType MimePlainText where - mimeType _ = Just $ P.fromString "text/plain" --- | @application/octet-stream@ -instance MimeType MimeOctetStream where - mimeType _ = Just $ P.fromString "application/octet-stream" --- | @"*/*"@ -instance MimeType MimeAny where - mimeType _ = Just $ P.fromString "*/*" -instance MimeType MimeNoContent where - mimeType _ = Nothing +-- | @application/json; charset=utf-8@ +instance MimeType MimeJSON where + mimeType _ = Just $ P.fromString "application/json" +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXML where + mimeType _ = Just $ P.fromString "application/xml" +-- | @application/x-www-form-urlencoded@ +instance MimeType MimeFormUrlEncoded where + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" +-- | @multipart/form-data@ +instance MimeType MimeMultipartFormData where + mimeType _ = Just $ P.fromString "multipart/form-data" +-- | @text/plain; charset=utf-8@ +instance MimeType MimePlainText where + mimeType _ = Just $ P.fromString "text/plain" +-- | @application/octet-stream@ +instance MimeType MimeOctetStream where + mimeType _ = Just $ P.fromString "application/octet-stream" +-- | @"*/*"@ +instance MimeType MimeAny where + mimeType _ = Just $ P.fromString "*/*" +instance MimeType MimeNoContent where + mimeType _ = Nothing + +-- * MimeRender Class --- | @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 +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 + --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" - +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam + +-- Default MimeRender Instances --- ** 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 - - --- ** MimeRender Instances - --- | `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 - --- | @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 --- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack - --- | @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 --- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack - -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary - -instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData DateTime 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 - -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString -mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam - --- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty - --- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec --- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec --- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec --- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec +-- | `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 + +-- | @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 +-- | @BCL.pack@ +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack + +-- | @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 +-- | @BCL.pack@ +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack + +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 + +-- | @P.Right . P.const NoContent@ +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 + +-- Default MimeUnrender Instances + +-- | @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 +-- | @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 +-- | @P.Right . BCL.unpack@ +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack --- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined - --- ** 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 - --- ** MimeUnrender Instances - --- | @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 --- | @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 --- | @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 --- | @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 - --- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent - --- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** Request Consumes - -class MimeType mtype => Consumes req mtype where - --- ** Request Produces - -class MimeType mtype => Produces req mtype where - \ No newline at end of file +-- | @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 +-- | @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 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 377c500d2f9..8701470671b 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 @@ -27,1552 +27,1275 @@ module SwaggerPetstore.Model where -import Data.Aeson ((.:),(.:!),(.:?),(.=)) +import SwaggerPetstore.Core -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Base64.Lazy as BL64 -import qualified Data.Data as P (Data, Typeable) -import qualified Data.HashMap.Lazy as HM -import qualified Data.Map as Map -import qualified Data.Set as Set -import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH -import qualified Control.DeepSeq as NF -import qualified Data.Ix as P -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) -import Data.Text (Text) - -import qualified Data.Time as TI -import qualified Data.Time.ISO8601 as TI +import Data.Aeson ((.:),(.:!),(.:?),(.=)) + +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 Control.Applicative ((<|>)) -import Control.Applicative (Alternative) -import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P - +import qualified Prelude as P + + + +-- * Models --- * 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 - } - - --- ** 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) - +-- ** 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 + } + + +-- ** 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 AnimalFarm -instance A.FromJSON AnimalFarm where - parseJSON = A.withObject "AnimalFarm" $ \o -> - pure AnimalFarm - - --- | 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) - - --- | 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 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) + +-- | 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 + ] + --- | 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 + } --- | 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 - ] + +-- ** 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 + } --- | 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) - - --- | 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") +-- ** 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 + ] + --- | 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 + } --- | 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) - + +-- ** 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") --- | 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 '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) - +-- | 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 '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") + +-- | ToJSON ClassModel +instance A.ToJSON ClassModel where + toJSON ClassModel {..} = + _omitNulls + [ "_class" .= classModelClass + ] --- | 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) + +-- | 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 + ] --- | 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 - } - +-- | 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 Text) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "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") --- ** EnumArrays --- | EnumArrays -data EnumArrays = EnumArrays - { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol" - , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum" - } deriving (P.Show,P.Eq,P.Typeable) - +-- | ToJSON EnumArrays +instance A.ToJSON EnumArrays where + toJSON EnumArrays {..} = + _omitNulls + [ "just_symbol" .= enumArraysJustSymbol + , "array_enum" .= enumArraysArrayEnum + ] --- | 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 - } - - --- ** EnumClass --- | EnumClass -data EnumClass = EnumClass - { - } deriving (P.Show,P.Eq,P.Typeable) - - --- | FromJSON EnumClass -instance A.FromJSON EnumClass where - parseJSON = A.withObject "EnumClass" $ \o -> - pure EnumClass - + +-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) +mkEnumArrays + :: EnumArrays +mkEnumArrays = + EnumArrays + { enumArraysJustSymbol = Nothing + , enumArraysArrayEnum = Nothing + } + + +-- ** EnumClass +-- | EnumClass +data EnumClass = EnumClass + { + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumClass +instance A.FromJSON EnumClass where + parseJSON = A.withObject "EnumClass" $ \o -> + pure EnumClass + + +-- | ToJSON EnumClass +instance A.ToJSON EnumClass where + toJSON EnumClass = + _omitNulls + [ + ] + + +-- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) +mkEnumClass + :: EnumClass +mkEnumClass = + EnumClass + { + } --- | ToJSON EnumClass -instance A.ToJSON EnumClass where - toJSON EnumClass = - _omitNulls - [ - ] - - --- | Construct a value of type 'EnumClass' (by applying it's required fields, if any) -mkEnumClass - :: EnumClass -mkEnumClass = - EnumClass - { - } - - --- ** EnumTest --- | EnumTest -data EnumTest = EnumTest - { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" - , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" - , enumTestEnumNumber :: !(Maybe Double) -- ^ "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 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 - } - - --- ** 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) - + +-- ** EnumTest +-- | EnumTest +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string" + , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe Double) -- ^ "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 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 + } + + +-- ** 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") --- | 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 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") +-- | 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") + +-- | ToJSON HasOnlyReadOnly +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _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 + } + --- | ToJSON HasOnlyReadOnly -instance A.ToJSON HasOnlyReadOnly where - toJSON HasOnlyReadOnly {..} = - _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 Text)) -- ^ "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") +-- ** MapTest +-- | MapTest +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "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 + } + --- | 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 - ] - +-- ** 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") --- | 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) +-- | 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 + } --- | 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 - ] +-- ** 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") - --- | 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) +-- | 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 + } + - --- | 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 - ] - +-- ** 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") --- | 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 Text) -- ^ "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 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 Text) -- ^ "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 + } + --- | 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 -data OuterBoolean = OuterBoolean - { - } deriving (P.Show,P.Eq,P.Typeable) +-- ** 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 + ] --- | FromJSON OuterBoolean -instance A.FromJSON OuterBoolean where - parseJSON = A.withObject "OuterBoolean" $ \o -> - pure OuterBoolean - - --- | ToJSON OuterBoolean -instance A.ToJSON OuterBoolean where - toJSON OuterBoolean = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) -mkOuterBoolean - :: OuterBoolean -mkOuterBoolean = - OuterBoolean - { - } - +-- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) +mkOuterComposite + :: OuterComposite +mkOuterComposite = + OuterComposite + { outerCompositeMyNumber = Nothing + , outerCompositeMyString = Nothing + , outerCompositeMyBoolean = Nothing + } + + +-- ** OuterEnum +-- | OuterEnum +data OuterEnum = OuterEnum + { + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OuterEnum +instance A.FromJSON OuterEnum where + parseJSON = A.withObject "OuterEnum" $ \o -> + pure OuterEnum + --- ** 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) +-- | ToJSON OuterEnum +instance A.ToJSON OuterEnum where + toJSON OuterEnum = + _omitNulls + [ + ] + - --- | FromJSON OuterComposite -instance A.FromJSON OuterComposite where - parseJSON = A.withObject "OuterComposite" $ \o -> - OuterComposite - <$> (o .:? "my_number") - <*> (o .:? "my_string") - <*> (o .:? "my_boolean") +-- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) +mkOuterEnum + :: OuterEnum +mkOuterEnum = + OuterEnum + { + } + --- | 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 - } - - --- ** OuterEnum --- | OuterEnum -data OuterEnum = OuterEnum - { - } deriving (P.Show,P.Eq,P.Typeable) +-- ** 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 Text) -- ^ "status" - pet status in the store + } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON OuterEnum -instance A.FromJSON OuterEnum where - parseJSON = A.withObject "OuterEnum" $ \o -> - pure OuterEnum - - --- | ToJSON OuterEnum -instance A.ToJSON OuterEnum where - toJSON OuterEnum = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any) -mkOuterEnum - :: OuterEnum -mkOuterEnum = - OuterEnum - { - } - +-- | 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 + ] + --- ** OuterNumber --- | OuterNumber -data OuterNumber = OuterNumber - { - } deriving (P.Show,P.Eq,P.Typeable) - - --- | FromJSON OuterNumber -instance A.FromJSON OuterNumber where - parseJSON = A.withObject "OuterNumber" $ \o -> - pure OuterNumber - - --- | ToJSON OuterNumber -instance A.ToJSON OuterNumber where - toJSON OuterNumber = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) -mkOuterNumber - :: OuterNumber -mkOuterNumber = - OuterNumber - { - } - +-- | 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") --- ** OuterString --- | OuterString -data OuterString = OuterString - { - } deriving (P.Show,P.Eq,P.Typeable) - - --- | FromJSON OuterString -instance A.FromJSON OuterString where - parseJSON = A.withObject "OuterString" $ \o -> - pure OuterString - - --- | ToJSON OuterString -instance A.ToJSON OuterString where - toJSON OuterString = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterString' (by applying it's required fields, if any) -mkOuterString - :: OuterString -mkOuterString = - OuterString - { - } - - --- ** 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 Text) -- ^ "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 - } - - --- ** SpecialModelName --- | SpecialModelName -data SpecialModelName = SpecialModelName - { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show,P.Eq,P.Typeable) +-- | 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 + } + + +-- ** 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") + +-- | 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 + ] + - --- | 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 '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 + } --- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) -mkSpecialModelName - :: SpecialModelName -mkSpecialModelName = - SpecialModelName - { specialModelNameSpecialPropertyName = 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) --- ** Tag --- | Tag -data Tag = Tag - { tagId :: !(Maybe Integer) -- ^ "id" - , tagName :: !(Maybe Text) -- ^ "name" - } 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") --- | 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 - } - - --- ** 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 - } - - --- * 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 :: Text } deriving (P.Eq, P.Show) -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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) - --- * 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 - where - 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 - --- | Collapse (Just "") to Nothing -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_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 -{-# INLINE _memptyToNothing #-} - --- * DateTime Formatting - -newtype DateTime = DateTime { unDateTime :: TI.UTCTime } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON DateTime where - parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) -instance A.ToJSON DateTime where - 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) -instance P.Show DateTime where - show (DateTime t) = _showDateTime t - --- | @_parseISO8601@ -_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 = - TI.formatISO8601Millis -{-# INLINE _showDateTime #-} - --- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - -newtype Date = Date { unDate :: TI.Day } - deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON Date where - parseJSON = A.withText "Date" (_readDate . T.unpack) -instance A.ToJSON Date where - 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) -instance P.Show Date where - show (Date t) = _showDate t - --- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_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 TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} - --- * Byte/Binary Formatting - - --- | base64 encoded characters -newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON ByteArray where - parseJSON = A.withText "ByteArray" _readByteArray -instance A.ToJSON ByteArray where - toJSON = A.toJSON . _showByteArray -instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray -instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray -instance P.Show ByteArray where - show = T.unpack . _showByteArray - --- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray -_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readByteArray #-} - --- | show base64 encoded characters -_showByteArray :: ByteArray -> Text -_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray -{-# INLINE _showByteArray #-} - --- | any sequence of octets -newtype Binary = Binary { unBinary :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON Binary where - parseJSON = A.withText "Binary" _readBinaryBase64 -instance A.ToJSON Binary where - toJSON = A.toJSON . _showBinaryBase64 -instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 -instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 -instance P.Show Binary where - show = T.unpack . _showBinaryBase64 - -_readBinaryBase64 :: Monad m => Text -> m Binary -_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readBinaryBase64 #-} - -_showBinaryBase64 :: Binary -> Text -_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} - \ No newline at end of file +-- | 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 + } + + + + \ 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 new file mode 100644 index 00000000000..79957636daf --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html @@ -0,0 +1,638 @@ +
{-
+   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.Lens
+-}
+
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.ModelLens where
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Data, Typeable)
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import qualified Data.Time as TI
+
+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
+
+import SwaggerPetstore.Model
+import SwaggerPetstore.Core
+
+
+-- * AdditionalPropertiesClass
+
+-- | 'additionalPropertiesClassMapProperty' Lens
+additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
+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
+{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
+
+
+
+-- * Animal
+
+-- | 'animalClassName' Lens
+animalClassNameL :: Lens_' Animal (Text)
+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
+{-# INLINE animalColorL #-}
+
+
+
+-- * AnimalFarm
+
+
+
+-- * ApiResponse
+
+-- | 'apiResponseCode' Lens
+apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
+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
+{-# INLINE apiResponseTypeL #-}
+
+-- | 'apiResponseMessage' Lens
+apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)
+apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage
+{-# INLINE apiResponseMessageL #-}
+
+
+
+-- * ArrayOfArrayOfNumberOnly
+
+-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
+arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
+arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
+{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
+
+
+
+-- * ArrayOfNumberOnly
+
+-- | 'arrayOfNumberOnlyArrayNumber' Lens
+arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
+arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
+{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
+
+
+
+-- * ArrayTest
+
+-- | 'arrayTestArrayOfString' Lens
+arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
+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
+{-# INLINE arrayTestArrayArrayOfIntegerL #-}
+
+-- | 'arrayTestArrayArrayOfModel' Lens
+arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])
+arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel
+{-# INLINE arrayTestArrayArrayOfModelL #-}
+
+
+
+-- * Capitalization
+
+-- | 'capitalizationSmallCamel' Lens
+capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
+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
+{-# INLINE capitalizationCapitalCamelL #-}
+
+-- | 'capitalizationSmallSnake' Lens
+capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
+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
+{-# INLINE capitalizationCapitalSnakeL #-}
+
+-- | 'capitalizationScaEthFlowPoints' Lens
+capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
+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
+{-# INLINE capitalizationAttNameL #-}
+
+
+
+-- * Category
+
+-- | 'categoryId' Lens
+categoryIdL :: Lens_' Category (Maybe Integer)
+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
+{-# INLINE categoryNameL #-}
+
+
+
+-- * ClassModel
+
+-- | 'classModelClass' Lens
+classModelClassL :: Lens_' ClassModel (Maybe Text)
+classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
+{-# INLINE classModelClassL #-}
+
+
+
+-- * Client
+
+-- | 'clientClient' Lens
+clientClientL :: Lens_' Client (Maybe Text)
+clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
+{-# INLINE clientClientL #-}
+
+
+
+-- * EnumArrays
+
+-- | 'enumArraysJustSymbol' Lens
+enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
+enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
+{-# INLINE enumArraysJustSymbolL #-}
+
+-- | 'enumArraysArrayEnum' Lens
+enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
+enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
+{-# INLINE enumArraysArrayEnumL #-}
+
+
+
+-- * EnumClass
+
+
+
+-- * EnumTest
+
+-- | 'enumTestEnumString' Lens
+enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
+enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
+{-# INLINE enumTestEnumStringL #-}
+
+-- | 'enumTestEnumInteger' Lens
+enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
+enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
+{-# INLINE enumTestEnumIntegerL #-}
+
+-- | 'enumTestEnumNumber' Lens
+enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
+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
+{-# INLINE enumTestOuterEnumL #-}
+
+
+
+-- * FormatTest
+
+-- | 'formatTestInteger' Lens
+formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
+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
+{-# INLINE formatTestInt32L #-}
+
+-- | 'formatTestInt64' Lens
+formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
+formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
+{-# INLINE formatTestInt64L #-}
+
+-- | 'formatTestNumber' Lens
+formatTestNumberL :: Lens_' FormatTest (Double)
+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
+{-# INLINE formatTestFloatL #-}
+
+-- | 'formatTestDouble' Lens
+formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
+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
+{-# INLINE formatTestStringL #-}
+
+-- | 'formatTestByte' Lens
+formatTestByteL :: Lens_' FormatTest (ByteArray)
+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
+{-# INLINE formatTestBinaryL #-}
+
+-- | 'formatTestDate' Lens
+formatTestDateL :: Lens_' FormatTest (Date)
+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
+{-# INLINE formatTestDateTimeL #-}
+
+-- | 'formatTestUuid' Lens
+formatTestUuidL :: Lens_' FormatTest (Maybe Text)
+formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
+{-# INLINE formatTestUuidL #-}
+
+-- | 'formatTestPassword' Lens
+formatTestPasswordL :: Lens_' FormatTest (Text)
+formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
+{-# INLINE formatTestPasswordL #-}
+
+
+
+-- * HasOnlyReadOnly
+
+-- | 'hasOnlyReadOnlyBar' Lens
+hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
+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
+{-# INLINE hasOnlyReadOnlyFooL #-}
+
+
+
+-- * MapTest
+
+-- | 'mapTestMapMapOfString' Lens
+mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
+mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
+{-# INLINE mapTestMapMapOfStringL #-}
+
+-- | 'mapTestMapOfEnumString' Lens
+mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
+mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
+{-# INLINE mapTestMapOfEnumStringL #-}
+
+
+
+-- * MixedPropertiesAndAdditionalPropertiesClass
+
+-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
+mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
+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
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-}
+
+-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens
+mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal))
+mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
+
+
+
+-- * Model200Response
+
+-- | 'model200ResponseName' Lens
+model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
+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
+{-# INLINE model200ResponseClassL #-}
+
+
+
+-- * ModelList
+
+-- | 'modelList123List' Lens
+modelList123ListL :: Lens_' ModelList (Maybe Text)
+modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
+{-# INLINE modelList123ListL #-}
+
+
+
+-- * ModelReturn
+
+-- | 'modelReturnReturn' Lens
+modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
+modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
+{-# INLINE modelReturnReturnL #-}
+
+
+
+-- * Name
+
+-- | 'nameName' Lens
+nameNameL :: Lens_' Name (Int)
+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
+{-# INLINE nameSnakeCaseL #-}
+
+-- | 'nameProperty' Lens
+namePropertyL :: Lens_' Name (Maybe Text)
+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
+{-# INLINE name123NumberL #-}
+
+
+
+-- * NumberOnly
+
+-- | 'numberOnlyJustNumber' Lens
+numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
+numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
+{-# INLINE numberOnlyJustNumberL #-}
+
+
+
+-- * Order
+
+-- | 'orderId' Lens
+orderIdL :: Lens_' Order (Maybe Integer)
+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
+{-# INLINE orderPetIdL #-}
+
+-- | 'orderQuantity' Lens
+orderQuantityL :: Lens_' Order (Maybe Int)
+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
+{-# INLINE orderShipDateL #-}
+
+-- | 'orderStatus' Lens
+orderStatusL :: Lens_' Order (Maybe Text)
+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
+{-# INLINE orderCompleteL #-}
+
+
+
+-- * OuterBoolean
+
+
+
+-- * OuterComposite
+
+-- | 'outerCompositeMyNumber' Lens
+outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
+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
+{-# INLINE outerCompositeMyStringL #-}
+
+-- | 'outerCompositeMyBoolean' Lens
+outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
+outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
+{-# INLINE outerCompositeMyBooleanL #-}
+
+
+
+-- * OuterEnum
+
+
+
+-- * OuterNumber
+
+
+
+-- * OuterString
+
+
+
+-- * Pet
+
+-- | 'petId' Lens
+petIdL :: Lens_' Pet (Maybe Integer)
+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
+{-# INLINE petCategoryL #-}
+
+-- | 'petName' Lens
+petNameL :: Lens_' Pet (Text)
+petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
+{-# INLINE petNameL #-}
+
+-- | 'petPhotoUrls' Lens
+petPhotoUrlsL :: Lens_' Pet ([Text])
+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
+{-# INLINE petTagsL #-}
+
+-- | 'petStatus' Lens
+petStatusL :: Lens_' Pet (Maybe Text)
+petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
+{-# INLINE petStatusL #-}
+
+
+
+-- * ReadOnlyFirst
+
+-- | 'readOnlyFirstBar' Lens
+readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
+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
+{-# INLINE readOnlyFirstBazL #-}
+
+
+
+-- * SpecialModelName
+
+-- | 'specialModelNameSpecialPropertyName' Lens
+specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
+specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
+{-# INLINE specialModelNameSpecialPropertyNameL #-}
+
+
+
+-- * Tag
+
+-- | 'tagId' Lens
+tagIdL :: Lens_' Tag (Maybe Integer)
+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
+{-# INLINE tagNameL #-}
+
+
+
+-- * User
+
+-- | 'userId' Lens
+userIdL :: Lens_' User (Maybe Integer)
+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
+{-# INLINE userUsernameL #-}
+
+-- | 'userFirstName' Lens
+userFirstNameL :: Lens_' User (Maybe Text)
+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
+{-# INLINE userLastNameL #-}
+
+-- | 'userEmail' Lens
+userEmailL :: Lens_' User (Maybe Text)
+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
+{-# INLINE userPasswordL #-}
+
+-- | 'userPhone' Lens
+userPhoneL :: Lens_' User (Maybe Text)
+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
+{-# INLINE userUserStatusL #-}
+
+
+
+-- * Cat
+
+-- | 'catClassName' Lens
+catClassNameL :: Lens_' Cat (Text)
+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
+{-# INLINE catColorL #-}
+
+-- | 'catDeclawed' Lens
+catDeclawedL :: Lens_' Cat (Maybe Bool)
+catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
+{-# INLINE catDeclawedL #-}
+
+
+
+-- * Dog
+
+-- | 'dogClassName' Lens
+dogClassNameL :: Lens_' Dog (Text)
+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
+{-# INLINE dogColorL #-}
+
+-- | 'dogBreed' Lens
+dogBreedL :: Lens_' Dog (Maybe Text)
+dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
+{-# INLINE dogBreedL #-}
+
+
+
\ No newline at end of file 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 1c21d66d229..2233a4024a2 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -14,18 +14,20 @@ -} module SwaggerPetstore - ( module SwaggerPetstore.Client - , module SwaggerPetstore.API - , module SwaggerPetstore.Model - , module SwaggerPetstore.MimeTypes - , module SwaggerPetstore.Lens - , module SwaggerPetstore.Logging - ) where - -import SwaggerPetstore.API -import SwaggerPetstore.Client -import SwaggerPetstore.Model -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens -import SwaggerPetstore.Logging - \ No newline at end of file + ( module SwaggerPetstore.API + , module SwaggerPetstore.Client + , module SwaggerPetstore.Core + , module SwaggerPetstore.Logging + , module SwaggerPetstore.MimeTypes + , module SwaggerPetstore.Model + , module SwaggerPetstore.ModelLens + ) where + +import SwaggerPetstore.API +import SwaggerPetstore.Client +import SwaggerPetstore.Core +import SwaggerPetstore.Logging +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model +import SwaggerPetstore.ModelLens + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index b159772a9e6..432badda01d 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -14,17 +14,19 @@ Module : SwaggerPetstore -} module SwaggerPetstore - ( module SwaggerPetstore.Client - , module SwaggerPetstore.API - , module SwaggerPetstore.Model - , module SwaggerPetstore.MimeTypes - , module SwaggerPetstore.Lens + ( module SwaggerPetstore.API + , module SwaggerPetstore.Client + , module SwaggerPetstore.Core , module SwaggerPetstore.Logging + , module SwaggerPetstore.MimeTypes + , module SwaggerPetstore.Model + , module SwaggerPetstore.ModelLens ) where import SwaggerPetstore.API import SwaggerPetstore.Client -import SwaggerPetstore.Model -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens +import SwaggerPetstore.Core import SwaggerPetstore.Logging +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model +import SwaggerPetstore.ModelLens 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 9f8dd258b6f..afce16b8084 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -14,6 +14,7 @@ Module : SwaggerPetstore.API -} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} @@ -23,49 +24,38 @@ Module : SwaggerPetstore.API {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} module SwaggerPetstore.API where - -import SwaggerPetstore.Model as M +import SwaggerPetstore.Core import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Lens +import SwaggerPetstore.Model as M import qualified Data.Aeson as A - -import qualified Data.Time as TI - import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Builder as BB -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL import qualified Data.ByteString.Base64 as B64 - -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.HttpApiData as WH -import qualified Web.FormUrlEncoded as WH - -import qualified Data.CaseInsensitive as CI +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.Set as Set 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 Control.Arrow as P (left) - 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 ((&)) @@ -993,240 +983,46 @@ instance Produces UpdateUser MimeJSON --- * HasBodyParam - --- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - 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 - {-# MINIMAL applyOptionalParam | (-&-) #-} - - -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - applyOptionalParam = (-&-) - {-# INLINE applyOptionalParam #-} - - -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res - (-&-) = applyOptionalParam - {-# INLINE (-&-) #-} - -infixl 2 -&- - --- * SwaggerPetstoreRequest - --- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. -data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest - { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest - , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest - , rParams :: Params -- ^ params of SwaggerPetstoreRequest - , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods - } - deriving (P.Show) - --- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod -{-# INLINE rMethodL #-} - --- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath -{-# INLINE rUrlPathL #-} - --- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams -{-# INLINE rParamsL #-} - --- | 'rParams' Lens -rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep] -rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes -{-# INLINE rAuthTypesL #-} - --- | Request Params -data Params = Params - { paramsQuery :: NH.Query - , paramsHeaders :: NH.RequestHeaders - , paramsBody :: ParamBody - } - deriving (P.Show) - --- | 'paramsQuery' Lens -paramsQueryL :: Lens_' Params NH.Query -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 -{-# INLINE paramsHeadersL #-} - --- | 'paramsBody' Lens -paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody -{-# INLINE paramsBodyL #-} - --- | Request Body -data ParamBody - = ParamBodyNone - | ParamBodyB B.ByteString - | ParamBodyBL BL.ByteString - | ParamBodyFormUrlEncoded WH.Form - | ParamBodyMultipartFormData [NH.Part] - deriving (P.Show) - --- ** SwaggerPetstoreRequest Utils - -_mkRequest :: NH.Method -- ^ Method - -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] - -_mkParams :: Params -_mkParams = Params [] [] ParamBodyNone - -setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) - -removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res -removeHeader req header = - req & - L.over - (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) - where - cifst = CI.mk . P.fst - - -_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res -_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 -_setAcceptHeader req accept = - case mimeType' accept of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] - -setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res -setQuery req query = - req & - L.over - (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) - where - cifst = CI.mk . P.fst - -addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form - _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) - -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts - _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) - -_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) - -_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) - -_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) - --- ** Params Utils - -toPath - :: 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] - -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 - --- *** Swagger `CollectionFormat` Utils - --- | Determines the format of the array if type array is used. -data CollectionFormat - = 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" ('NH.Query') or "formData" ('WH.Form') - -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 - where - 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 - -_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.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 - {-# INLINE go #-} - {-# INLINE expandList #-} - {-# INLINE combine #-} - --- * AuthMethods - --- | Provides a method to apply auth methods to requests -class P.Typeable a => AuthMethod a where - applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res - --- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) - -instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a +-- * 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 :: Text } deriving (P.Eq, P.Show) +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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 = @@ -1234,9 +1030,11 @@ data AuthApiKeyApiKey = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod req a@(AuthApiKeyApiKey secret) = + 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 @@ -1245,9 +1043,11 @@ data AuthApiKeyApiKeyQuery = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) = + 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 @@ -1256,9 +1056,11 @@ data AuthBasicHttpBasicTest = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) = + 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 ]) @@ -1268,9 +1070,37 @@ data AuthOAuthPetstoreAuth = deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthOAuthPetstoreAuth where - applyAuthMethod req a@(AuthOAuthPetstoreAuth secret) = + 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 + + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs index bef09c051a2..ad1041e7bc4 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Client.hs @@ -25,102 +25,30 @@ Module : SwaggerPetstore.Client module SwaggerPetstore.Client where -import SwaggerPetstore.Model -import SwaggerPetstore.API -import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Core import SwaggerPetstore.Logging +import SwaggerPetstore.MimeTypes +import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P -import qualified Data.Aeson as A +import qualified Control.Monad as P import qualified Data.Aeson.Types as A +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL import qualified Data.Proxy as P (Proxy(..)) -import Data.Function ((&)) -import Data.Monoid ((<>)) -import Data.Text (Text) -import GHC.Exts (IsString(..)) -import Web.FormUrlEncoded as WH -import Web.HttpApiData as WH -import Control.Monad.Catch (MonadThrow) - -import qualified Data.Time as TI -import qualified Data.Map as Map import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Text.Printf as T - -import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy.Char8 as BCL -import qualified Data.ByteString.Builder as BB import qualified Network.HTTP.Client as NH -import qualified Network.HTTP.Client.TLS as NH import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Types.Method as NH import qualified Network.HTTP.Types as NH -import qualified Network.HTTP.Types.URI as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH -import qualified Control.Exception.Safe as E --- * Config - --- | -data SwaggerPetstoreConfig = SwaggerPetstoreConfig - { configHost :: BCL.ByteString -- ^ host supplied in the Request - , configUserAgent :: Text -- ^ user-agent supplied in the Request - , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance - , configLogContext :: LogContext -- ^ Configures the logger - , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods - } - --- | display the config -instance Show SwaggerPetstoreConfig where - show c = - T.printf - "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) - --- | constructs a default SwaggerPetstoreConfig --- --- configHost: --- --- @http://petstore.swagger.io:80/v2@ --- --- configUserAgent: --- --- @"swagger-haskell-http-client/1.0.0"@ --- -newConfig :: IO SwaggerPetstoreConfig -newConfig = do - logCxt <- initLogContext - return $ SwaggerPetstoreConfig - { configHost = "http://petstore.swagger.io:80/v2" - , configUserAgent = "swagger-haskell-http-client/1.0.0" - , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt - , configAuthMethods = [] - } - --- | updates config use AuthMethod on matching requests -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 } - --- | updates the config to use stderr logging -withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig -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} +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import GHC.Exts (IsString(..)) -- * Dispatch @@ -243,35 +171,28 @@ _toInitRequest -> SwaggerPetstoreRequest req contentType res -- ^ request -> accept -- ^ "accept" 'MimeType' -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 accept = do - parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - let req1 = _applyAuthMethods req0 config - & _setContentTypeHeader - & flip _setAcceptHeader accept - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1) - reqQuery = NH.renderQuery True (paramsQuery (rParams req1)) - pReq = parsedReq { NH.method = (rMethod req1) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery - } - outReq <- case paramsBody (rParams req1) 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) - --- | apply all matching AuthMethods in config to request -_applyAuthMethods - :: SwaggerPetstoreRequest req contentType res - -> SwaggerPetstoreConfig - -> SwaggerPetstoreRequest req contentType res -_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} = - foldl go req as - where - go r (AnyAuthMethod a) = r `applyAuthMethod` a +_toInitRequest config req0 accept = + 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.throwString $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & flip _setAcceptHeader accept + 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 + + pure (InitRequest outReq) -- | modify the underlying Request modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Core.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Core.hs new file mode 100644 index 00000000000..db3e935068b --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Core.hs @@ -0,0 +1,532 @@ +{- + 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.Core +-} + +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-} + +module SwaggerPetstore.Core where + +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Logging + +import qualified Control.Arrow as P (left) +import qualified Control.DeepSeq as NF +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Base64.Lazy as BL64 +import qualified Data.ByteString.Builder as BB +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.CaseInsensitive as CI +import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep) +import qualified Data.Foldable as P +import qualified Data.Ix as P +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Time as TI +import qualified Data.Time.ISO8601 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.Types as NH +import qualified Prelude as P +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH +import qualified Text.Printf as T + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Foldable(foldlM) +import Data.Monoid ((<>)) +import Data.Text (Text) +import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor) + +-- * SwaggerPetstoreConfig + +-- | +data SwaggerPetstoreConfig = SwaggerPetstoreConfig + { configHost :: BCL.ByteString -- ^ host supplied in the Request + , configUserAgent :: Text -- ^ user-agent supplied in the Request + , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance + , configLogContext :: LogContext -- ^ Configures the logger + , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods + , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured + } + +-- | display the config +instance P.Show SwaggerPetstoreConfig where + show c = + T.printf + "{ configHost = %v, configUserAgent = %v, ..}" + (show (configHost c)) + (show (configUserAgent c)) + +-- | constructs a default SwaggerPetstoreConfig +-- +-- configHost: +-- +-- @http://petstore.swagger.io:80/v2@ +-- +-- configUserAgent: +-- +-- @"swagger-haskell-http-client/1.0.0"@ +-- +newConfig :: IO SwaggerPetstoreConfig +newConfig = do + logCxt <- initLogContext + return $ SwaggerPetstoreConfig + { configHost = "http://petstore.swagger.io:80/v2" + , configUserAgent = "swagger-haskell-http-client/1.0.0" + , configLogExecWithContext = runDefaultLogExecWithContext + , 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} + +-- | updates the config to use stdout logging +withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig +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 } + +-- | updates the config to disable logging +withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig +withNoLogging p = p { configLogExecWithContext = runNullLogExec} + +-- * SwaggerPetstoreRequest + +-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type. +data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest + { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest + , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest + , rParams :: Params -- ^ params of SwaggerPetstoreRequest + , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods + } + deriving (P.Show) + +-- | 'rMethod' Lens +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +{-# INLINE rMethodL #-} + +-- | 'rUrlPath' Lens +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +{-# INLINE rUrlPathL #-} + +-- | 'rParams' Lens +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +{-# INLINE rParamsL #-} + +-- | 'rParams' Lens +rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [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. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + 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 + {-# MINIMAL applyOptionalParam | (-&-) #-} + + -- | Apply an optional parameter to a request + applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + applyOptionalParam = (-&-) + {-# INLINE applyOptionalParam #-} + + -- | infix operator \/ alias for 'addOptionalParam' + (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res + (-&-) = applyOptionalParam + {-# INLINE (-&-) #-} + +infixl 2 -&- + +-- | Request Params +data Params = Params + { paramsQuery :: NH.Query + , paramsHeaders :: NH.RequestHeaders + , paramsBody :: ParamBody + } + deriving (P.Show) + +-- | 'paramsQuery' Lens +paramsQueryL :: Lens_' Params NH.Query +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 +{-# INLINE paramsHeadersL #-} + +-- | 'paramsBody' Lens +paramsBodyL :: Lens_' Params ParamBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +{-# INLINE paramsBodyL #-} + +-- | Request Body +data ParamBody + = ParamBodyNone + | ParamBodyB B.ByteString + | ParamBodyBL BL.ByteString + | ParamBodyFormUrlEncoded WH.Form + | ParamBodyMultipartFormData [NH.Part] + deriving (P.Show) + +-- ** SwaggerPetstoreRequest Utils + +_mkRequest :: NH.Method -- ^ Method + -> [BCL.ByteString] -- ^ Endpoint + -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] + +_mkParams :: Params +_mkParams = Params [] [] ParamBodyNone + +setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) + +removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res +removeHeader req header = + req & + L.over + (rParamsL . paramsHeadersL) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + where + cifst = CI.mk . P.fst + + +_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res +_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 +_setAcceptHeader req accept = + case mimeType' accept of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] + +setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res +setQuery req query = + req & + L.over + (rParamsL . paramsQueryL) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + where + cifst = CI.mk . P.fst + +addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form + _ -> mempty + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts + _ -> [] + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + +_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) + +_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) + +_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) + +-- ** Params Utils + +toPath + :: 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] + +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 + +-- *** Swagger `CollectionFormat` Utils + +-- | Determines the format of the array if type array is used. +data CollectionFormat + = 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" ('NH.Query') or "formData" ('WH.Form') + +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 + where + 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 + +_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.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 + {-# INLINE go #-} + {-# INLINE expandList #-} + {-# INLINE combine #-} + +-- * AuthMethods + +-- | Provides a method to apply auth methods to requests +class P.Typeable a => + AuthMethod a where + applyAuthMethod + :: SwaggerPetstoreConfig + -> a + -> SwaggerPetstoreRequest req contentType res + -> IO (SwaggerPetstoreRequest req contentType res) + +-- | An existential wrapper for any AuthMethod +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) + +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req + +-- | apply all matching AuthMethods in config to request +_applyAuthMethods + :: SwaggerPetstoreRequest req contentType res + -> SwaggerPetstoreConfig + -> IO (SwaggerPetstoreRequest req contentType res) +_applyAuthMethods req config@(SwaggerPetstoreConfig {configAuthMethods = as}) = + foldlM go req as + where + 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 + where + 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 + +-- | Collapse (Just "") to Nothing +_emptyToNothing :: Maybe String -> Maybe String +_emptyToNothing (Just "") = Nothing +_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 +{-# INLINE _memptyToNothing #-} + +-- * DateTime Formatting + +newtype DateTime = DateTime { unDateTime :: TI.UTCTime } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON DateTime where + parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) +instance A.ToJSON DateTime where + 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) +instance P.Show DateTime where + show (DateTime t) = _showDateTime t +instance MimeRender MimeMultipartFormData DateTime where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @_parseISO8601@ +_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 = + TI.formatISO8601Millis +{-# INLINE _showDateTime #-} + +-- | parse an ISO8601 date-time string +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = + P.asum $ + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] +{-# INLINE _parseISO8601 #-} + +-- * Date Formatting + +newtype Date = Date { unDate :: TI.Day } + deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) +instance A.FromJSON Date where + parseJSON = A.withText "Date" (_readDate . T.unpack) +instance A.ToJSON Date where + 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) +instance P.Show Date where + show (Date t) = _showDate t +instance MimeRender MimeMultipartFormData Date where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ +_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 TI.defaultTimeLocale "%Y-%m-%d" +{-# INLINE _showDate #-} + +-- * Byte/Binary Formatting + + +-- | base64 encoded characters +newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON ByteArray where + parseJSON = A.withText "ByteArray" _readByteArray +instance A.ToJSON ByteArray where + toJSON = A.toJSON . _showByteArray +instance WH.FromHttpApiData ByteArray where + parseUrlPiece = P.left T.pack . _readByteArray +instance WH.ToHttpApiData ByteArray where + toUrlPiece = _showByteArray +instance P.Show ByteArray where + show = T.unpack . _showByteArray +instance MimeRender MimeMultipartFormData ByteArray where + mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | read base64 encoded characters +_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readByteArray #-} + +-- | show base64 encoded characters +_showByteArray :: ByteArray -> Text +_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray +{-# INLINE _showByteArray #-} + +-- | any sequence of octets +newtype Binary = Binary { unBinary :: BL.ByteString } + deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) + +instance A.FromJSON Binary where + parseJSON = A.withText "Binary" _readBinaryBase64 +instance A.ToJSON Binary where + toJSON = A.toJSON . _showBinaryBase64 +instance WH.FromHttpApiData Binary where + parseUrlPiece = P.left T.pack . _readBinaryBase64 +instance WH.ToHttpApiData Binary where + toUrlPiece = _showBinaryBase64 +instance P.Show Binary where + show = T.unpack . _showBinaryBase64 +instance MimeRender MimeMultipartFormData Binary where + mimeRender _ = unBinary + +_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 +{-# INLINE _readBinaryBase64 #-} + +_showBinaryBase64 :: Binary -> Text +_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary +{-# INLINE _showBinaryBase64 #-} + +-- * 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 diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs index c80e3017cf0..0b65fd3c406 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Logging.hs @@ -20,9 +20,6 @@ Katip Logging functions module SwaggerPetstore.Logging where -import Data.Text (Text) -import GHC.Exts (IsString(..)) - import qualified Control.Exception.Safe as E import qualified Control.Monad.IO.Class as P import qualified Control.Monad.Trans.Reader as P @@ -30,6 +27,9 @@ import qualified Data.Text as T import qualified Lens.Micro as L import qualified System.IO as IO +import Data.Text (Text) +import GHC.Exts (IsString(..)) + import qualified Katip as LG -- * Type Aliases (for compatability) 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 4b1cdfa9adf..066fdd21244 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs @@ -23,39 +23,35 @@ Module : SwaggerPetstore.MimeTypes module SwaggerPetstore.MimeTypes where -import SwaggerPetstore.Model as M - +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.ByteString.Builder as BB import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BCL - - -import qualified Network.HTTP.Media as ME - -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - import qualified Data.Data as P (Typeable) import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Text as T import qualified Data.String as P +import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) +import qualified Network.HTTP.Media as ME +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty) import qualified Prelude as P --- * Content Negotiation --- | A type for responses without content-body. -data NoContent = NoContent - deriving (P.Show, P.Eq) +-- * Consumes Class + +class MimeType mtype => Consumes req mtype where + +-- * Produces Class --- ** Mime Types +class MimeType mtype => Produces req mtype where + +-- * Default Mime Types data MimeJSON = MimeJSON deriving (P.Typeable) data MimeXML = MimeXML deriving (P.Typeable) @@ -66,10 +62,12 @@ data MimeOctetStream = MimeOctetStream deriving (P.Typeable) data MimeNoContent = MimeNoContent deriving (P.Typeable) data MimeAny = MimeAny deriving (P.Typeable) -data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) +-- | A type for responses without content-body. +data NoContent = NoContent + deriving (P.Show, P.Eq, P.Typeable) + --- ** MimeType Class +-- * MimeType Class class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} @@ -91,7 +89,7 @@ class P.Typeable mtype => MimeType mtype where mimeTypes' :: mtype -> [ME.MediaType] mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) --- ** MimeType Instances +-- Default MimeType Instances -- | @application/json; charset=utf-8@ instance MimeType MimeJSON where @@ -117,18 +115,7 @@ instance MimeType MimeAny where instance MimeType MimeNoContent where mimeType _ = Nothing --- | @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 - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" - - --- ** MimeRender Class +-- * MimeRender Class class MimeType mtype => MimeRender mtype x where mimeRender :: P.Proxy mtype -> x -> BL.ByteString @@ -136,7 +123,10 @@ class MimeType mtype => MimeRender mtype x where mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x --- ** MimeRender Instances +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 @@ -158,13 +148,9 @@ instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary -instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData DateTime where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData @@ -172,28 +158,18 @@ instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRende instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString -mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam - -- | @P.Right . P.const NoContent@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty --- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec --- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec --- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec --- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec --- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined - --- ** MimeUnrender Class +-- * 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 --- ** MimeUnrender Instances +-- Default MimeUnrender Instances -- | @A.eitherDecode@ instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode @@ -215,15 +191,4 @@ instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.sho 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 - --- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** Request Consumes - -class MimeType mtype => Consumes req mtype where - --- ** Request Produces - -class MimeType mtype => Produces req mtype where +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent \ No newline at end of file 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 368eb5e7919..81208c6ce42 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -27,33 +27,30 @@ Module : SwaggerPetstore.Model module SwaggerPetstore.Model where +import SwaggerPetstore.Core + import Data.Aeson ((.:),(.:!),(.:?),(.=)) import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL -import qualified Data.ByteString.Base64.Lazy as BL64 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.Set as Set import qualified Data.Maybe as P -import qualified Data.Foldable as P -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH -import qualified Control.DeepSeq as NF -import qualified Data.Ix as P +import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T -import qualified Control.Arrow as P (left) -import Data.Text (Text) - import qualified Data.Time as TI -import qualified Data.Time.ISO8601 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 @@ -66,8 +63,7 @@ import qualified Prelude as P 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON AdditionalPropertiesClass instance A.FromJSON AdditionalPropertiesClass where @@ -93,15 +89,14 @@ mkAdditionalPropertiesClass = { additionalPropertiesClassMapProperty = Nothing , additionalPropertiesClassMapOfMapProperty = Nothing } - + -- ** Animal -- | Animal data Animal = Animal { animalClassName :: !(Text) -- ^ /Required/ "className" , animalColor :: !(Maybe Text) -- ^ "color" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Animal instance A.FromJSON Animal where @@ -128,14 +123,13 @@ mkAnimal animalClassName = { animalClassName , animalColor = Nothing } - + -- ** AnimalFarm -- | AnimalFarm data AnimalFarm = AnimalFarm { - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON AnimalFarm instance A.FromJSON AnimalFarm where @@ -158,7 +152,7 @@ mkAnimalFarm = AnimalFarm { } - + -- ** ApiResponse -- | ApiResponse @@ -166,8 +160,7 @@ data ApiResponse = ApiResponse { apiResponseCode :: !(Maybe Int) -- ^ "code" , apiResponseType :: !(Maybe Text) -- ^ "type" , apiResponseMessage :: !(Maybe Text) -- ^ "message" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ApiResponse instance A.FromJSON ApiResponse where @@ -196,14 +189,13 @@ mkApiResponse = , apiResponseType = Nothing , apiResponseMessage = Nothing } - + -- ** ArrayOfArrayOfNumberOnly -- | ArrayOfArrayOfNumberOnly data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ArrayOfArrayOfNumberOnly instance A.FromJSON ArrayOfArrayOfNumberOnly where @@ -226,14 +218,13 @@ mkArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing } - + -- ** ArrayOfNumberOnly -- | ArrayOfNumberOnly data ArrayOfNumberOnly = ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ArrayOfNumberOnly instance A.FromJSON ArrayOfNumberOnly where @@ -256,7 +247,7 @@ mkArrayOfNumberOnly = ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber = Nothing } - + -- ** ArrayTest -- | ArrayTest @@ -264,8 +255,7 @@ 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ArrayTest instance A.FromJSON ArrayTest where @@ -294,7 +284,7 @@ mkArrayTest = , arrayTestArrayArrayOfInteger = Nothing , arrayTestArrayArrayOfModel = Nothing } - + -- ** Capitalization -- | Capitalization @@ -305,8 +295,7 @@ data Capitalization = Capitalization , 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Capitalization instance A.FromJSON Capitalization where @@ -344,15 +333,14 @@ mkCapitalization = , capitalizationScaEthFlowPoints = Nothing , capitalizationAttName = Nothing } - + -- ** Category -- | Category data Category = Category { categoryId :: !(Maybe Integer) -- ^ "id" , categoryName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Category instance A.FromJSON Category where @@ -378,15 +366,14 @@ mkCategory = { 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ClassModel instance A.FromJSON ClassModel where @@ -409,14 +396,13 @@ mkClassModel = ClassModel { classModelClass = Nothing } - + -- ** Client -- | Client data Client = Client { clientClient :: !(Maybe Text) -- ^ "client" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Client instance A.FromJSON Client where @@ -439,15 +425,14 @@ mkClient = Client { clientClient = Nothing } - + -- ** EnumArrays -- | EnumArrays data EnumArrays = EnumArrays { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol" , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON EnumArrays instance A.FromJSON EnumArrays where @@ -473,14 +458,13 @@ mkEnumArrays = { enumArraysJustSymbol = Nothing , enumArraysArrayEnum = Nothing } - + -- ** EnumClass -- | EnumClass data EnumClass = EnumClass { - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON EnumClass instance A.FromJSON EnumClass where @@ -503,7 +487,7 @@ mkEnumClass = EnumClass { } - + -- ** EnumTest -- | EnumTest @@ -512,8 +496,7 @@ data EnumTest = EnumTest , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer" , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number" , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON EnumTest instance A.FromJSON EnumTest where @@ -545,7 +528,7 @@ mkEnumTest = , enumTestEnumNumber = Nothing , enumTestOuterEnum = Nothing } - + -- ** FormatTest -- | FormatTest @@ -563,8 +546,7 @@ data FormatTest = FormatTest , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" , formatTestUuid :: !(Maybe Text) -- ^ "uuid" , formatTestPassword :: !(Text) -- ^ /Required/ "password" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON FormatTest instance A.FromJSON FormatTest where @@ -627,15 +609,14 @@ mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = , formatTestUuid = Nothing , formatTestPassword } - + -- ** HasOnlyReadOnly -- | HasOnlyReadOnly data HasOnlyReadOnly = HasOnlyReadOnly { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON HasOnlyReadOnly instance A.FromJSON HasOnlyReadOnly where @@ -661,15 +642,14 @@ mkHasOnlyReadOnly = { 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 Text)) -- ^ "map_of_enum_string" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON MapTest instance A.FromJSON MapTest where @@ -695,7 +675,7 @@ mkMapTest = { mapTestMapMapOfString = Nothing , mapTestMapOfEnumString = Nothing } - + -- ** MixedPropertiesAndAdditionalPropertiesClass -- | MixedPropertiesAndAdditionalPropertiesClass @@ -703,8 +683,7 @@ data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalP { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON MixedPropertiesAndAdditionalPropertiesClass instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where @@ -733,7 +712,7 @@ mkMixedPropertiesAndAdditionalPropertiesClass = , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing } - + -- ** Model200Response -- | Model200Response @@ -741,8 +720,7 @@ mkMixedPropertiesAndAdditionalPropertiesClass = data Model200Response = Model200Response { model200ResponseName :: !(Maybe Int) -- ^ "name" , model200ResponseClass :: !(Maybe Text) -- ^ "class" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Model200Response instance A.FromJSON Model200Response where @@ -768,14 +746,13 @@ mkModel200Response = { model200ResponseName = Nothing , model200ResponseClass = Nothing } - + -- ** ModelList -- | ModelList data ModelList = ModelList { modelList123List :: !(Maybe Text) -- ^ "123-list" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ModelList instance A.FromJSON ModelList where @@ -798,15 +775,14 @@ 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ModelReturn instance A.FromJSON ModelReturn where @@ -829,7 +805,7 @@ mkModelReturn = ModelReturn { modelReturnReturn = Nothing } - + -- ** Name -- | Name @@ -839,8 +815,7 @@ data Name = Name , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case" , nameProperty :: !(Maybe Text) -- ^ "property" , name123Number :: !(Maybe Int) -- ^ "123Number" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Name instance A.FromJSON Name where @@ -873,14 +848,13 @@ mkName nameName = , nameProperty = Nothing , name123Number = Nothing } - + -- ** NumberOnly -- | NumberOnly data NumberOnly = NumberOnly { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON NumberOnly instance A.FromJSON NumberOnly where @@ -903,7 +877,7 @@ mkNumberOnly = NumberOnly { numberOnlyJustNumber = Nothing } - + -- ** Order -- | Order @@ -914,8 +888,7 @@ data Order = Order , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status , orderComplete :: !(Maybe Bool) -- ^ "complete" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Order instance A.FromJSON Order where @@ -953,37 +926,15 @@ mkOrder = , orderStatus = Nothing , orderComplete = Nothing } - + -- ** OuterBoolean -- | OuterBoolean -data OuterBoolean = OuterBoolean - { - } deriving (P.Show,P.Eq,P.Typeable) - +newtype OuterBoolean = OuterBoolean + { unOuterBoolean :: Bool + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) --- | FromJSON OuterBoolean -instance A.FromJSON OuterBoolean where - parseJSON = A.withObject "OuterBoolean" $ \o -> - pure OuterBoolean - --- | ToJSON OuterBoolean -instance A.ToJSON OuterBoolean where - toJSON OuterBoolean = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any) -mkOuterBoolean - :: OuterBoolean -mkOuterBoolean = - OuterBoolean - { - } - -- ** OuterComposite -- | OuterComposite @@ -991,8 +942,7 @@ 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON OuterComposite instance A.FromJSON OuterComposite where @@ -1021,14 +971,13 @@ mkOuterComposite = , outerCompositeMyString = Nothing , outerCompositeMyBoolean = Nothing } - + -- ** OuterEnum -- | OuterEnum data OuterEnum = OuterEnum { - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON OuterEnum instance A.FromJSON OuterEnum where @@ -1051,67 +1000,23 @@ mkOuterEnum = OuterEnum { } - + -- ** OuterNumber -- | OuterNumber -data OuterNumber = OuterNumber - { - } deriving (P.Show,P.Eq,P.Typeable) - +newtype OuterNumber = OuterNumber + { unOuterNumber :: Double + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) --- | FromJSON OuterNumber -instance A.FromJSON OuterNumber where - parseJSON = A.withObject "OuterNumber" $ \o -> - pure OuterNumber - --- | ToJSON OuterNumber -instance A.ToJSON OuterNumber where - toJSON OuterNumber = - _omitNulls - [ - ] - - --- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any) -mkOuterNumber - :: OuterNumber -mkOuterNumber = - OuterNumber - { - } - -- ** OuterString -- | OuterString -data OuterString = OuterString - { - } deriving (P.Show,P.Eq,P.Typeable) - - --- | FromJSON OuterString -instance A.FromJSON OuterString where - parseJSON = A.withObject "OuterString" $ \o -> - pure OuterString - - --- | ToJSON OuterString -instance A.ToJSON OuterString where - toJSON OuterString = - _omitNulls - [ - ] +newtype OuterString = OuterString + { unOuterString :: Text + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) --- | Construct a value of type 'OuterString' (by applying it's required fields, if any) -mkOuterString - :: OuterString -mkOuterString = - OuterString - { - } - -- ** Pet -- | Pet @@ -1122,8 +1027,7 @@ data Pet = Pet , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" , petTags :: !(Maybe [Tag]) -- ^ "tags" , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Pet instance A.FromJSON Pet where @@ -1163,15 +1067,14 @@ mkPet 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) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON ReadOnlyFirst instance A.FromJSON ReadOnlyFirst where @@ -1197,14 +1100,13 @@ mkReadOnlyFirst = { readOnlyFirstBar = Nothing , readOnlyFirstBaz = Nothing } - + -- ** SpecialModelName -- | SpecialModelName data SpecialModelName = SpecialModelName { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON SpecialModelName instance A.FromJSON SpecialModelName where @@ -1227,15 +1129,14 @@ mkSpecialModelName = SpecialModelName { specialModelNameSpecialPropertyName = Nothing } - + -- ** Tag -- | Tag data Tag = Tag { tagId :: !(Maybe Integer) -- ^ "id" , tagName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Tag instance A.FromJSON Tag where @@ -1261,7 +1162,7 @@ mkTag = { tagId = Nothing , tagName = Nothing } - + -- ** User -- | User @@ -1274,8 +1175,7 @@ data User = User , userPassword :: !(Maybe Text) -- ^ "password" , userPhone :: !(Maybe Text) -- ^ "phone" , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON User instance A.FromJSON User where @@ -1319,7 +1219,7 @@ mkUser = , userPhone = Nothing , userUserStatus = Nothing } - + -- ** Cat -- | Cat @@ -1327,8 +1227,7 @@ data Cat = Cat { catClassName :: !(Text) -- ^ /Required/ "className" , catColor :: !(Maybe Text) -- ^ "color" , catDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Cat instance A.FromJSON Cat where @@ -1358,7 +1257,7 @@ mkCat catClassName = , catColor = Nothing , catDeclawed = Nothing } - + -- ** Dog -- | Dog @@ -1366,8 +1265,7 @@ data Dog = Dog { dogClassName :: !(Text) -- ^ /Required/ "className" , dogColor :: !(Maybe Text) -- ^ "color" , dogBreed :: !(Maybe Text) -- ^ "breed" - } deriving (P.Show,P.Eq,P.Typeable) - + } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON Dog instance A.FromJSON Dog where @@ -1397,181 +1295,6 @@ mkDog dogClassName = , dogColor = Nothing , dogBreed = Nothing } - - --- * 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 :: Text } deriving (P.Eq, P.Show) -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show) -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show) -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show) -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show) -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show) -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show) -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } 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 :: [Text] } 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) - --- * 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 - where - 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 - --- | Collapse (Just "") to Nothing -_emptyToNothing :: Maybe String -> Maybe String -_emptyToNothing (Just "") = Nothing -_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 -{-# INLINE _memptyToNothing #-} - --- * DateTime Formatting - -newtype DateTime = DateTime { unDateTime :: TI.UTCTime } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON DateTime where - parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) -instance A.ToJSON DateTime where - 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) -instance P.Show DateTime where - show (DateTime t) = _showDateTime t - --- | @_parseISO8601@ -_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 = - TI.formatISO8601Millis -{-# INLINE _showDateTime #-} - --- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = - P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> - ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] -{-# INLINE _parseISO8601 #-} - --- * Date Formatting - -newtype Date = Date { unDate :: TI.Day } - deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime) -instance A.FromJSON Date where - parseJSON = A.withText "Date" (_readDate . T.unpack) -instance A.ToJSON Date where - 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) -instance P.Show Date where - show (Date t) = _showDate t - --- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_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 TI.defaultTimeLocale "%Y-%m-%d" -{-# INLINE _showDate #-} - --- * Byte/Binary Formatting - - --- | base64 encoded characters -newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON ByteArray where - parseJSON = A.withText "ByteArray" _readByteArray -instance A.ToJSON ByteArray where - toJSON = A.toJSON . _showByteArray -instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray -instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray -instance P.Show ByteArray where - show = T.unpack . _showByteArray - --- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray -_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readByteArray #-} - --- | show base64 encoded characters -_showByteArray :: ByteArray -> Text -_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray -{-# INLINE _showByteArray #-} - --- | any sequence of octets -newtype Binary = Binary { unBinary :: BL.ByteString } - deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) - -instance A.FromJSON Binary where - parseJSON = A.withText "Binary" _readBinaryBase64 -instance A.ToJSON Binary where - toJSON = A.toJSON . _showBinaryBase64 -instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 -instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 -instance P.Show Binary where - show = T.unpack . _showBinaryBase64 - -_readBinaryBase64 :: Monad m => Text -> m Binary -_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 -{-# INLINE _readBinaryBase64 #-} - -_showBinaryBase64 :: Binary -> Text -_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary -{-# INLINE _showBinaryBase64 #-} + + + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/ModelLens.hs similarity index 99% rename from samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs rename to samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/ModelLens.hs index eada883b6e1..d9573a4c2c0 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Lens.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/ModelLens.hs @@ -19,7 +19,7 @@ Module : SwaggerPetstore.Lens {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-} -module SwaggerPetstore.Lens where +module SwaggerPetstore.ModelLens where import qualified Data.Aeson as A import qualified Data.ByteString.Lazy as BL @@ -34,11 +34,7 @@ import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePa import qualified Prelude as P import SwaggerPetstore.Model - --- * 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 +import SwaggerPetstore.Core -- * AdditionalPropertiesClass diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index 46d075679ea..36a8e7212c1 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -25,7 +25,7 @@ cabal-version: >= 1.10 extra-source-files: README.md - swagger.json + swagger.yaml library hs-source-dirs: @@ -61,10 +61,11 @@ library SwaggerPetstore SwaggerPetstore.API SwaggerPetstore.Client - SwaggerPetstore.Model - SwaggerPetstore.MimeTypes - SwaggerPetstore.Lens + SwaggerPetstore.Core SwaggerPetstore.Logging + SwaggerPetstore.MimeTypes + SwaggerPetstore.Model + SwaggerPetstore.ModelLens other-modules: Paths_swagger_petstore default-language: Haskell2010 diff --git a/samples/client/petstore/haskell-http-client/swagger.json b/samples/client/petstore/haskell-http-client/swagger.json deleted file mode 100644 index 5b53d7108d0..00000000000 --- a/samples/client/petstore/haskell-http-client/swagger.json +++ /dev/null @@ -1,1693 +0,0 @@ -{ - "swagger" : "2.0", - "info" : { - "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: \" \\", - "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:80", - "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" ] - } ] - }, - "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" ] - } ] - } - }, - "/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", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" - }, - "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" ] - } ] - } - }, - "/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 - } - }, - "/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" : [ ] - } ] - }, - "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" ] - } ] - }, - "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" ] - } ] - } - }, - "/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" ] - } ] - } - }, - "/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" : [ ] - } ] - } - }, - "/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" - } - } - } - }, - "/store/order/{order_id}" : { - "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" : "order_id", - "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" - } - } - }, - "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" : "order_id", - "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" - } - } - } - }, - "/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" - } - } - } - }, - "/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" - } - } - } - }, - "/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" - } - } - } - }, - "/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" - } - } - } - }, - "/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" - } - } - } - }, - "/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" - } - } - }, - "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" - } - } - }, - "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" - } - } - } - }, - "/fake_classname_test" : { - "patch" : { - "tags" : [ "fake_classname_tags 123#$%^" ], - "summary" : "To test class name in snake case", - "operationId" : "testClassname", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" - } - } - }, - "security" : [ { - "api_key_query" : [ ] - } ] - } - }, - "/fake" : { - "get" : { - "tags" : [ "fake" ], - "summary" : "To test enum parameters", - "description" : "To test enum parameters", - "operationId" : "testEnumParameters", - "consumes" : [ "*/*" ], - "produces" : [ "*/*" ], - "parameters" : [ { - "name" : "enum_form_string_array", - "in" : "formData", - "description" : "Form parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" - } - }, { - "name" : "enum_form_string", - "in" : "formData", - "description" : "Form parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] - }, { - "name" : "enum_header_string_array", - "in" : "header", - "description" : "Header parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" - } - }, { - "name" : "enum_header_string", - "in" : "header", - "description" : "Header parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] - }, { - "name" : "enum_query_string_array", - "in" : "query", - "description" : "Query parameter enum test (string array)", - "required" : false, - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" - } - }, { - "name" : "enum_query_string", - "in" : "query", - "description" : "Query parameter enum test (string)", - "required" : false, - "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] - }, { - "name" : "enum_query_integer", - "in" : "query", - "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -2 ] - }, { - "name" : "enum_query_double", - "in" : "formData", - "description" : "Query parameter enum test (double)", - "required" : false, - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] - } ], - "responses" : { - "400" : { - "description" : "Invalid request" - }, - "404" : { - "description" : "Not found" - } - } - }, - "post" : { - "tags" : [ "fake" ], - "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", - "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", - "operationId" : "testEndpointParameters", - "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ], - "parameters" : [ { - "name" : "integer", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 100, - "minimum" : 10 - }, { - "name" : "int32", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "maximum" : 200, - "minimum" : 20, - "format" : "int32" - }, { - "name" : "int64", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "integer", - "format" : "int64" - }, { - "name" : "number", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 543.2, - "minimum" : 32.1 - }, { - "name" : "float", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "number", - "maximum" : 987.6, - "format" : "float" - }, { - "name" : "double", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "number", - "maximum" : 123.4, - "minimum" : 67.8, - "format" : "double" - }, { - "name" : "string", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "pattern" : "/[a-z]/i" - }, { - "name" : "pattern_without_delimiter", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "pattern" : "^[A-Z].*" - }, { - "name" : "byte", - "in" : "formData", - "description" : "None", - "required" : true, - "type" : "string", - "format" : "byte" - }, { - "name" : "binary", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "binary" - }, { - "name" : "date", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date" - }, { - "name" : "dateTime", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "format" : "date-time" - }, { - "name" : "password", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string", - "maxLength" : 64, - "minLength" : 10, - "format" : "password" - }, { - "name" : "callback", - "in" : "formData", - "description" : "None", - "required" : false, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "security" : [ { - "http_basic_test" : [ ] - } ] - }, - "patch" : { - "tags" : [ "fake" ], - "summary" : "To test \"client\" model", - "description" : "To test \"client\" model", - "operationId" : "testClientModel", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" - } - } - } - } - }, - "/fake/outer/number" : { - "post" : { - "tags" : [ "fake" ], - "description" : "Test serialization of outer number types", - "operationId" : "fakeOuterNumberSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Input number as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterNumber" - } - } ], - "responses" : { - "200" : { - "description" : "Output number", - "schema" : { - "$ref" : "#/definitions/OuterNumber" - } - } - } - } - }, - "/fake/outer/string" : { - "post" : { - "tags" : [ "fake" ], - "description" : "Test serialization of outer string types", - "operationId" : "fakeOuterStringSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Input string as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterString" - } - } ], - "responses" : { - "200" : { - "description" : "Output string", - "schema" : { - "$ref" : "#/definitions/OuterString" - } - } - } - } - }, - "/fake/outer/boolean" : { - "post" : { - "tags" : [ "fake" ], - "description" : "Test serialization of outer boolean types", - "operationId" : "fakeOuterBooleanSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Input boolean as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterBoolean" - } - } ], - "responses" : { - "200" : { - "description" : "Output boolean", - "schema" : { - "$ref" : "#/definitions/OuterBoolean" - } - } - } - } - }, - "/fake/outer/composite" : { - "post" : { - "tags" : [ "fake" ], - "description" : "Test serialization of object with outer number type", - "operationId" : "fakeOuterCompositeSerialize", - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Input composite as post body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/OuterComposite" - } - } ], - "responses" : { - "200" : { - "description" : "Output composite", - "schema" : { - "$ref" : "#/definitions/OuterComposite" - } - } - } - } - }, - "/fake/jsonFormData" : { - "get" : { - "tags" : [ "fake" ], - "summary" : "test json serialization of form data", - "description" : "", - "operationId" : "testJsonFormData", - "consumes" : [ "application/json" ], - "parameters" : [ { - "name" : "param", - "in" : "formData", - "description" : "field1", - "required" : true, - "type" : "string" - }, { - "name" : "param2", - "in" : "formData", - "description" : "field2", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation" - } - } - } - }, - "/another-fake/dummy" : { - "patch" : { - "tags" : [ "$another-fake?" ], - "summary" : "To test special tags", - "description" : "To test special tags", - "operationId" : "test_special_tags", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "client model", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Client" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Client" - } - } - } - } - } - }, - "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" - }, - "api_key_query" : { - "type" : "apiKey", - "name" : "api_key_query", - "in" : "query" - }, - "http_basic_test" : { - "type" : "basic" - } - }, - "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 - } - }, - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "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" - } - }, - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "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" ] - } - }, - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - } - }, - "$special[model.name]" : { - "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" - } - }, - "xml" : { - "name" : "$special[model.name]" - } - }, - "Return" : { - "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" - } - }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } - }, - "Name" : { - "required" : [ "name" ], - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "snake_case" : { - "type" : "integer", - "format" : "int32", - "readOnly" : true - }, - "property" : { - "type" : "string" - }, - "123Number" : { - "type" : "integer", - "readOnly" : true - } - }, - "description" : "Model for testing model name same as property name", - "xml" : { - "name" : "Name" - } - }, - "200_response" : { - "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "class" : { - "type" : "string" - } - }, - "description" : "Model for testing model name starting with number", - "xml" : { - "name" : "Name" - } - }, - "ClassModel" : { - "properties" : { - "_class" : { - "type" : "string" - } - }, - "description" : "Model for testing model with \"_class\" property" - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { - "type" : "object", - "properties" : { - "breed" : { - "type" : "string" - } - } - } ] - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/definitions/Animal" - }, { - "type" : "object", - "properties" : { - "declawed" : { - "type" : "boolean" - } - } - } ] - }, - "Animal" : { - "type" : "object", - "required" : [ "className" ], - "discriminator" : "className", - "properties" : { - "className" : { - "type" : "string" - }, - "color" : { - "type" : "string", - "default" : "red" - } - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Animal" - } - }, - "format_test" : { - "type" : "object", - "required" : [ "byte", "date", "number", "password" ], - "properties" : { - "integer" : { - "type" : "integer", - "minimum" : 10, - "maximum" : 100 - }, - "int32" : { - "type" : "integer", - "format" : "int32", - "minimum" : 20, - "maximum" : 200 - }, - "int64" : { - "type" : "integer", - "format" : "int64" - }, - "number" : { - "type" : "number", - "minimum" : 32.1, - "maximum" : 543.2 - }, - "float" : { - "type" : "number", - "format" : "float", - "minimum" : 54.3, - "maximum" : 987.6 - }, - "double" : { - "type" : "number", - "format" : "double", - "minimum" : 67.8, - "maximum" : 123.4 - }, - "string" : { - "type" : "string", - "pattern" : "/[a-z]/i" - }, - "byte" : { - "type" : "string", - "format" : "byte", - "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - }, - "binary" : { - "type" : "string", - "format" : "binary" - }, - "date" : { - "type" : "string", - "format" : "date" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "password" : { - "type" : "string", - "format" : "password", - "minLength" : 10, - "maxLength" : 64 - } - } - }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "Enum_Test" : { - "type" : "object", - "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] - }, - "outerEnum" : { - "$ref" : "#/definitions/OuterEnum" - } - } - }, - "AdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "map_of_map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - } - } - }, - "MixedPropertiesAndAdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "map" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/Animal" - } - } - } - }, - "List" : { - "type" : "object", - "properties" : { - "123-list" : { - "type" : "string" - } - } - }, - "Client" : { - "type" : "object", - "properties" : { - "client" : { - "type" : "string" - } - } - }, - "ReadOnlyFirst" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "baz" : { - "type" : "string" - } - } - }, - "hasOnlyReadOnly" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true - } - } - }, - "Capitalization" : { - "type" : "object", - "properties" : { - "smallCamel" : { - "type" : "string" - }, - "CapitalCamel" : { - "type" : "string" - }, - "small_Snake" : { - "type" : "string" - }, - "Capital_Snake" : { - "type" : "string" - }, - "SCA_ETH_Flow_Points" : { - "type" : "string" - }, - "ATT_NAME" : { - "type" : "string", - "description" : "Name of the pet\n" - } - } - }, - "MapTest" : { - "type" : "object", - "properties" : { - "map_map_of_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "map_of_enum_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "enum" : [ "UPPER", "lower" ] - } - } - } - }, - "ArrayTest" : { - "type" : "object", - "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "array_array_of_integer" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "array_array_of_model" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/ReadOnlyFirst" - } - } - } - } - }, - "NumberOnly" : { - "type" : "object", - "properties" : { - "JustNumber" : { - "type" : "number" - } - } - }, - "ArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { - "type" : "number" - } - } - } - }, - "ArrayOfArrayOfNumberOnly" : { - "type" : "object", - "properties" : { - "ArrayArrayNumber" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "number" - } - } - } - } - }, - "EnumArrays" : { - "type" : "object", - "properties" : { - "just_symbol" : { - "type" : "string", - "enum" : [ ">=", "$" ] - }, - "array_enum" : { - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ "fish", "crab" ] - } - } - } - }, - "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] - }, - "OuterComposite" : { - "type" : "object", - "properties" : { - "my_number" : { - "$ref" : "#/definitions/OuterNumber" - }, - "my_string" : { - "$ref" : "#/definitions/OuterString" - }, - "my_boolean" : { - "$ref" : "#/definitions/OuterBoolean" - } - } - }, - "OuterNumber" : { - "type" : "number" - }, - "OuterString" : { - "type" : "string" - }, - "OuterBoolean" : { - "type" : "boolean" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } -} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/swagger.yaml b/samples/client/petstore/haskell-http-client/swagger.yaml new file mode 100644 index 00000000000..9a4097a9292 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/swagger.yaml @@ -0,0 +1,1471 @@ +--- +swagger: "2.0" +info: + 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:\ + \ \" \\" + 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:80" +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" + 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" + /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" + enum: + - "available" + - "pending" + - "sold" + default: "available" + 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" + /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 + /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: [] + 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" + 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" + /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" + /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: [] + /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" + /store/order/{order_id}: + 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: "order_id" + 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" + 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: "order_id" + 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" + /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" + /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" + /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" + /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" + /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" + /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" + 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" + 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" + /fake_classname_test: + patch: + tags: + - "fake_classname_tags 123#$%^" + summary: "To test class name in snake case" + operationId: "testClassname" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + security: + - api_key_query: [] + /fake: + get: + tags: + - "fake" + summary: "To test enum parameters" + description: "To test enum parameters" + operationId: "testEnumParameters" + consumes: + - "*/*" + produces: + - "*/*" + parameters: + - name: "enum_form_string_array" + in: "formData" + description: "Form parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + enum: + - ">" + - "$" + default: "$" + - name: "enum_form_string" + in: "formData" + description: "Form parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_header_string_array" + in: "header" + description: "Header parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + enum: + - ">" + - "$" + default: "$" + - name: "enum_header_string" + in: "header" + description: "Header parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_query_string_array" + in: "query" + description: "Query parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + enum: + - ">" + - "$" + default: "$" + - name: "enum_query_string" + in: "query" + description: "Query parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + - name: "enum_query_integer" + in: "query" + description: "Query parameter enum test (double)" + required: false + type: "integer" + format: "int32" + enum: + - 1 + - -2 + - name: "enum_query_double" + in: "formData" + description: "Query parameter enum test (double)" + required: false + type: "number" + format: "double" + enum: + - 1.1 + - -1.2 + responses: + 400: + description: "Invalid request" + 404: + description: "Not found" + post: + tags: + - "fake" + summary: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔\ + 드 포인트\n" + description: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n\ + 가짜 엔드 포인트\n" + operationId: "testEndpointParameters" + consumes: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + produces: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + parameters: + - name: "integer" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 100 + minimum: 10 + - name: "int32" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 200 + minimum: 20 + format: "int32" + - name: "int64" + in: "formData" + description: "None" + required: false + type: "integer" + format: "int64" + - name: "number" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 543.2 + minimum: 32.1 + - name: "float" + in: "formData" + description: "None" + required: false + type: "number" + maximum: 987.6 + format: "float" + - name: "double" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 123.4 + minimum: 67.8 + format: "double" + - name: "string" + in: "formData" + description: "None" + required: false + type: "string" + pattern: "/[a-z]/i" + - name: "pattern_without_delimiter" + in: "formData" + description: "None" + required: true + type: "string" + pattern: "^[A-Z].*" + - name: "byte" + in: "formData" + description: "None" + required: true + type: "string" + format: "byte" + - name: "binary" + in: "formData" + description: "None" + required: false + type: "string" + format: "binary" + - name: "date" + in: "formData" + description: "None" + required: false + type: "string" + format: "date" + - name: "dateTime" + in: "formData" + description: "None" + required: false + type: "string" + format: "date-time" + - name: "password" + in: "formData" + description: "None" + required: false + type: "string" + maxLength: 64 + minLength: 10 + format: "password" + - name: "callback" + in: "formData" + description: "None" + required: false + type: "string" + responses: + 400: + description: "Invalid username supplied" + 404: + description: "User not found" + security: + - http_basic_test: [] + patch: + tags: + - "fake" + summary: "To test \"client\" model" + description: "To test \"client\" model" + operationId: "testClientModel" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + /fake/outer/number: + post: + tags: + - "fake" + description: "Test serialization of outer number types" + operationId: "fakeOuterNumberSerialize" + parameters: + - in: "body" + name: "body" + description: "Input number as post body" + required: false + schema: + $ref: "#/definitions/OuterNumber" + responses: + 200: + description: "Output number" + schema: + $ref: "#/definitions/OuterNumber" + /fake/outer/string: + post: + tags: + - "fake" + description: "Test serialization of outer string types" + operationId: "fakeOuterStringSerialize" + parameters: + - in: "body" + name: "body" + description: "Input string as post body" + required: false + schema: + $ref: "#/definitions/OuterString" + responses: + 200: + description: "Output string" + schema: + $ref: "#/definitions/OuterString" + /fake/outer/boolean: + post: + tags: + - "fake" + description: "Test serialization of outer boolean types" + operationId: "fakeOuterBooleanSerialize" + parameters: + - in: "body" + name: "body" + description: "Input boolean as post body" + required: false + schema: + $ref: "#/definitions/OuterBoolean" + responses: + 200: + description: "Output boolean" + schema: + $ref: "#/definitions/OuterBoolean" + /fake/outer/composite: + post: + tags: + - "fake" + description: "Test serialization of object with outer number type" + operationId: "fakeOuterCompositeSerialize" + parameters: + - in: "body" + name: "body" + description: "Input composite as post body" + required: false + schema: + $ref: "#/definitions/OuterComposite" + responses: + 200: + description: "Output composite" + schema: + $ref: "#/definitions/OuterComposite" + /fake/jsonFormData: + get: + tags: + - "fake" + summary: "test json serialization of form data" + description: "" + operationId: "testJsonFormData" + consumes: + - "application/json" + parameters: + - name: "param" + in: "formData" + description: "field1" + required: true + type: "string" + - name: "param2" + in: "formData" + description: "field2" + required: true + type: "string" + responses: + 200: + description: "successful operation" + /another-fake/dummy: + patch: + tags: + - "$another-fake?" + summary: "To test special tags" + description: "To test special tags" + operationId: "test_special_tags" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" +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" + api_key_query: + type: "apiKey" + name: "api_key_query" + in: "query" + http_basic_test: + type: "basic" +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 + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: "2000-01-23T04:56:07.000+00:00" + complete: false + status: "placed" + xml: + name: "Order" + x-mimeTypes: + - "MimeJSON" + - "MimeXML" + Category: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + example: + name: "name" + id: 6 + xml: + name: "Category" + User: + type: "object" + properties: + id: + type: "integer" + format: "int64" + x-is-unique: true + 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" + example: + firstName: "firstName" + lastName: "lastName" + password: "password" + userStatus: 6 + phone: "phone" + id: 0 + email: "email" + username: "username" + xml: + name: "User" + x-mimeTypes: + - "MimeJSON" + - "MimeXML" + Tag: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + example: + name: "name" + id: 1 + xml: + name: "Tag" + Pet: + type: "object" + required: + - "name" + - "photoUrls" + properties: + id: + type: "integer" + format: "int64" + x-is-unique: true + 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" + 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" + x-mimeTypes: + - "MimeJSON" + - "MimeXML" + ApiResponse: + type: "object" + properties: + code: + type: "integer" + format: "int32" + type: + type: "string" + message: + type: "string" + example: + code: 0 + type: "type" + message: "message" + $special[model.name]: + properties: + $special[property.name]: + type: "integer" + format: "int64" + xml: + name: "$special[model.name]" + Return: + properties: + return: + type: "integer" + format: "int32" + description: "Model for testing reserved words" + xml: + name: "Return" + Name: + required: + - "name" + properties: + name: + type: "integer" + format: "int32" + snake_case: + type: "integer" + format: "int32" + readOnly: true + property: + type: "string" + 123Number: + type: "integer" + readOnly: true + description: "Model for testing model name same as property name" + xml: + name: "Name" + 200_response: + properties: + name: + type: "integer" + format: "int32" + class: + type: "string" + description: "Model for testing model name starting with number" + xml: + name: "Name" + ClassModel: + properties: + _class: + type: "string" + description: "Model for testing model with \"_class\" property" + Dog: + allOf: + - $ref: "#/definitions/Animal" + - type: "object" + properties: + breed: + type: "string" + Cat: + allOf: + - $ref: "#/definitions/Animal" + - type: "object" + properties: + declawed: + type: "boolean" + Animal: + type: "object" + required: + - "className" + discriminator: "className" + properties: + className: + type: "string" + color: + type: "string" + default: "red" + AnimalFarm: + type: "array" + items: + $ref: "#/definitions/Animal" + format_test: + type: "object" + required: + - "byte" + - "date" + - "number" + - "password" + properties: + integer: + type: "integer" + minimum: 10 + maximum: 100 + int32: + type: "integer" + format: "int32" + minimum: 20 + maximum: 200 + int64: + type: "integer" + format: "int64" + number: + type: "number" + minimum: 32.1 + maximum: 543.2 + float: + type: "number" + format: "float" + minimum: 54.3 + maximum: 987.6 + double: + type: "number" + format: "double" + minimum: 67.8 + maximum: 123.4 + string: + type: "string" + pattern: "/[a-z]/i" + byte: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + binary: + type: "string" + format: "binary" + date: + type: "string" + format: "date" + dateTime: + type: "string" + format: "date-time" + uuid: + type: "string" + format: "uuid" + password: + type: "string" + format: "password" + minLength: 10 + maxLength: 64 + EnumClass: + type: "string" + enum: + - "_abc" + - "-efg" + - "(xyz)" + default: "-efg" + Enum_Test: + type: "object" + properties: + enum_string: + type: "string" + enum: + - "UPPER" + - "lower" + - "" + enum_integer: + type: "integer" + format: "int32" + enum: + - 1 + - -1 + enum_number: + type: "number" + format: "double" + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: "#/definitions/OuterEnum" + AdditionalPropertiesClass: + type: "object" + properties: + map_property: + type: "object" + additionalProperties: + type: "string" + map_of_map_property: + type: "object" + additionalProperties: + type: "object" + additionalProperties: + type: "string" + MixedPropertiesAndAdditionalPropertiesClass: + type: "object" + properties: + uuid: + type: "string" + format: "uuid" + dateTime: + type: "string" + format: "date-time" + map: + type: "object" + additionalProperties: + $ref: "#/definitions/Animal" + List: + type: "object" + properties: + 123-list: + type: "string" + Client: + type: "object" + properties: + client: + type: "string" + example: + client: "client" + x-mimeTypes: + - "MimeJSON" + ReadOnlyFirst: + type: "object" + properties: + bar: + type: "string" + readOnly: true + baz: + type: "string" + hasOnlyReadOnly: + type: "object" + properties: + bar: + type: "string" + readOnly: true + foo: + type: "string" + readOnly: true + Capitalization: + type: "object" + properties: + smallCamel: + type: "string" + CapitalCamel: + type: "string" + small_Snake: + type: "string" + Capital_Snake: + type: "string" + SCA_ETH_Flow_Points: + type: "string" + ATT_NAME: + type: "string" + description: "Name of the pet\n" + MapTest: + type: "object" + properties: + map_map_of_string: + type: "object" + additionalProperties: + type: "object" + additionalProperties: + type: "string" + map_of_enum_string: + type: "object" + additionalProperties: + type: "string" + enum: + - "UPPER" + - "lower" + ArrayTest: + type: "object" + properties: + array_of_string: + type: "array" + items: + type: "string" + array_array_of_integer: + type: "array" + items: + type: "array" + items: + type: "integer" + format: "int64" + array_array_of_model: + type: "array" + items: + type: "array" + items: + $ref: "#/definitions/ReadOnlyFirst" + NumberOnly: + type: "object" + properties: + JustNumber: + type: "number" + ArrayOfNumberOnly: + type: "object" + properties: + ArrayNumber: + type: "array" + items: + type: "number" + ArrayOfArrayOfNumberOnly: + type: "object" + properties: + ArrayArrayNumber: + type: "array" + items: + type: "array" + items: + type: "number" + EnumArrays: + type: "object" + properties: + just_symbol: + type: "string" + enum: + - ">=" + - "$" + array_enum: + type: "array" + items: + type: "string" + enum: + - "fish" + - "crab" + OuterEnum: + type: "string" + enum: + - "placed" + - "approved" + - "delivered" + OuterComposite: + type: "object" + properties: + my_number: + $ref: "#/definitions/OuterNumber" + my_string: + $ref: "#/definitions/OuterString" + my_boolean: + $ref: "#/definitions/OuterBoolean" + example: + my_string: {} + my_number: {} + my_boolean: {} + OuterNumber: + type: "number" + OuterString: + type: "string" + OuterBoolean: + type: "boolean" +externalDocs: + description: "Find out more about Swagger" + url: "http://swagger.io" diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 50853af7c99..43cc2d9e622 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -2,10 +2,9 @@ module Instances where -import Control.Monad -import Data.Char (isSpace) -import Data.List (sort) -import Test.QuickCheck +import SwaggerPetstore.Model +import SwaggerPetstore.Core + import qualified Data.Aeson as A import qualified Data.ByteString.Lazy as BL import qualified Data.HashMap.Strict as HM @@ -14,8 +13,12 @@ import qualified Data.Text as T import qualified Data.Time as TI import qualified Data.Vector as V +import Control.Monad +import Data.Char (isSpace) +import Data.List (sort) +import Test.QuickCheck + import ApproxEq -import SwaggerPetstore.Model instance Arbitrary T.Text where arbitrary = T.pack <$> arbitrary @@ -102,6 +105,7 @@ instance Arbitrary Animal where instance Arbitrary AnimalFarm where arbitrary = + pure AnimalFarm @@ -172,6 +176,7 @@ instance Arbitrary EnumArrays where instance Arbitrary EnumClass where arbitrary = + pure EnumClass @@ -271,8 +276,7 @@ instance Arbitrary Order where instance Arbitrary OuterBoolean where arbitrary = - pure OuterBoolean - + OuterBoolean <$> arbitrary instance Arbitrary OuterComposite where arbitrary = @@ -284,18 +288,17 @@ instance Arbitrary OuterComposite where instance Arbitrary OuterEnum where arbitrary = + pure OuterEnum instance Arbitrary OuterNumber where arbitrary = - pure OuterNumber - + OuterNumber <$> arbitrary instance Arbitrary OuterString where arbitrary = - pure OuterString - + OuterString <$> arbitrary instance Arbitrary Pet where arbitrary = From e4abddf253201b8f43e64f2fb84519179d0197b2 Mon Sep 17 00:00:00 2001 From: Will Neild Date: Wed, 18 Oct 2017 09:38:12 +0100 Subject: [PATCH 177/197] Fix spring api operation annotation (#6700) * * Fix apioperation annotation using generics in class reference for spring server generation * * Regenerate classes for new spring template --- .../src/main/resources/JavaSpring/api.mustache | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ .../src/main/java/io/swagger/api/FakeApi.java | 6 +++--- .../src/main/java/io/swagger/api/PetApi.java | 8 ++++---- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 12 ++++++------ 39 files changed, 135 insertions(+), 135 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 9cf1a6fd167..f2f7c15f1a2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -43,7 +43,7 @@ import javax.validation.Valid; public interface {{classname}} { {{#operation}} - @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}", response = {{{returnType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, {{/hasMore}}{{/scopes}} diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 7460e4146d0..9dc45ad5634 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -28,7 +28,7 @@ @Api(value = "Pet", description = "the Pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -43,7 +43,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -104,7 +104,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId); - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -121,7 +121,7 @@ public interface PetApi { com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 f2249f2f415..a93edffab2d 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 @@ @Api(value = "Store", description = "the Store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index 52c0d7065f2..cf2a1b89cdc 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -27,7 +27,7 @@ @Api(value = "User", description = "the User API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -47,7 +47,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -57,7 +57,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -91,7 +91,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -101,7 +101,7 @@ public interface UserApi { com.netflix.hystrix.HystrixCommand> logoutUser(); - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index fd689d1e630..65fd59009b1 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -105,7 +105,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -122,7 +122,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 4d012286be4..33fd53aa2e2 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index 76d92efe050..d1e1f9e5def 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -38,7 +38,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -48,7 +48,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -58,7 +58,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -92,7 +92,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -102,7 +102,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index a4e2b7ed871..867a58e7730 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -90,7 +90,7 @@ default CompletableFuture> testClientModel(@ApiParam(valu } - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -106,7 +106,7 @@ default CompletableFuture> testEndpointParameters(@ApiParam } - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -120,7 +120,7 @@ default CompletableFuture> testEnumParameters(@ApiParam(val } - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index bc81d88402f..d322c3004dd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -31,7 +31,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -49,7 +49,7 @@ default CompletableFuture> addPet(@ApiParam(value = "Pet ob } - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ default CompletableFuture> getPetById(@ApiParam(value = "ID } - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -138,7 +138,7 @@ default CompletableFuture> updatePet(@ApiParam(value = "Pet } - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 258f7f9c9ed..dc7778018fe 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 @@ -30,7 +30,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 1faeadc5e41..1bb90cbfa0b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -30,7 +30,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -42,7 +42,7 @@ default CompletableFuture> createUser(@ApiParam(value = "Cr } - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -54,7 +54,7 @@ default CompletableFuture> createUsersWithArrayInput(@ApiPa } - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -66,7 +66,7 @@ default CompletableFuture> createUsersWithListInput(@ApiPar } - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -106,7 +106,7 @@ default CompletableFuture> loginUser( @NotNull@ApiParam(v } - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -118,7 +118,7 @@ default CompletableFuture> logoutUser( @RequestHeader(value } - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index bb3d2a07bc8..db6e0e39f59 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index 9d3d35fa3d4..e8e51f438d6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 29eb4c3f78e..50abaa03dff 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index 4ebcd42aa79..7264a3bc9cc 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java index bb3d2a07bc8..db6e0e39f59 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java index 9d3d35fa3d4..e8e51f438d6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 29eb4c3f78e..50abaa03dff 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java index 4ebcd42aa79..7264a3bc9cc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index 6c25bd2db9c..79cc25c16b0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -89,7 +89,7 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" } - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -105,7 +105,7 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re } - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -119,7 +119,7 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Form paramete } - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index e7da9813412..239a5e189d6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -30,7 +30,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -48,7 +48,7 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to } - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -117,7 +117,7 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r } - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -137,7 +137,7 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs } - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 0eb316bb35b..2361343fe79 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 @@ -29,7 +29,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index a5bb65fbf78..aeb4b57e667 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -41,7 +41,7 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" } - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -53,7 +53,7 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o } - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -65,7 +65,7 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of } - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -105,7 +105,7 @@ default ResponseEntity loginUser( @NotNull@ApiParam(value = "The user na } - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -117,7 +117,7 @@ default ResponseEntity logoutUser( @RequestHeader(value = "Accept", requir } - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index bb3d2a07bc8..db6e0e39f59 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index 9d3d35fa3d4..e8e51f438d6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 29eb4c3f78e..50abaa03dff 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index 4ebcd42aa79..7264a3bc9cc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java index 49e84ac7d28..8ce5280a6f2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -88,7 +88,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -104,7 +104,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -118,7 +118,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java index 4507ea983d3..e787d55f2a8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -47,7 +47,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -116,7 +116,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -136,7 +136,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 f77da88f58f..6206381ca92 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java index c54491d6812..9b3e8feb6b3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -40,7 +40,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -52,7 +52,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -64,7 +64,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -104,7 +104,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @ApiImplicitParams({ @@ -116,7 +116,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java index afd79d11cce..97e16f68d86 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java @@ -74,7 +74,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -87,7 +87,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -98,7 +98,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) Optional> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) Optional enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") Optional enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java index 77f019f4571..d5723ddec2a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java @@ -30,7 +30,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -45,7 +45,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -102,7 +102,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -119,7 +119,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 ef179173939..461faf4522a 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 @@ -29,7 +29,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java index 4692409e01a..40ac1add4bd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -38,7 +38,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -47,7 +47,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -56,7 +56,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -87,7 +87,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -96,7 +96,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index bb3d2a07bc8..db6e0e39f59 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -86,7 +86,7 @@ public interface FakeApi { ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request"), @ApiResponse(code = 404, message = "Not found") }) @@ -97,7 +97,7 @@ public interface FakeApi { ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString,@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", response = Void.class, tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/fake/jsonFormData", diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index 9d3d35fa3d4..e8e51f438d6 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -29,7 +29,7 @@ @Api(value = "pet", description = "the pet API") public interface PetApi { - @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -44,7 +44,7 @@ public interface PetApi { ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -101,7 +101,7 @@ public interface PetApi { ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") @@ -118,7 +118,7 @@ public interface PetApi { ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") 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 29eb4c3f78e..50abaa03dff 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 @@ -28,7 +28,7 @@ @Api(value = "store", description = "the store API") 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", response = Void.class, tags={ "store", }) + @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 = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 4ebcd42aa79..7264a3bc9cc 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -28,7 +28,7 @@ @Api(value = "user", description = "the user API") public interface UserApi { - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user", @@ -37,7 +37,7 @@ public interface UserApi { ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithArray", @@ -46,7 +46,7 @@ public interface UserApi { ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/createWithList", @@ -55,7 +55,7 @@ public interface UserApi { ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -86,7 +86,7 @@ public interface UserApi { ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping(value = "/user/logout", @@ -95,7 +95,7 @@ public interface UserApi { ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept) throws Exception; - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) From d37894199b0193d963b1656a8b1e50f1c448d317 Mon Sep 17 00:00:00 2001 From: Gustavo Paz <32820138+gustavoapaz@users.noreply.github.com> Date: Thu, 19 Oct 2017 03:58:16 -0500 Subject: [PATCH 178/197] [Java][JAX-RS-CXF] Add JsonProperty to POJO (#6710) * Included Open Systems International in the list of companies using Swagger Codegen * Force Jackson to use the real names of the properties of the Data type defined in the YAML * Update of the Petstore CXF server sample * Update of the Petstore CXF client sample * Update of the Petstore CXF server annotated base path sample * Update of the Petstore CXF server non spring application sample * Changed {{name}} for {{baseName}} following the correction posted by @wing328 * Update of the Petstore CXF server sample --- .../src/main/resources/JavaJaxRS/cxf/pojo.mustache | 2 ++ .../src/gen/java/io/swagger/model/Category.java | 3 +++ .../java/io/swagger/model/ModelApiResponse.java | 4 ++++ .../src/gen/java/io/swagger/model/Order.java | 7 +++++++ .../src/gen/java/io/swagger/model/Pet.java | 7 +++++++ .../src/gen/java/io/swagger/model/Tag.java | 3 +++ .../src/gen/java/io/swagger/model/User.java | 9 +++++++++ .../src/gen/java/io/swagger/model/Category.java | 3 +++ .../java/io/swagger/model/ModelApiResponse.java | 4 ++++ .../src/gen/java/io/swagger/model/Order.java | 7 +++++++ .../src/gen/java/io/swagger/model/Pet.java | 7 +++++++ .../src/gen/java/io/swagger/model/Tag.java | 3 +++ .../src/gen/java/io/swagger/model/User.java | 9 +++++++++ .../src/gen/java/io/swagger/model/Category.java | 3 +++ .../java/io/swagger/model/ModelApiResponse.java | 4 ++++ .../src/gen/java/io/swagger/model/Order.java | 7 +++++++ .../src/gen/java/io/swagger/model/Pet.java | 7 +++++++ .../src/gen/java/io/swagger/model/Tag.java | 3 +++ .../src/gen/java/io/swagger/model/User.java | 9 +++++++++ .../swagger/model/AdditionalPropertiesClass.java | 3 +++ .../src/gen/java/io/swagger/model/Animal.java | 3 +++ .../src/gen/java/io/swagger/model/AnimalFarm.java | 1 + .../io/swagger/model/ArrayOfArrayOfNumberOnly.java | 2 ++ .../java/io/swagger/model/ArrayOfNumberOnly.java | 2 ++ .../src/gen/java/io/swagger/model/ArrayTest.java | 4 ++++ .../gen/java/io/swagger/model/Capitalization.java | 7 +++++++ .../src/gen/java/io/swagger/model/Cat.java | 2 ++ .../src/gen/java/io/swagger/model/Category.java | 3 +++ .../src/gen/java/io/swagger/model/ClassModel.java | 2 ++ .../src/gen/java/io/swagger/model/Client.java | 2 ++ .../src/gen/java/io/swagger/model/Dog.java | 2 ++ .../src/gen/java/io/swagger/model/EnumArrays.java | 3 +++ .../src/gen/java/io/swagger/model/EnumTest.java | 5 +++++ .../src/gen/java/io/swagger/model/FormatTest.java | 14 ++++++++++++++ .../gen/java/io/swagger/model/HasOnlyReadOnly.java | 3 +++ .../src/gen/java/io/swagger/model/MapTest.java | 3 +++ ...ixedPropertiesAndAdditionalPropertiesClass.java | 4 ++++ .../java/io/swagger/model/Model200Response.java | 3 +++ .../java/io/swagger/model/ModelApiResponse.java | 4 ++++ .../src/gen/java/io/swagger/model/ModelReturn.java | 2 ++ .../src/gen/java/io/swagger/model/Name.java | 5 +++++ .../src/gen/java/io/swagger/model/NumberOnly.java | 2 ++ .../src/gen/java/io/swagger/model/Order.java | 7 +++++++ .../gen/java/io/swagger/model/OuterComposite.java | 4 ++++ .../src/gen/java/io/swagger/model/Pet.java | 7 +++++++ .../gen/java/io/swagger/model/ReadOnlyFirst.java | 3 +++ .../java/io/swagger/model/SpecialModelName.java | 2 ++ .../src/gen/java/io/swagger/model/Tag.java | 3 +++ .../src/gen/java/io/swagger/model/User.java | 9 +++++++++ 49 files changed, 217 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index bb9bbab729d..0412381d534 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; {{#withXml}} @XmlAccessorType(XmlAccessType.FIELD) @@ -46,6 +47,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { {{/maximum}} * @return {{name}} **/ + @JsonProperty("{{baseName}}") {{#vendorExtensions.extraAnnotation}} {{{vendorExtensions.extraAnnotation}}} {{/vendorExtensions.extraAnnotation}} diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java index c6076fb8df8..2e1f5c0c2a8 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A category for a pet") public class Category { @@ -24,6 +25,7 @@ public class Category { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Category id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java index 4877f3ace31..c6dc9cbecf6 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { @@ -26,6 +27,7 @@ public class ModelApiResponse { * Get code * @return code **/ + @JsonProperty("code") public Integer getCode() { return code; } @@ -43,6 +45,7 @@ public ModelApiResponse code(Integer code) { * Get type * @return type **/ + @JsonProperty("type") public String getType() { return type; } @@ -60,6 +63,7 @@ public ModelApiResponse type(String type) { * Get message * @return message **/ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java index 5b4a67f50c1..f3083f27494 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java @@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -66,6 +67,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -83,6 +85,7 @@ public Order id(Long id) { * Get petId * @return petId **/ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -100,6 +103,7 @@ public Order petId(Long petId) { * Get quantity * @return quantity **/ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -117,6 +121,7 @@ public Order quantity(Integer quantity) { * Get shipDate * @return shipDate **/ + @JsonProperty("shipDate") public Date getShipDate() { return shipDate; } @@ -134,6 +139,7 @@ public Order shipDate(Date shipDate) { * Order Status * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -151,6 +157,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ + @JsonProperty("complete") public Boolean isComplete() { return complete; } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java index 15f9322a95a..0776e03a908 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java @@ -15,6 +15,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -69,6 +70,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -86,6 +88,7 @@ public Pet id(Long id) { * Get category * @return category **/ + @JsonProperty("category") public Category getCategory() { return category; } @@ -103,6 +106,7 @@ public Pet category(Category category) { * Get name * @return name **/ + @JsonProperty("name") @NotNull public String getName() { return name; @@ -121,6 +125,7 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ + @JsonProperty("photoUrls") @NotNull public List getPhotoUrls() { return photoUrls; @@ -144,6 +149,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get tags * @return tags **/ + @JsonProperty("tags") public List getTags() { return tags; } @@ -166,6 +172,7 @@ public Pet addTagsItem(Tag tagsItem) { * pet status in the store * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java index a0bfd24470f..1e80911874f 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A tag for a pet") public class Tag { @@ -24,6 +25,7 @@ public class Tag { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Tag id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java index 74b908a3aa3..a0f42ad1ce7 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -36,6 +37,7 @@ public class User { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -53,6 +55,7 @@ public User id(Long id) { * Get username * @return username **/ + @JsonProperty("username") public String getUsername() { return username; } @@ -70,6 +73,7 @@ public User username(String username) { * Get firstName * @return firstName **/ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -87,6 +91,7 @@ public User firstName(String firstName) { * Get lastName * @return lastName **/ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -104,6 +109,7 @@ public User lastName(String lastName) { * Get email * @return email **/ + @JsonProperty("email") public String getEmail() { return email; } @@ -121,6 +127,7 @@ public User email(String email) { * Get password * @return password **/ + @JsonProperty("password") public String getPassword() { return password; } @@ -138,6 +145,7 @@ public User password(String password) { * Get phone * @return phone **/ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -155,6 +163,7 @@ public User phone(String phone) { * User Status * @return userStatus **/ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java index c6076fb8df8..2e1f5c0c2a8 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A category for a pet") public class Category { @@ -24,6 +25,7 @@ public class Category { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Category id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java index 4877f3ace31..c6dc9cbecf6 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { @@ -26,6 +27,7 @@ public class ModelApiResponse { * Get code * @return code **/ + @JsonProperty("code") public Integer getCode() { return code; } @@ -43,6 +45,7 @@ public ModelApiResponse code(Integer code) { * Get type * @return type **/ + @JsonProperty("type") public String getType() { return type; } @@ -60,6 +63,7 @@ public ModelApiResponse type(String type) { * Get message * @return message **/ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index 5b4a67f50c1..f3083f27494 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -66,6 +67,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -83,6 +85,7 @@ public Order id(Long id) { * Get petId * @return petId **/ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -100,6 +103,7 @@ public Order petId(Long petId) { * Get quantity * @return quantity **/ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -117,6 +121,7 @@ public Order quantity(Integer quantity) { * Get shipDate * @return shipDate **/ + @JsonProperty("shipDate") public Date getShipDate() { return shipDate; } @@ -134,6 +139,7 @@ public Order shipDate(Date shipDate) { * Order Status * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -151,6 +157,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ + @JsonProperty("complete") public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java index 15f9322a95a..0776e03a908 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java @@ -15,6 +15,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -69,6 +70,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -86,6 +88,7 @@ public Pet id(Long id) { * Get category * @return category **/ + @JsonProperty("category") public Category getCategory() { return category; } @@ -103,6 +106,7 @@ public Pet category(Category category) { * Get name * @return name **/ + @JsonProperty("name") @NotNull public String getName() { return name; @@ -121,6 +125,7 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ + @JsonProperty("photoUrls") @NotNull public List getPhotoUrls() { return photoUrls; @@ -144,6 +149,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get tags * @return tags **/ + @JsonProperty("tags") public List getTags() { return tags; } @@ -166,6 +172,7 @@ public Pet addTagsItem(Tag tagsItem) { * pet status in the store * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java index a0bfd24470f..1e80911874f 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A tag for a pet") public class Tag { @@ -24,6 +25,7 @@ public class Tag { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Tag id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java index 74b908a3aa3..a0f42ad1ce7 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -36,6 +37,7 @@ public class User { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -53,6 +55,7 @@ public User id(Long id) { * Get username * @return username **/ + @JsonProperty("username") public String getUsername() { return username; } @@ -70,6 +73,7 @@ public User username(String username) { * Get firstName * @return firstName **/ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -87,6 +91,7 @@ public User firstName(String firstName) { * Get lastName * @return lastName **/ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -104,6 +109,7 @@ public User lastName(String lastName) { * Get email * @return email **/ + @JsonProperty("email") public String getEmail() { return email; } @@ -121,6 +127,7 @@ public User email(String email) { * Get password * @return password **/ + @JsonProperty("password") public String getPassword() { return password; } @@ -138,6 +145,7 @@ public User password(String password) { * Get phone * @return phone **/ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -155,6 +163,7 @@ public User phone(String phone) { * User Status * @return userStatus **/ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java index c6076fb8df8..2e1f5c0c2a8 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A category for a pet") public class Category { @@ -24,6 +25,7 @@ public class Category { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Category id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java index 4877f3ace31..c6dc9cbecf6 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { @@ -26,6 +27,7 @@ public class ModelApiResponse { * Get code * @return code **/ + @JsonProperty("code") public Integer getCode() { return code; } @@ -43,6 +45,7 @@ public ModelApiResponse code(Integer code) { * Get type * @return type **/ + @JsonProperty("type") public String getType() { return type; } @@ -60,6 +63,7 @@ public ModelApiResponse type(String type) { * Get message * @return message **/ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index 5b4a67f50c1..f3083f27494 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -66,6 +67,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -83,6 +85,7 @@ public Order id(Long id) { * Get petId * @return petId **/ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -100,6 +103,7 @@ public Order petId(Long petId) { * Get quantity * @return quantity **/ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -117,6 +121,7 @@ public Order quantity(Integer quantity) { * Get shipDate * @return shipDate **/ + @JsonProperty("shipDate") public Date getShipDate() { return shipDate; } @@ -134,6 +139,7 @@ public Order shipDate(Date shipDate) { * Order Status * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -151,6 +157,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ + @JsonProperty("complete") public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java index 15f9322a95a..0776e03a908 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java @@ -15,6 +15,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -69,6 +70,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -86,6 +88,7 @@ public Pet id(Long id) { * Get category * @return category **/ + @JsonProperty("category") public Category getCategory() { return category; } @@ -103,6 +106,7 @@ public Pet category(Category category) { * Get name * @return name **/ + @JsonProperty("name") @NotNull public String getName() { return name; @@ -121,6 +125,7 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ + @JsonProperty("photoUrls") @NotNull public List getPhotoUrls() { return photoUrls; @@ -144,6 +149,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get tags * @return tags **/ + @JsonProperty("tags") public List getTags() { return tags; } @@ -166,6 +172,7 @@ public Pet addTagsItem(Tag tagsItem) { * pet status in the store * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java index a0bfd24470f..1e80911874f 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A tag for a pet") public class Tag { @@ -24,6 +25,7 @@ public class Tag { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -41,6 +43,7 @@ public Tag id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java index 74b908a3aa3..a0f42ad1ce7 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -36,6 +37,7 @@ public class User { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -53,6 +55,7 @@ public User id(Long id) { * Get username * @return username **/ + @JsonProperty("username") public String getUsername() { return username; } @@ -70,6 +73,7 @@ public User username(String username) { * Get firstName * @return firstName **/ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -87,6 +91,7 @@ public User firstName(String firstName) { * Get lastName * @return lastName **/ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -104,6 +109,7 @@ public User lastName(String lastName) { * Get email * @return email **/ + @JsonProperty("email") public String getEmail() { return email; } @@ -121,6 +127,7 @@ public User email(String email) { * Get password * @return password **/ + @JsonProperty("password") public String getPassword() { return password; } @@ -138,6 +145,7 @@ public User password(String password) { * Get phone * @return phone **/ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -155,6 +163,7 @@ public User phone(String phone) { * User Status * @return userStatus **/ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 2a684fce3bd..0fd4f04aeea 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class AdditionalPropertiesClass { @@ -25,6 +26,7 @@ public class AdditionalPropertiesClass { * Get mapProperty * @return mapProperty **/ + @JsonProperty("map_property") public Map getMapProperty() { return mapProperty; } @@ -47,6 +49,7 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper * Get mapOfMapProperty * @return mapOfMapProperty **/ + @JsonProperty("map_of_map_property") public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java index 7b8b9faa45e..29ad41d9e98 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Animal.java @@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Animal { @@ -24,6 +25,7 @@ public class Animal { * Get className * @return className **/ + @JsonProperty("className") @NotNull public String getClassName() { return className; @@ -42,6 +44,7 @@ public Animal className(String className) { * Get color * @return color **/ + @JsonProperty("color") public String getColor() { return color; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java index b9ceb010054..e3ea311206f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class AnimalFarm extends ArrayList { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index cf72f92cd9e..da2ba2eba34 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class ArrayOfArrayOfNumberOnly { @@ -23,6 +24,7 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ + @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 6c1b6335d96..30ad053c214 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class ArrayOfNumberOnly { @@ -23,6 +24,7 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ + @JsonProperty("ArrayNumber") public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java index 36523b49963..c76d50e816f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ArrayTest.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class ArrayTest { @@ -27,6 +28,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ + @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; } @@ -49,6 +51,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ + @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -71,6 +74,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfModel * @return arrayArrayOfModel **/ + @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java index 8d25cc55cb3..ce100b22300 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Capitalization { @@ -30,6 +31,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ + @JsonProperty("smallCamel") public String getSmallCamel() { return smallCamel; } @@ -47,6 +49,7 @@ public Capitalization smallCamel(String smallCamel) { * Get capitalCamel * @return capitalCamel **/ + @JsonProperty("CapitalCamel") public String getCapitalCamel() { return capitalCamel; } @@ -64,6 +67,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get smallSnake * @return smallSnake **/ + @JsonProperty("small_Snake") public String getSmallSnake() { return smallSnake; } @@ -81,6 +85,7 @@ public Capitalization smallSnake(String smallSnake) { * Get capitalSnake * @return capitalSnake **/ + @JsonProperty("Capital_Snake") public String getCapitalSnake() { return capitalSnake; } @@ -98,6 +103,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ + @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -115,6 +121,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Name of the pet * @return ATT_NAME **/ + @JsonProperty("ATT_NAME") public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java index 490db608125..64f6869a3f8 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Cat.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Cat extends Animal { @@ -21,6 +22,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ + @JsonProperty("declawed") public Boolean isDeclawed() { return declawed; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java index 6abf3c9c6cb..d16c0c2d3d4 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Category.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Category { @@ -22,6 +23,7 @@ public class Category { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -39,6 +41,7 @@ public Category id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java index 9f4a079d27a..6cc8af52fc6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Model for testing model with \"_class\" property") public class ClassModel { @@ -22,6 +23,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ + @JsonProperty("_class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java index c3eff86cc82..ee4bb6ffcf0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Client.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Client { @@ -20,6 +21,7 @@ public class Client { * Get client * @return client **/ + @JsonProperty("client") public String getClient() { return client; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java index 80aaf8dcfdd..3cdf1f4adcb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Dog.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Dog extends Animal { @@ -21,6 +22,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ + @JsonProperty("breed") public String getBreed() { return breed; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java index 1a76571a267..3af69f2f844 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumArrays.java @@ -12,6 +12,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class EnumArrays { @@ -90,6 +91,7 @@ public static ArrayEnumEnum fromValue(String v) { * Get justSymbol * @return justSymbol **/ + @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -107,6 +109,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get arrayEnum * @return arrayEnum **/ + @JsonProperty("array_enum") public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java index 44199a514af..d573a77a98b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/EnumTest.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class EnumTest { @@ -126,6 +127,7 @@ public static EnumNumberEnum fromValue(String v) { * Get enumString * @return enumString **/ + @JsonProperty("enum_string") public EnumStringEnum getEnumString() { return enumString; } @@ -143,6 +145,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumInteger * @return enumInteger **/ + @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -160,6 +163,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumNumber * @return enumNumber **/ + @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -177,6 +181,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get outerEnum * @return outerEnum **/ + @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index bbb02c85253..1e90851cede 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -14,6 +14,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class FormatTest { @@ -50,6 +51,7 @@ public class FormatTest { * maximum: 100 * @return integer **/ + @JsonProperty("integer") @Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -69,6 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 200 * @return int32 **/ + @JsonProperty("int32") @Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -86,6 +89,7 @@ public FormatTest int32(Integer int32) { * Get int64 * @return int64 **/ + @JsonProperty("int64") public Long getInt64() { return int64; } @@ -105,6 +109,7 @@ public FormatTest int64(Long int64) { * maximum: 543.2 * @return number **/ + @JsonProperty("number") @NotNull @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; @@ -125,6 +130,7 @@ public FormatTest number(BigDecimal number) { * maximum: 987.6 * @return _float **/ + @JsonProperty("float") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -144,6 +150,7 @@ public FormatTest _float(Float _float) { * maximum: 123.4 * @return _double **/ + @JsonProperty("double") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -161,6 +168,7 @@ public FormatTest _double(Double _double) { * Get string * @return string **/ + @JsonProperty("string") @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -178,6 +186,7 @@ public FormatTest string(String string) { * Get _byte * @return _byte **/ + @JsonProperty("byte") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { return _byte; @@ -196,6 +205,7 @@ public FormatTest _byte(byte[] _byte) { * Get binary * @return binary **/ + @JsonProperty("binary") public byte[] getBinary() { return binary; } @@ -213,6 +223,7 @@ public FormatTest binary(byte[] binary) { * Get date * @return date **/ + @JsonProperty("date") @NotNull public LocalDate getDate() { return date; @@ -231,6 +242,7 @@ public FormatTest date(LocalDate date) { * Get dateTime * @return dateTime **/ + @JsonProperty("dateTime") public Date getDateTime() { return dateTime; } @@ -248,6 +260,7 @@ public FormatTest dateTime(Date dateTime) { * Get uuid * @return uuid **/ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -265,6 +278,7 @@ public FormatTest uuid(UUID uuid) { * Get password * @return password **/ + @JsonProperty("password") @NotNull @Size(min=10,max=64) public String getPassword() { return password; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 975088e5928..079686f4d3f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class HasOnlyReadOnly { @@ -22,6 +23,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ + @JsonProperty("bar") public String getBar() { return bar; } @@ -31,6 +33,7 @@ public String getBar() { * Get foo * @return foo **/ + @JsonProperty("foo") public String getFoo() { return foo; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java index 896bfc54829..cf29fcfb87d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MapTest.java @@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class MapTest { @@ -58,6 +59,7 @@ public static InnerEnum fromValue(String v) { * Get mapMapOfString * @return mapMapOfString **/ + @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { return mapMapOfString; } @@ -80,6 +82,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapOfEnumString * @return mapOfEnumString **/ + @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { return mapOfEnumString; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 51f18692f46..fa87343a7e6 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -16,6 +16,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class MixedPropertiesAndAdditionalPropertiesClass { @@ -30,6 +31,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ + @JsonProperty("uuid") public UUID getUuid() { return uuid; } @@ -47,6 +49,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get dateTime * @return dateTime **/ + @JsonProperty("dateTime") public Date getDateTime() { return dateTime; } @@ -64,6 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { * Get map * @return map **/ + @JsonProperty("map") public Map getMap() { return map; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java index 1f2a89db5d3..8fe54f0a258 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Model for testing model name starting with number") public class Model200Response { @@ -24,6 +25,7 @@ public class Model200Response { * Get name * @return name **/ + @JsonProperty("name") public Integer getName() { return name; } @@ -41,6 +43,7 @@ public Model200Response name(Integer name) { * Get propertyClass * @return propertyClass **/ + @JsonProperty("class") public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java index 536fecd5949..1b313aaa3a0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class ModelApiResponse { @@ -24,6 +25,7 @@ public class ModelApiResponse { * Get code * @return code **/ + @JsonProperty("code") public Integer getCode() { return code; } @@ -41,6 +43,7 @@ public ModelApiResponse code(Integer code) { * Get type * @return type **/ + @JsonProperty("type") public String getType() { return type; } @@ -58,6 +61,7 @@ public ModelApiResponse type(String type) { * Get message * @return message **/ + @JsonProperty("message") public String getMessage() { return message; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java index 3a56f9c8683..df4149c5d4d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Model for testing reserved words") public class ModelReturn { @@ -22,6 +23,7 @@ public class ModelReturn { * Get _return * @return _return **/ + @JsonProperty("return") public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java index d5edcadd585..47a8c83f2fb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; @ApiModel(description="Model for testing model name same as property name") public class Name { @@ -28,6 +29,7 @@ public class Name { * Get name * @return name **/ + @JsonProperty("name") @NotNull public Integer getName() { return name; @@ -46,6 +48,7 @@ public Name name(Integer name) { * Get snakeCase * @return snakeCase **/ + @JsonProperty("snake_case") public Integer getSnakeCase() { return snakeCase; } @@ -55,6 +58,7 @@ public Integer getSnakeCase() { * Get property * @return property **/ + @JsonProperty("property") public String getProperty() { return property; } @@ -72,6 +76,7 @@ public Name property(String property) { * Get _123Number * @return _123Number **/ + @JsonProperty("123Number") public Integer get123Number() { return _123Number; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java index 60e46381901..b6755c7a9a2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/NumberOnly.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class NumberOnly { @@ -21,6 +22,7 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ + @JsonProperty("JustNumber") public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index c479b33bc35..faf95343915 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Order { @@ -64,6 +65,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -81,6 +83,7 @@ public Order id(Long id) { * Get petId * @return petId **/ + @JsonProperty("petId") public Long getPetId() { return petId; } @@ -98,6 +101,7 @@ public Order petId(Long petId) { * Get quantity * @return quantity **/ + @JsonProperty("quantity") public Integer getQuantity() { return quantity; } @@ -115,6 +119,7 @@ public Order quantity(Integer quantity) { * Get shipDate * @return shipDate **/ + @JsonProperty("shipDate") public Date getShipDate() { return shipDate; } @@ -132,6 +137,7 @@ public Order shipDate(Date shipDate) { * Order Status * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } @@ -149,6 +155,7 @@ public Order status(StatusEnum status) { * Get complete * @return complete **/ + @JsonProperty("complete") public Boolean isComplete() { return complete; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java index 264121fb46d..82c7d8fa9d9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/OuterComposite.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class OuterComposite { @@ -25,6 +26,7 @@ public class OuterComposite { * Get myNumber * @return myNumber **/ + @JsonProperty("my_number") public BigDecimal getMyNumber() { return myNumber; } @@ -42,6 +44,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myString * @return myString **/ + @JsonProperty("my_string") public String getMyString() { return myString; } @@ -59,6 +62,7 @@ public OuterComposite myString(String myString) { * Get myBoolean * @return myBoolean **/ + @JsonProperty("my_boolean") public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 4d6215faf10..5db1a052b8f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -14,6 +14,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Pet { @@ -67,6 +68,7 @@ public static StatusEnum fromValue(String v) { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -84,6 +86,7 @@ public Pet id(Long id) { * Get category * @return category **/ + @JsonProperty("category") public Category getCategory() { return category; } @@ -101,6 +104,7 @@ public Pet category(Category category) { * Get name * @return name **/ + @JsonProperty("name") @NotNull public String getName() { return name; @@ -119,6 +123,7 @@ public Pet name(String name) { * Get photoUrls * @return photoUrls **/ + @JsonProperty("photoUrls") @NotNull public List getPhotoUrls() { return photoUrls; @@ -142,6 +147,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get tags * @return tags **/ + @JsonProperty("tags") public List getTags() { return tags; } @@ -164,6 +170,7 @@ public Pet addTagsItem(Tag tagsItem) { * pet status in the store * @return status **/ + @JsonProperty("status") public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java index f6868a7d344..d6c2527bc13 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class ReadOnlyFirst { @@ -22,6 +23,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ + @JsonProperty("bar") public String getBar() { return bar; } @@ -31,6 +33,7 @@ public String getBar() { * Get baz * @return baz **/ + @JsonProperty("baz") public String getBaz() { return baz; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java index ebf181b8db6..af734ec937d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/SpecialModelName.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class SpecialModelName { @@ -20,6 +21,7 @@ public class SpecialModelName { * Get specialPropertyName * @return specialPropertyName **/ + @JsonProperty("$special[property.name]") public Long getSpecialPropertyName() { return specialPropertyName; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java index 40cf3188aa7..77d43ac52eb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Tag.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class Tag { @@ -22,6 +23,7 @@ public class Tag { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -39,6 +41,7 @@ public Tag id(Long id) { * Get name * @return name **/ + @JsonProperty("name") public String getName() { return name; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index dd95f042ad1..54f54896d13 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; public class User { @@ -34,6 +35,7 @@ public class User { * Get id * @return id **/ + @JsonProperty("id") public Long getId() { return id; } @@ -51,6 +53,7 @@ public User id(Long id) { * Get username * @return username **/ + @JsonProperty("username") public String getUsername() { return username; } @@ -68,6 +71,7 @@ public User username(String username) { * Get firstName * @return firstName **/ + @JsonProperty("firstName") public String getFirstName() { return firstName; } @@ -85,6 +89,7 @@ public User firstName(String firstName) { * Get lastName * @return lastName **/ + @JsonProperty("lastName") public String getLastName() { return lastName; } @@ -102,6 +107,7 @@ public User lastName(String lastName) { * Get email * @return email **/ + @JsonProperty("email") public String getEmail() { return email; } @@ -119,6 +125,7 @@ public User email(String email) { * Get password * @return password **/ + @JsonProperty("password") public String getPassword() { return password; } @@ -136,6 +143,7 @@ public User password(String password) { * Get phone * @return phone **/ + @JsonProperty("phone") public String getPhone() { return phone; } @@ -153,6 +161,7 @@ public User phone(String phone) { * User Status * @return userStatus **/ + @JsonProperty("userStatus") public Integer getUserStatus() { return userStatus; } From 1d89ab6e08efb744ad54f4bf7a691a2591dc7fb1 Mon Sep 17 00:00:00 2001 From: Benjamin Gill Date: Thu, 19 Oct 2017 10:37:02 +0100 Subject: [PATCH 179/197] [New Generator] Rust API client/server generator (#6613) * Rust API client/server generator * `Future::boxed()` has been deprecated - replace with `Box::new(...)` * rebasing to rust * MMMLS211 use empty vec over none * MMMLS211 rebuild after merge from rust * MMMLS211 YAML array examples not wrapped in Some() * MMMLS211 Array parameters bad mustache fix * MMMLS211 don't parse map containers * MMMLS211 Tidy container types * MMMLS-211 rebuild example * MMMLS211 mvn rebuild * Percent-decode parameters contained in the path * Produce warnings when unknown fields are present We still accept unknown fields and discard them. However, to improve diagnosability, we now write a warning log and return a `Warning` header. Note that this is server-only * Markup * MMMLS211: Make optional arrays Options again * 211 markups * Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch * Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped * Fix rustfmt to the correct version * Fix rustfmt to the correct version * Add more response information to ApiError in client * Re-add missing brace * Code review markups * Allow converting out of wrapper types * Store arrays in new-types too * Use a new hyper_client every request * Add vec-like traits to array types * Xml support - new branch * Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted * MMSUB-172 Don't set Content-Type when there's no body. If we don't have a body we've serialized, then don't declare any content type for the nonexistent body. This is really important for 204 No Content responses, but it's also morally important for all other non-bodied responses. * MMSUB-172 Move to swagger 0.6. * Manually implement debug for the client * Allow `Context` to be bound to `Api`, and not passed on every function call * Support "." in parameter names * Support generate's "--reserved-words-mappings" option * Support "." in parameter names * Support generate's "--reserved-words-mappings" option --- README.md | 2 + bin/rust2-petstore.sh | 31 + .../java/io/swagger/codegen/CodegenModel.java | 1 - .../codegen/languages/Rust2Codegen.java | 963 +++++++ .../services/io.swagger.codegen.CodegenConfig | 1 + .../src/main/resources/rust2/Cargo.mustache | 34 + .../src/main/resources/rust2/README.mustache | 59 + .../src/main/resources/rust2/cargo-config | 18 + .../src/main/resources/rust2/client.mustache | 336 +++ .../src/main/resources/rust2/example-ca.pem | 17 + .../resources/rust2/example-client.mustache | 59 + .../resources/rust2/example-server-chain.pem | 66 + .../resources/rust2/example-server-key.pem | 28 + .../resources/rust2/example-server.mustache | 58 + .../rust2/example-server_lib.mustache | 31 + .../src/main/resources/rust2/gitignore | 2 + .../src/main/resources/rust2/lib.mustache | 96 + .../main/resources/rust2/mimetypes.mustache | 21 + .../src/main/resources/rust2/models.mustache | 175 ++ .../src/main/resources/rust2/server.mustache | 338 +++ .../src/main/resources/rust2/swagger.mustache | 1 + .../codegen/options/Rust2OptionsProvider.java | 22 + ...ith-fake-endpoints-models-for-testing.yaml | 34 +- samples/client/petstore/rust2/.cargo/config | 18 + samples/client/petstore/rust2/.gitignore | 2 + .../petstore/rust2/.swagger-codegen-ignore | 23 + .../petstore/rust2/.swagger-codegen/VERSION | 1 + samples/client/petstore/rust2/Cargo.toml | 34 + samples/client/petstore/rust2/README.md | 85 + .../client/petstore/rust2/api/swagger.yaml | 2020 +++++++++++++ samples/client/petstore/rust2/examples/ca.pem | 17 + .../client/petstore/rust2/examples/client.rs | 275 ++ .../petstore/rust2/examples/server-chain.pem | 66 + .../petstore/rust2/examples/server-key.pem | 28 + .../client/petstore/rust2/examples/server.rs | 58 + .../petstore/rust2/examples/server_lib/mod.rs | 279 ++ samples/client/petstore/rust2/src/client.rs | 1970 +++++++++++++ samples/client/petstore/rust2/src/lib.rs | 606 ++++ .../client/petstore/rust2/src/mimetypes.rs | 125 + samples/client/petstore/rust2/src/models.rs | 1136 ++++++++ samples/client/petstore/rust2/src/server.rs | 2518 +++++++++++++++++ 41 files changed, 11651 insertions(+), 3 deletions(-) create mode 100755 bin/rust2-petstore.sh create mode 100755 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java create mode 100644 modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/README.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/cargo-config create mode 100644 modules/swagger-codegen/src/main/resources/rust2/client.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-ca.pem create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-client.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-server.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/gitignore create mode 100644 modules/swagger-codegen/src/main/resources/rust2/lib.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache create mode 100755 modules/swagger-codegen/src/main/resources/rust2/models.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/server.mustache create mode 100644 modules/swagger-codegen/src/main/resources/rust2/swagger.mustache create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/options/Rust2OptionsProvider.java create mode 100644 samples/client/petstore/rust2/.cargo/config create mode 100644 samples/client/petstore/rust2/.gitignore create mode 100644 samples/client/petstore/rust2/.swagger-codegen-ignore create mode 100644 samples/client/petstore/rust2/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/rust2/Cargo.toml create mode 100644 samples/client/petstore/rust2/README.md create mode 100644 samples/client/petstore/rust2/api/swagger.yaml create mode 100644 samples/client/petstore/rust2/examples/ca.pem create mode 100644 samples/client/petstore/rust2/examples/client.rs create mode 100644 samples/client/petstore/rust2/examples/server-chain.pem create mode 100644 samples/client/petstore/rust2/examples/server-key.pem create mode 100644 samples/client/petstore/rust2/examples/server.rs create mode 100644 samples/client/petstore/rust2/examples/server_lib/mod.rs create mode 100644 samples/client/petstore/rust2/src/client.rs create mode 100644 samples/client/petstore/rust2/src/lib.rs create mode 100644 samples/client/petstore/rust2/src/mimetypes.rs create mode 100644 samples/client/petstore/rust2/src/models.rs create mode 100644 samples/client/petstore/rust2/src/server.rs diff --git a/README.md b/README.md index 96a9d2ad0ee..ed4a2870fb7 100644 --- a/README.md +++ b/README.md @@ -988,6 +988,7 @@ Here is a list of template creators: * PowerShell: @beatcracker * R: @ramnov * Rust: @farcaller + * Rust (rust-server): @metaswitch * Scala (scalaz & http4s): @tbrown1979 * Swift: @tkqubo * Swift 3: @hexelon @@ -1018,6 +1019,7 @@ Here is a list of template creators: * PHP Symfony: @ksm2 * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx + * Rust (rust-server): @metaswitch * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock diff --git a/bin/rust2-petstore.sh b/bin/rust2-petstore.sh new file mode 100755 index 00000000000..8428f974cdd --- /dev/null +++ b/bin/rust2-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/rust2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l rust2 -o samples/client/petstore/rust2 -DpackageName=petstore_api" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java index 76eccdfa039..7b8cf07c471 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java @@ -9,7 +9,6 @@ import io.swagger.models.ExternalDocs; - public class CodegenModel { public String parent, parentSchema; public List interfaces; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java new file mode 100755 index 00000000000..76f218aa50f --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java @@ -0,0 +1,963 @@ +package io.swagger.codegen.languages; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import io.swagger.codegen.*; +import io.swagger.models.*; +import io.swagger.models.parameters.BodyParameter; +import io.swagger.models.parameters.Parameter; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.*; +import io.swagger.util.Yaml; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.*; +import java.util.Map.Entry; +import org.apache.commons.lang3.StringUtils; + +public class Rust2Codegen extends DefaultCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(Rust2Codegen.class); + + private HashMap modelXmlNames = new HashMap(); + + protected String apiVersion = "1.0.0"; + protected int serverPort = 8080; + protected String projectName = "swagger-server"; + protected String apiPath = "rust2"; + protected String packageName; + protected String packageVersion; + protected String externCrateName; + + public Rust2Codegen() { + super(); + + // set the output folder here + outputFolder = "generated-code/rust2"; + + /* + * Models. You can write model files using the modelTemplateFiles map. + * if you want to create one template for file, you can do so here. + * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * a different extension + */ + modelTemplateFiles.clear(); + + /* + * 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.clear(); + + /* + * 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. + */ + embeddedTemplateDir = templateDir = "rust2"; + + /* + * Reserved words. Override this with reserved words specific to your language + */ + setReservedWordsLowerCase( + Arrays.asList( + // From https://doc.rust-lang.org/grammar.html#keywords + "abstract", "alignof", "as", "become", "box", "break", "const", + "continue", "crate", "do", "else", "enum", "extern", "false", + "final", "fn", "for", "if", "impl", "in", "let", "loop", "macro", + "match", "mod", "move", "mut", "offsetof", "override", "priv", + "proc", "pub", "pure", "ref", "return", "Self", "self", "sizeof", + "static", "struct", "super", "trait", "true", "type", "typeof", + "unsafe", "unsized", "use", "virtual", "where", "while", "yield" + ) + ); + + defaultIncludes = new HashSet( + Arrays.asList( + "map", + "array") + ); + + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "bool", + "char", + "i8", + "i16", + "i32", + "i64", + "u8", + "u16", + "u32", + "u64", + "isize", + "usize", + "f32", + "f64", + "str") + ); + + instantiationTypes.clear(); + instantiationTypes.put("array", "Vec"); + instantiationTypes.put("map", "Map"); + + typeMapping.clear(); + typeMapping.put("number", "f64"); + typeMapping.put("integer", "i32"); + typeMapping.put("long", "i64"); + typeMapping.put("float", "f32"); + typeMapping.put("double", "f64"); + typeMapping.put("string", "String"); + typeMapping.put("UUID", "uuid::Uuid"); + typeMapping.put("byte", "u8"); + typeMapping.put("ByteArray", "swagger::ByteArray"); + typeMapping.put("binary", "swagger::ByteArray"); + typeMapping.put("boolean", "bool"); + typeMapping.put("date", "chrono::DateTime"); + typeMapping.put("DateTime", "chrono::DateTime"); + typeMapping.put("password", "String"); + typeMapping.put("File", "Box, Error=Error> + Send>"); + typeMapping.put("file", "Box, Error=Error> + Send>"); + typeMapping.put("array", "Vec"); + typeMapping.put("map", "HashMap"); + + importMapping = new HashMap(); + + cliOptions.clear(); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, + "Rust crate name (convention: snake_case).") + .defaultValue("swagger_client")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, + "Rust crate version.") + .defaultValue("1.0.0")); + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + additionalProperties.put("serverPort", serverPort); + additionalProperties.put("apiPath", apiPath); + + /* + * 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("swagger.mustache", "api", "swagger.yaml")); + supportingFiles.add(new SupportingFile("Cargo.mustache", "", "Cargo.toml")); + supportingFiles.add(new SupportingFile("cargo-config", ".cargo", "config")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("lib.mustache", "src", "lib.rs")); + supportingFiles.add(new SupportingFile("models.mustache", "src", "models.rs")); + supportingFiles.add(new SupportingFile("server.mustache", "src", "server.rs")); + supportingFiles.add(new SupportingFile("client.mustache", "src", "client.rs")); + supportingFiles.add(new SupportingFile("mimetypes.mustache", "src", "mimetypes.rs")); + supportingFiles.add(new SupportingFile("example-server.mustache", "examples", "server.rs")); + supportingFiles.add(new SupportingFile("example-client.mustache", "examples", "client.rs")); + supportingFiles.add(new SupportingFile("example-server_lib.mustache", "examples/server_lib", "mod.rs")); + supportingFiles.add(new SupportingFile("example-ca.pem", "examples", "ca.pem")); + supportingFiles.add(new SupportingFile("example-server-chain.pem", "examples", "server-chain.pem")); + supportingFiles.add(new SupportingFile("example-server-key.pem", "examples", "server-key.pem")); + writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md")); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + else { + setPackageName("swagger_client"); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + else { + setPackageVersion("1.0.0"); + } + + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + additionalProperties.put("externCrateName", externCrateName); + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + + // Also set the extern crate name, which has any '-' replace with a '_'. + this.externCrateName = packageName.replace('-', '_'); + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + @Override + public String apiPackage() { + return apiPath; + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see io.swagger.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + /** + * 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 + */ + @Override + public String getName() { + return "rust2"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a Rust client/server library using the swagger-codegen project."; + } + + @Override + public void preprocessSwagger(Swagger swagger) { + Info info = swagger.getInfo(); + List versionComponents = new ArrayList(Arrays.asList(info.getVersion().split("[.]"))); + if (versionComponents.size() < 1) { + versionComponents.add("1"); + } + while (versionComponents.size() < 3) { + versionComponents.add("0"); + } + info.setVersion(StringUtils.join(versionComponents, ".")); + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "default"; + } + return underscore(name); + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reseved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; // add an underscore to the name + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); + } + + @Override + public String toModelName(String name) { + // camelize the model name + // phone_number => PhoneNumber + String camelizedName = camelize(toModelFilename(name)); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(camelizedName)) { + camelizedName = "Model" + camelizedName; + LOGGER.warn(camelizedName + " (reserved word) cannot be used as model name. Renamed to " + camelizedName); + } + + // model name starts with number + else if (name.matches("^\\d.*")) { + // e.g. 200Response => Model200Response (after camelize) + camelizedName = "Model" + camelizedName; + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelizedName); + } + + return camelizedName; + + } + + @Override + public String toParamName(String name) { + // should be the same as variable name (stolen from RubyClientCodegen) + return toVarName(name); + } + + @Override + public String toVarName(String name) { + String sanitizedName = super.sanitizeName(name); + // for reserved word or word starting with number, append _ + if (isReservedWord(sanitizedName) || sanitizedName.matches("^\\d.*")) { + sanitizedName = escapeReservedWord(sanitizedName); + } + + return underscore(sanitizedName); + } + + @Override + public String toOperationId(String operationId) { + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId))); + operationId = "call_" + operationId; + } + + return camelize(operationId); + } + + @Override + public String toModelFilename(String name) { + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } + + name = sanitizeName(name); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + return underscore(name); + } + + @Override + public String toEnumName(CodegenProperty property) { + return sanitizeName(camelize(property.name)) + "Enum"; + } + + @Override + public String toEnumVarName(String value, String datatype) { + String var = null; + if (value.length() == 0) { + var = "EMPTY"; + } + + // for symbol, e.g. $, # + else if (getSymbolName(value) != null) { + var = getSymbolName(value).toUpperCase(); + } + + // number + else if ("Integer".equals(datatype) || "Long".equals(datatype) || + "Float".equals(datatype) || "Double".equals(datatype)) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + var = varName; + } + + // string + var = value.replaceAll("\\W+", "_").toUpperCase(); + if (var.matches("\\d.*")) { + var = "_" + var; + } else { + var = sanitizeName(var); + } + return var; + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("Integer".equals(datatype) || "Long".equals(datatype) || + "Float".equals(datatype) || "Double".equals(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + + @Override + public String toApiFilename(String name) { + // replace - with _ e.g. created-at => created_at + 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); + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, Swagger swagger) { + CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, swagger); + op.vendorExtensions.put("operation_id", underscore(op.operationId)); + op.vendorExtensions.put("uppercase_operation_id", underscore(op.operationId).toUpperCase()); + op.vendorExtensions.put("path", op.path.replace("{", ":").replace("}", "")); + op.vendorExtensions.put("HttpMethod", Character.toUpperCase(op.httpMethod.charAt(0)) + op.httpMethod.substring(1).toLowerCase()); + op.vendorExtensions.put("httpmethod", op.httpMethod.toLowerCase()); + for (CodegenParameter param : op.allParams) { + String example = null; + + if (param.isString) { + if (param.dataFormat != null && param.dataFormat.equals("byte")) { + param.vendorExtensions.put("formatString", "\\\"{:?}\\\""); + example = "swagger::ByteArray(\"" + ((param.example != null) ? param.example : "") + "\".to_string().into_bytes())"; + } else { + param.vendorExtensions.put("formatString", "\\\"{}\\\""); + example = "\"" + ((param.example != null) ? param.example : "") + "\".to_string()"; + } + } else if (param.isPrimitiveType) { + if ((param.isByteArray) || + (param.isBinary)) { + // Binary primitive types don't implement `Display`. + param.vendorExtensions.put("formatString", "{:?}"); + example = "swagger::ByteArray(Vec::from(\"" + ((param.example != null) ? param.example : "") + "\"))"; + } else { + param.vendorExtensions.put("formatString", "{}"); + example = (param.example != null) ? param.example : ""; + } + } else if (param.isListContainer) { + param.vendorExtensions.put("formatString", "{:?}"); + example = (param.example != null) ? param.example : "&Vec::new()"; + } else if (param.isFile) { + param.vendorExtensions.put("formatString", "{:?}"); + op.vendorExtensions.put("hasFile", true); + additionalProperties.put("apiHasFile", true); + example = "Box::new(stream::once(Ok(b\"hello\".to_vec()))) as Box + Send>"; + } else { + param.vendorExtensions.put("formatString", "{:?}"); + if (param.example != null) { + example = "serde_json::from_str::<" + param.dataType + ">(\"" + param.example + "\").expect(\"Failed to parse JSON example\")"; + } + } + + if (param.required) { + if (example != null) { + param.vendorExtensions.put("example", example); + } else if (param.isListContainer) { + // Use the empty list if we don't have an example + param.vendorExtensions.put("example", "&Vec::new()"); + } + else { + // If we don't have an example that we can provide, we need to disable the client example, as it won't build. + param.vendorExtensions.put("example", "???"); + op.vendorExtensions.put("noClientExample", Boolean.TRUE); + } + } else if ((param.dataFormat != null)&&((param.dataFormat.equals("date-time")) || (param.dataFormat.equals("date")))) { + param.vendorExtensions.put("formatString", "{:?}"); + param.vendorExtensions.put("example", "None"); + } else { + // Not required, so override the format string and example + param.vendorExtensions.put("formatString", "{:?}"); + if (param.isFile) { + // Optional file types are wrapped in a future + param.vendorExtensions.put("example", (example != null) ? "Box::new(future::ok(Some(" + example + "))) as Box + Send>" : "None"); + } else { + param.vendorExtensions.put("example", (example != null) ? "Some(" + example + ")" : "None"); + } + } + } + + List consumes = new ArrayList(); + if (operation.getConsumes() != null) { + if (operation.getConsumes().size() > 0) { + // use consumes defined in the operation + consumes = operation.getConsumes(); + } + } else if (swagger != null && swagger.getConsumes() != null && swagger.getConsumes().size() > 0) { + // use consumes defined globally + consumes = swagger.getConsumes(); + LOGGER.debug("No consumes defined in operation. Using global consumes (" + swagger.getConsumes() + ") for " + op.operationId); + } + + boolean consumesXml = false; + // if "consumes" is defined (per operation or using global definition) + if (consumes != null && !consumes.isEmpty()) { + List> c = new ArrayList>(); + for (String key : consumes) { + Map mediaType = new HashMap(); + String mimeType = processMimeType(key); + + if (mimeType.startsWith("Application/Xml")) { + additionalProperties.put("usesXml", true); + consumesXml = true; + } + + mediaType.put("mediaType", mimeType); + c.add(mediaType); + } + op.consumes = c; + op.hasConsumes = true; + } + + List produces = new ArrayList(); + if (operation.getProduces() != null) { + if (operation.getProduces().size() > 0) { + // use produces defined in the operation + produces = operation.getProduces(); + } + } else if (swagger != null && swagger.getProduces() != null && swagger.getProduces().size() > 0) { + // use produces defined globally + produces = swagger.getProduces(); + LOGGER.debug("No produces defined in operation. Using global produces (" + swagger.getProduces() + ") for " + op.operationId); + } + + boolean producesXml = false; + if (produces != null && !produces.isEmpty()) { + List> c = new ArrayList>(); + for (String key : produces) { + Map mediaType = new HashMap(); + String mimeType = processMimeType(key); + + if (mimeType.startsWith("Application/Xml")) { + additionalProperties.put("usesXml", true); + producesXml = true; + } + + mediaType.put("mediaType", mimeType); + c.add(mediaType); + } + op.produces = c; + op.hasProduces = true; + } + + if (op.bodyParam != null) { + + if (paramHasXmlNamespace(op.bodyParam, definitions)){ + op.bodyParam.vendorExtensions.put("has_namespace", "true"); + } + for (String key : definitions.keySet()) { + op.bodyParam.vendorExtensions.put("model_key", key); + } + + op.bodyParam.vendorExtensions.put("uppercase_operation_id", underscore(op.operationId).toUpperCase()); + if (consumesXml) { + op.bodyParam.vendorExtensions.put("consumesXml", true); + } + + } + for (CodegenParameter param : op.bodyParams) { + + if (paramHasXmlNamespace(param, definitions)){ + param.vendorExtensions.put("has_namespace", "true"); + } + + param.vendorExtensions.put("uppercase_operation_id", underscore(op.operationId).toUpperCase()); + + if (consumesXml) { + param.vendorExtensions.put("consumesXml", true); + } + } + for (CodegenParameter param : op.headerParams) { + // Give header params a name in camel case. CodegenParameters don't have a nameInCamelCase property. + param.vendorExtensions.put("typeName", toModelName(param.baseName)); + } + for (CodegenResponse rsp : op.responses) { + rsp.message = camelize(rsp.message.split("[^A-Za-z ]")[0].replace(" ", "_")); + rsp.vendorExtensions.put("uppercase_operation_id", underscore(op.operationId).toUpperCase()); + rsp.vendorExtensions.put("uppercase_message", underscore(rsp.message).toUpperCase()); + if (rsp.dataType != null) { + rsp.vendorExtensions.put("uppercase_data_type", (rsp.dataType.replace("models::", "")).toUpperCase()); + + if (producesXml) { + rsp.vendorExtensions.put("producesXml", true); + } + + // Check whether we're returning an object with a defined XML namespace. + Object property = rsp.schema; + if ((property != null) && (property instanceof RefProperty)){ + + RefProperty refProperty = (RefProperty) property; + String refName = refProperty.get$ref(); + if (refName.indexOf("#/definitions/") == 0) { + refName = refName.substring("#/definitions/".length()); + } + + Model model = definitions.get(refName); + + if ((model != null) && (model instanceof ModelImpl)) { + Xml xml = ((ModelImpl) model).getXml(); + if ((xml != null) && (xml.getNamespace() != null)){ + rsp.vendorExtensions.put("has_namespace", "true"); + } + } + } + } + for (CodegenProperty header : rsp.headers) { + header.nameInCamelCase = toModelName(header.baseName); + } + } + for (CodegenProperty header : op.responseHeaders) { + header.nameInCamelCase = toModelName(header.baseName); + } + + return op; + } + + @Override + public boolean isDataTypeFile(final String dataType) { + return dataType != null && dataType.equals(typeMapping.get("File").toString()); + } + + @Override + public String getTypeDeclaration(Property p) { + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + String innerType = getTypeDeclaration(inner); + StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("array")).append("<"); + if (inner instanceof RefProperty) { + typeDeclaration.append("models::"); + } + typeDeclaration.append(innerType).append(">"); + return typeDeclaration.toString(); + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + String innerType = getTypeDeclaration(inner); + StringBuilder typeDeclaration = new StringBuilder(typeMapping.get("map")).append("<").append(typeMapping.get("string")).append(", "); + if (inner instanceof RefProperty) { + typeDeclaration.append("models::"); + } + typeDeclaration.append(innerType).append(">"); + return typeDeclaration.toString(); + } else if (p instanceof RefProperty) { + String datatype; + try { + RefProperty r = (RefProperty) p; + datatype = r.get$ref(); + if (datatype.indexOf("#/definitions/") == 0) { + datatype = toModelName(datatype.substring("#/definitions/".length())); + } + } catch (Exception e) { + LOGGER.warn("Error obtaining the datatype from RefProperty:" + p + ". Datatype default to Object"); + datatype = "Object"; + LOGGER.error(e.getMessage(), e); + } + return datatype; + } else if (p instanceof FileProperty) { + return typeMapping.get("File").toString(); + } + return super.getTypeDeclaration(p); + } + + @Override + public CodegenParameter fromParameter(Parameter param, Set imports) { + CodegenParameter parameter = super.fromParameter(param, imports); + if(param instanceof BodyParameter) { + BodyParameter bp = (BodyParameter) param; + Model model = bp.getSchema(); + if (model instanceof RefModel) { + String name = ((RefModel) model).getSimpleRef(); + name = toModelName(name); + // We need to be able to look up the model in the model definitions later. + parameter.vendorExtensions.put("uppercase_data_type", name.toUpperCase()); + + name = "models::" + getTypeDeclaration(name); + parameter.baseType = name; + parameter.dataType = name; + + String refName = ((RefModel) model).get$ref(); + if (refName.indexOf("#/definitions/") == 0) { + refName = refName.substring("#/definitions/".length()); + } + parameter.vendorExtensions.put("refName", refName); + + } else if (model instanceof ModelImpl) { + parameter.vendorExtensions.put("refName", ((ModelImpl) model).getName()); + } + } + return parameter; + } + + @Override + public CodegenProperty fromProperty(String name, Property p) { + CodegenProperty property = super.fromProperty(name, p); + if (p instanceof RefProperty) { + property.datatype = "models::" + property.datatype; + } + return property; + } + + @Override + public String toInstantiationType(Property p) { + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return instantiationTypes.get("array") + "<" + getSwaggerType(inner) + ">"; + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return instantiationTypes.get("map") + "<" + typeMapping.get("string") + ", " + getSwaggerType(inner) + ">"; + } else { + return null; + } + } + + @Override + public CodegenModel fromModel(String name, Model model) { + return fromModel(name, model, null); + } + + @Override + public CodegenModel fromModel(String name, Model model, Map allDefinitions) { + CodegenModel mdl = super.fromModel(name, model, allDefinitions); + mdl.vendorExtensions.put("upperCaseName", name.toUpperCase()); + if (model instanceof ModelImpl) { + ModelImpl modelImpl = (ModelImpl) model; + mdl.dataType = typeMapping.get(modelImpl.getType()); + } + if (model instanceof ArrayModel) { + ArrayModel am = (ArrayModel) model; + if ((am.getItems() != null) && + (am.getItems().getXml() != null)){ + + // If this model's items require wrapping in xml, squirrel + // away the xml name so we can insert it into the relevant model fields. + String xmlName = am.getItems().getXml().getName(); + if (xmlName != null) { + mdl.vendorExtensions.put("itemXmlName", xmlName); + modelXmlNames.put("models::" + mdl.classname, xmlName); + } + } + mdl.arrayModelType = toModelName(mdl.arrayModelType); + } + + if (mdl.xmlNamespace != null) { + additionalProperties.put("usesXmlNamespaces", true); + } + + return mdl; + } + + @Override + public Map postProcessAllModels(Map objs){ + Map newObjs = super.postProcessAllModels(objs); + + //Index all CodegenModels by model name. + HashMap allModels = new HashMap(); + for (Entry entry : objs.entrySet()) { + String modelName = toModelName(entry.getKey()); + Map inner = (Map) entry.getValue(); + List> models = (List>) inner.get("models"); + for (Map mo : models) { + CodegenModel cm = (CodegenModel) mo.get("model"); + allModels.put(modelName, cm); + } + } + + for (Entry entry : allModels.entrySet()){ + String modelName = entry.getKey(); + CodegenModel model = entry.getValue(); + + for(CodegenProperty prop : model.vars){ + String xmlName = modelXmlNames.get(prop.datatype); + if (xmlName != null){ + prop.vendorExtensions.put("itemXmlName", xmlName); + } + } + } + + return newObjs; + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + Swagger swagger = (Swagger)objs.get("swagger"); + if(swagger != null) { + try { + objs.put("swagger-yaml", Yaml.mapper().writeValueAsString(swagger)); + } catch (JsonProcessingException e) { + LOGGER.error(e.getMessage(), e); + } + } + return super.postProcessSupportingFileData(objs); + } + + @Override + public String toDefaultValue(Property p) { + if (p instanceof StringProperty) { + StringProperty dp = (StringProperty) p; + if (dp.getDefault() != null) { + return "\"" + dp.getDefault() + "\".to_string()"; + } + } else if (p instanceof BooleanProperty) { + BooleanProperty dp = (BooleanProperty) p; + if (dp.getDefault() != null) { + if (dp.getDefault().toString().equalsIgnoreCase("false")) + return "false"; + else + return "true"; + } + } else if (p instanceof DoubleProperty) { + DoubleProperty dp = (DoubleProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof FloatProperty) { + FloatProperty dp = (FloatProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof IntegerProperty) { + IntegerProperty dp = (IntegerProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } else if (p instanceof LongProperty) { + LongProperty dp = (LongProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + } + + return null; + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + if(!languageSpecificPrimitives.contains(property.datatype)) { + // If we use a more qualified model name, then only camelize the actual type, not the qualifier. + if(property.datatype.contains(":")) { + int position = property.datatype.lastIndexOf(":"); + property.datatype = property.datatype.substring(0, position) + camelize(property.datatype.substring(position)); + } else { + property.datatype = camelize(property.datatype, false); + } + } + + // Handle custom unsigned integer formats. + if ("integer".equals(property.baseType)) { + if ("uint32".equals(property.dataFormat)) { + property.datatype = "u32"; + } else if ("uint64".equals(property.dataFormat)) { + property.datatype = "u64"; + } + } + + property.name = underscore(property.name); + + if (!property.required) { + property.defaultValue = (property.defaultValue != null) ? "Some(" + property.defaultValue + ")" : "None"; + } + } + + @Override + public Map postProcessModels(Map objs) { + return super.postProcessModelsEnum(objs); + + } + + private boolean paramHasXmlNamespace(CodegenParameter param, Map definitions){ + Object refName = param.vendorExtensions.get("refName"); + + if ((refName != null) && (refName instanceof String)) { + String name = (String) refName; + Model model = definitions.get(name); + + if ((model != null) && (model instanceof ModelImpl)) { + Xml xml = ((ModelImpl) model).getXml(); + if ((xml != null) && (xml.getNamespace() != null)) { + return true; + } + } + } + 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/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 356c310e1df..c1cd7c72641 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 @@ -55,6 +55,7 @@ io.swagger.codegen.languages.RClientCodegen io.swagger.codegen.languages.Rails5ServerCodegen io.swagger.codegen.languages.RestbedCodegen io.swagger.codegen.languages.RubyClientCodegen +io.swagger.codegen.languages.Rust2Codegen io.swagger.codegen.languages.RustClientCodegen io.swagger.codegen.languages.ScalaClientCodegen io.swagger.codegen.languages.ScalatraServerCodegen diff --git a/modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache b/modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache new file mode 100644 index 00000000000..8cab22ff513 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache @@ -0,0 +1,34 @@ +[package] +name = "{{packageName}}" +version = "{{appVersion}}" +authors = [{{#infoEmail}}"{{infoEmail}}"{{/infoEmail}}] + +[features] +default = ["client", "server"] +client = ["serde_json", {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "hyper-openssl", "uuid"{{#apiHasFile}}, "multipart"{{/apiHasFile}}] +server = ["serde_json", {{#usesXml}}"serde-xml-rs", {{/usesXml}}"serde_ignored", "hyper", "iron", "router", "bodyparser", "urlencoded", "uuid"{{#apiHasFile}}, "multipart"{{/apiHasFile}}] + +[dependencies] +bodyparser = {version = "0.7", optional = true} +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.10", optional = true} +hyper-openssl = {version = "0.2", optional = true } +iron = {version = "0.5", optional = true} +lazy_static = "0.2" +log = "0.3.0" +multipart = {version = "0.13", optional = true} +router = {version = "0.5", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +swagger = "0.7" +urlencoded = {version = "0.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +{{#usesXml}}serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true}{{/usesXml}} + +[dev-dependencies] +clap = "2.25" diff --git a/modules/swagger-codegen/src/main/resources/rust2/README.mustache b/modules/swagger-codegen/src/main/resources/rust2/README.mustache new file mode 100644 index 00000000000..c790d7d68b0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/README.mustache @@ -0,0 +1,59 @@ +# Rust API for {{packageName}} + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Overview +This client/server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) + +- API version: {{appVersion}} +- Build date: {{generatedDate}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Examples + +Run examples with: + +``` +cargo run --example +``` + +To pass in arguments to the examples, put them after `--`, for example: + +``` +cargo run --example client -- --help +``` + +### Running the server +To run the server, follow these simple steps: + +``` +cargo run --example server +``` + +### Running a client +To run a client, follow one of the following simple steps: + +```{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +cargo run --example client {{operationId}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +``` + +### HTTPS +The examples can be run in HTTPS mode by passing in the flag `--https`, for example: + +``` +cargo run --example server -- --https +``` + +This will use the keys/certificates from the examples directory. Note that the server chain is signed with +`CN=localhost`. diff --git a/modules/swagger-codegen/src/main/resources/rust2/cargo-config b/modules/swagger-codegen/src/main/resources/rust2/cargo-config new file mode 100644 index 00000000000..b8acc9c00c8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/cargo-config @@ -0,0 +1,18 @@ +[build] +rustflags = [ + "-W", "missing_docs", # detects missing documentation for public members + + "-W", "trivial_casts", # detects trivial casts which could be removed + + "-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed + + "-W", "unsafe_code", # usage of `unsafe` code + + "-W", "unused_qualifications", # detects unnecessarily qualified names + + "-W", "unused_extern_crates", # extern crates that are never used + + "-W", "unused_import_braces", # unnecessary braces around an imported item + + "-D", "warnings", # all warnings should be denied +] diff --git a/modules/swagger-codegen/src/main/resources/rust2/client.mustache b/modules/swagger-codegen/src/main/resources/rust2/client.mustache new file mode 100644 index 00000000000..c168f502698 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/client.mustache @@ -0,0 +1,336 @@ +#![allow(unused_extern_crates)] +extern crate hyper_openssl; +extern crate chrono; +{{#apiHasFile}}extern crate multipart;{{/apiHasFile}} + +{{#apiHasFile}}use multipart::client::lazy::Multipart;{{/apiHasFile}} +use hyper; +use hyper::client::IntoUrl; +use hyper::mime; +use hyper::header::{Headers, ContentType}; +use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use hyper::Url; +use self::hyper_openssl::openssl; +use futures; +use futures::{Future, Stream}; +use futures::{future, stream}; +use std::borrow::Cow; +use std::io::{Read, Error}; +use std::error; +use std::fmt; +use std::path::Path; +use std::sync::Arc; +use std::str; + +use mimetypes; + +use serde_json; +{{#usesXml}}use serde_xml_rs;{{/usesXml}} + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; + +use swagger::{Context, ApiError, XSpanId}; + +use {Api{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, + {{operationId}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + }; +use models; + +/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. +fn into_base_path(input: T, correct_scheme: Option<&'static str>) -> Result { + // First convert to Url, since a base path is a subset of Url. + let url = input.into_url()?; + + let scheme = url.scheme(); + + // Check the scheme if necessary + if let Some(correct_scheme) = correct_scheme { + if scheme != correct_scheme { + return Err(ClientInitError::InvalidScheme); + } + } + + let host = url.host().ok_or_else(|| ClientInitError::MissingHost)?; + let port = url.port().map(|x| format!(":{}", x)).unwrap_or_default(); + Ok(format!("{}://{}{}", scheme, host, port)) +} + +/// A client that implements the API by making HTTP calls out to a server. +#[derive(Clone)] +pub struct Client { + base_path: String, + hyper_client: Arc hyper::client::Client + Sync + Send>, +} + +impl fmt::Debug for Client { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Client {{ base_path: {} }}", self.base_path) + } +} + +impl Client { + pub fn try_new_http(base_path: T) -> Result + where T: IntoUrl + { + Ok(Client { + base_path: into_base_path(base_path, Some("http"))?, + hyper_client: Arc::new(hyper::client::Client::new), + }) + } + + pub fn try_new_https(base_path: T, + ca_certificate: CA) + -> Result + where T: IntoUrl, + CA: AsRef + { + let ca_certificate = ca_certificate.as_ref().to_owned(); + + let https_hyper_client = move || { + // SSL implementation + let mut ssl = openssl::ssl::SslConnectorBuilder::new(openssl::ssl::SslMethod::tls()).unwrap(); + + // Server authentication + ssl.builder_mut().set_ca_file(ca_certificate.clone()).unwrap(); + + let ssl = hyper_openssl::OpensslClient::from(ssl.build()); + let connector = hyper::net::HttpsConnector::new(ssl); + hyper::client::Client::with_connector(connector) + }; + + Ok(Client { + base_path: into_base_path(base_path, Some("https"))?, + hyper_client: Arc::new(https_hyper_client), + }) + } + + pub fn try_new_https_mutual(base_path: T, + ca_certificate: CA, + client_key: K, + client_certificate: C) + -> Result + where T: IntoUrl, + CA: AsRef, + K: AsRef, + C: AsRef + { + let ca_certificate = ca_certificate.as_ref().to_owned(); + let client_key = client_key.as_ref().to_owned(); + let client_certificate = client_certificate.as_ref().to_owned(); + + let https_mutual_hyper_client = move || { + // SSL implementation + let mut ssl = openssl::ssl::SslConnectorBuilder::new(openssl::ssl::SslMethod::tls()).unwrap(); + + // Server authentication + ssl.builder_mut().set_ca_file(ca_certificate.clone()).unwrap(); + + // Client authentication + ssl.builder_mut().set_private_key_file(client_key.clone(), openssl::x509::X509_FILETYPE_PEM).unwrap(); + ssl.builder_mut().set_certificate_chain_file(client_certificate.clone()).unwrap(); + ssl.builder_mut().check_private_key().unwrap(); + + let ssl = hyper_openssl::OpensslClient::from(ssl.build()); + let connector = hyper::net::HttpsConnector::new(ssl); + hyper::client::Client::with_connector(connector) + }; + + Ok(Client { + base_path: into_base_path(base_path, Some("https"))?, + hyper_client: Arc::new(https_mutual_hyper_client) + }) + } + + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client. + /// + /// One should avoid relying on this function if possible, since it adds a dependency on the underlying transport + /// implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of + /// code generality, which may make it harder to move the application to a serverless environment, for example. + /// + /// The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. + /// This is not a recommended way to write new tests. If other reasons are found for using this function, they + /// should be mentioned here. + pub fn try_new_with_hyper_client(base_path: T, + hyper_client: Arc hyper::client::Client + Sync + Send>) + -> Result + where T: IntoUrl + { + Ok(Client { + base_path: into_base_path(base_path, None)?, + hyper_client: hyper_client + }) + } +} + +impl Api for Client { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} + fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, param_{{paramName}}: {{^required}}{{#isFile}}Box{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &Context) -> Box + Send> { +{{#queryParams}}{{#-first}} + // Query parameters +{{/-first}}{{#required}} let query_{{paramName}} = format!("{{baseName}}={{=<% %>=}}{<% paramName %>}<%={{ }}=%>&", {{paramName}}=param_{{paramName}}{{#isListContainer}}.join(","){{/isListContainer}}{{^isListContainer}}.to_string(){{/isListContainer}}); +{{/required}}{{^required}} let query_{{paramName}} = param_{{paramName}}.map_or_else(String::new, |query| format!("{{baseName}}={{=<% %>=}}{<% paramName %>}<%={{ }}=%>&", {{paramName}}=query{{#isListContainer}}.join(","){{/isListContainer}}{{^isListContainer}}.to_string(){{/isListContainer}})); +{{/required}}{{/queryParams}} + + let url = format!("{}{{basePathWithoutHost}}{{path}}?{{#queryParams}}{{=<% %>=}}{<% paramName %>}<%={{ }}=%>{{/queryParams}}", self.base_path{{#pathParams}}, {{baseName}}=param_{{paramName}}.to_string(){{/pathParams}}{{#queryParams}}, {{paramName}}=query_{{paramName}}{{/queryParams}}); + +{{#vendorExtensions}}{{#hasFile}} // Form data body + let mut multipart = Multipart::new();{{/hasFile}}{{/vendorExtensions}}{{#formParams}}{{#isFile}} + +{{^required}} if let Ok(Some(param_{{paramName}})) = param_{{paramName}}.wait() { {{/required}} +{{^required}} {{/required}} match convert_stream_to_string(param_{{paramName}}) { +{{^required}} {{/required}} Ok(param_{{paramName}}) => { + // Add file to multipart form. + multipart.add_text("{{paramName}}", param_{{paramName}}); + }, +{{^required}} {{/required}} Err(err) => return Box::new(futures::done(Err(err))), +{{^required}} {{/required}} } + {{^required}}}{{/required}}{{/isFile}}{{/formParams}}{{#vendorExtensions}}{{#hasFile}} + + let mut fields = match multipart.prepare() { + Ok(fields) => fields, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))), + }; + + let mut body_string = String::new(); + let body = fields.to_body().read_to_string(&mut body_string); + let boundary = fields.boundary(); + let multipart_header = Mime(TopLevel::Multipart, SubLevel::FormData, vec![(Attr::Boundary, Value::Ext(boundary.to_string()))]);{{/hasFile}}{{/vendorExtensions}}{{#bodyParam}}{{#-first}} + // Body parameter +{{/-first}}{{#required}}{{#vendorExtensions}}{{#consumesXml}} +{{^has_namespace}} let body = serde_xml_rs::to_string(¶m_{{paramName}}).expect("impossible to fail to serialize");{{/has_namespace}}{{#has_namespace}} + let mut namespaces = BTreeMap::new(); + // An empty string is used to indicate a global namespace in xmltree. + namespaces.insert("".to_string(), models::namespaces::{{uppercase_data_type}}.clone()); + let body = serde_xml_rs::to_string_with_namespaces(¶m_{{paramName}}, namespaces).expect("impossible to fail to serialize");{{/has_namespace}}{{/consumesXml}}{{^consumesXml}} + let body = serde_json::to_string(¶m_{{paramName}}).expect("impossible to fail to serialize");{{/consumesXml}}{{/vendorExtensions}} +{{/required}}{{^required}} let body = param_{{paramName}}.map(|ref body| { +{{#vendorExtensions}}{{#consumesXml}} +{{^has_namespace}} serde_xml_rs::to_string(body).expect("impossible to fail to serialize"){{/has_namespace}}{{#has_namespace}} + let mut namespaces = BTreeMap::new(); + // An empty string is used to indicate a global namespace in xmltree. + namespaces.insert("".to_string(), models::namespaces::{{uppercase_data_type}}.clone()); + serde_xml_rs::to_string_with_namespaces(body, namespaces).expect("impossible to fail to serialize"){{/has_namespace}}{{/consumesXml}}{{^consumesXml}} + serde_json::to_string(body).expect("impossible to fail to serialize"){{/consumesXml}}{{/vendorExtensions}} + });{{/required}}{{/bodyParam}} + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::{{#vendorExtensions}}{{HttpMethod}}{{/vendorExtensions}}, &url); + let mut custom_headers = hyper::header::Headers::new(); + +{{#bodyParam}}{{#required}} let request = request.body(&body); +{{/required}}{{^required}} let request = match body { + Some(ref body) => request.body(body), + None => request, + }; +{{/required}} + + custom_headers.set(ContentType(mimetypes::requests::{{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}.clone())); +{{/bodyParam}} + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); +{{#headerParams}}{{#-first}} + // Header parameters +{{/-first}}{{^isMapContainer}} header! { (Request{{vendorExtensions.typeName}}, "{{baseName}}") => {{#isListContainer}}({{{baseType}}})*{{/isListContainer}}{{^isListContainer}}[{{{dataType}}}]{{/isListContainer}} } +{{#required}} custom_headers.set(Request{{vendorExtensions.typeName}}(param_{{paramName}}{{#isListContainer}}.clone(){{/isListContainer}})); +{{/required}}{{^required}} param_{{paramName}}.map(|header| custom_headers.set(Request{{vendorExtensions.typeName}}(header{{#isListContainer}}.clone(){{/isListContainer}}))); +{{/required}}{{/isMapContainer}}{{#isMapContainer}} let param_{{paramName}}: Option<{{{dataType}}}> = None; +{{/isMapContainer}}{{/headerParams}} + + let request = request.headers(custom_headers);{{#vendorExtensions}}{{#hasFile}} + let request = request.header(ContentType(multipart_header)) + .body(&body_string); +{{/hasFile}}{{/vendorExtensions}} + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result<{{operationId}}Response, ApiError> { + match response.status.to_u16() { +{{#responses}} + {{code}} => { +{{#dataType}}{{^isFile}} let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;{{#vendorExtensions}}{{#producesXml}} + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::<{{{dataType}}}>(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?;{{/producesXml}}{{^producesXml}} + let body = serde_json::from_str::<{{{dataType}}}>(&buf)?; +{{/producesXml}}{{/vendorExtensions}}{{/isFile}}{{#isFile}} let mut buf = Vec::new(); + response.read_to_end(&mut buf).map_err(|e| ApiError(format!("Received error reading response: {}", e)))?; + let body = Box::new(stream::once(Ok(buf)));{{/isFile}} +{{/dataType}} + +{{#headers}} header! { (Response{{nameInCamelCase}}, "{{baseName}}") => [{{{datatype}}}] } + let response_{{name}} = response.headers.get::().ok_or_else(|| "Required response header {{baseName}} for response {{code}} was not found.")?; +{{/headers}} + +{{#dataType}} Ok({{operationId}}Response::{{message}}{{^headers}}(body){{/headers}}{{#headers}}{{#-first}}{ body: body, {{/-first}}{{name}}: response_{{name}}.0.clone(){{^-last}}, {{/-last}}{{#-last}} }{{/-last}}{{/headers}}) +{{/dataType}}{{^dataType}} Ok({{operationId}}Response::{{message}}{{#headers}}{{#-first}}{ {{/-first}}{{^-first}}, {{/-first}}{{name}}: response_{{name}}.0.clone(){{#-last}} }{{/-last}}{{/headers}}) +{{/dataType}} + }, +{{/responses}} + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + }{{#vendorExtensions}}{{#hasFile}} + + // Helper function to convert a Stream into a String. The String can then be used to build the HTTP body. + fn convert_stream_to_string(stream: Box, Error=Error> + Send>) -> Result { + + stream.fold(Vec::new(), |mut body, chunk| { + body.extend(chunk.iter()); + future::ok::,Error>(body) + }).wait() + .map_err(|e| ApiError(format!("Unable to fold stream: {}", e))) + .and_then(|body| String::from_utf8(body) + .map_err(|e| ApiError(format!("Failed to convert utf8 stream to String: {}", e)))) + }{{/hasFile}}{{/vendorExtensions}} + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +#[derive(Debug)] +pub enum ClientInitError { + InvalidScheme, + InvalidUrl(hyper::error::ParseError), + MissingHost, + SslError(openssl::error::ErrorStack) +} + +impl From for ClientInitError { + fn from(err: hyper::error::ParseError) -> ClientInitError { + ClientInitError::InvalidUrl(err) + } +} + +impl From for ClientInitError { + fn from(err: openssl::error::ErrorStack) -> ClientInitError { + ClientInitError::SslError(err) + } +} + +impl fmt::Display for ClientInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + (self as &fmt::Debug).fmt(f) + } +} + +impl error::Error for ClientInitError { + fn description(&self) -> &str { + "Failed to produce a hyper client." + } +} diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-ca.pem b/modules/swagger-codegen/src/main/resources/rust2/example-ca.pem new file mode 100644 index 00000000000..d2317fb5db7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-ca.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICtjCCAZ4CCQDpKecRERZ0xDANBgkqhkiG9w0BAQsFADAdMQswCQYDVQQGEwJV +UzEOMAwGA1UEAxMFTXkgQ0EwHhcNMTcwNTIzMTYwMDIzWhcNMTcwNjIyMTYwMDIz +WjAdMQswCQYDVQQGEwJVUzEOMAwGA1UEAxMFTXkgQ0EwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCt66py3x7sCSASRF2D05L5wkNDxAUjQKYx23W8Gbwv +GMGykk89BIdU5LX1JB1cKiUOkoIxfwAYuWc2V/wzTvVV7+11besnk3uX1c9KiqUF +LIX7kn/z5hzS4aelhKvH+MJlSZCSlp1ytpZbwo5GB5Pi2SGH56jDBiBoDRNBVdWL +z4wH7TdrQjqWwNxIZumD5OGMtcfJyuX08iPiEOaslOeoMqzObhvjc9aUgjVjhqyA +FkJGTXsi0oaD7oml+NE+mTNfEeZvEJQpLSjBY0OvQHzuHkyGBShBnfu/9x7/NRwd +WaqsLiF7/re9KDGYdJwP7Cu6uxYfKAyWarp6h2mG/GIdAgMBAAEwDQYJKoZIhvcN +AQELBQADggEBAGIl/VVIafeq/AJOQ9r7TzzB2ABJYr7NZa6bTu5O1jSp1Fonac15 +SZ8gvRxODgH22ZYSqghPG4xzq4J3hkytlQqm57ZEt2I2M3OqIp17Ndcc1xDYzpLl +tA0FrVn6crQTM8vQkTDtGesaCWX+7Fir5dK7HnYWzfpSmsOpST07PfbNisEXKOxG +Dj4lBL1OnhTjsJeymVS1pFvkKkrcEJO+IxFiHL3CDsWjcXB0Z+E1zBtPoYyYsNsO +rBrjUxcZewF4xqWZhpW90Mt61fY2nRgU0uUwHcvDQUqvmzKcsqYa4mPKzfBI5mxo +01Ta96cDD6pS5Y1hOflZ0g84f2g/7xBLLDA= +-----END CERTIFICATE----- diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-client.mustache b/modules/swagger-codegen/src/main/resources/rust2/example-client.mustache new file mode 100644 index 00000000000..2d76fcb47d4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-client.mustache @@ -0,0 +1,59 @@ +#![allow(missing_docs, unused_variables, trivial_casts)] + +extern crate {{externCrateName}}; +#[allow(unused_extern_crates)] +extern crate futures; +#[allow(unused_extern_crates)] +extern crate swagger; +#[allow(unused_extern_crates)] +extern crate uuid; +extern crate clap; + +#[allow(unused_imports)] +use futures::{Future, future, Stream, stream}; +#[allow(unused_imports)] +use {{externCrateName}}::{ApiNoContext, ContextWrapperExt, + ApiError{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, + {{operationId}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + }; +use clap::{App, Arg}; + +fn main() { + let matches = App::new("client") + .arg(Arg::with_name("operation") + .help("Sets the operation to run") + .possible_values(&[ +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#vendorExtensions}}{{^noClientExample}} "{{operationId}}", +{{/noClientExample}}{{/vendorExtensions}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}]) + .required(true) + .index(1)) + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let client = if matches.is_present("https") { + // Using Simple HTTPS + {{externCrateName}}::Client::try_new_https("https://localhost:{{serverPort}}", "examples/ca.pem").expect("Failed to create HTTPS client") + } else { + // Using HTTP + {{externCrateName}}::Client::try_new_http("http://localhost:{{serverPort}}").expect("Failed to create HTTP client") + }; + + // Using a non-default `Context` is not required; this is just an example! + let client = client.with_context({{externCrateName}}::Context::new_with_span_id(self::uuid::Uuid::new_v4().to_string())); + + match matches.value_of("operation") { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} + {{#vendorExtensions}}{{#noClientExample}}// Disabled because there's no example. + // {{/noClientExample}}Some("{{operationId}}") => { + {{#noClientExample}}// {{/noClientExample}} let result = client.{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{^-first}}, {{/-first}}{{#vendorExtensions}}{{{example}}}{{/vendorExtensions}}{{/allParams}}).wait(); + {{#vendorExtensions}}{{#noClientExample}}// {{/noClientExample}}{{/vendorExtensions}} println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + {{#vendorExtensions}}{{#noClientExample}}// {{/noClientExample}}{{/vendorExtensions}} }, +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + _ => { + panic!("Invalid operation provided") + } + } +} + diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem b/modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem new file mode 100644 index 00000000000..47d7e201404 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, CN=My CA + Validity + Not Before: May 23 16:00:23 2017 GMT + Not After : Apr 29 16:00:23 2117 GMT + Subject: CN=localhost, C=US + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c9:d4:43:60:50:fc:d6:0f:38:4d:5d:5e:aa:7c: + c0:5e:a9:ec:d9:93:78:d3:93:72:28:41:f5:08:a5: + ea:ac:67:07:d7:1f:f7:7d:74:69:7e:46:89:20:4b: + 7a:2d:9b:02:08:e7:6f:0f:1d:0c:0f:c7:60:69:19: + 4b:df:7e:ca:75:94:0b:49:71:e3:6d:f2:e8:79:fd: + ed:0a:94:67:55:f3:ca:6b:61:ba:58:b7:2e:dd:7b: + ca:b9:02:9f:24:36:ac:26:8f:04:8f:81:c8:35:10: + f4:aa:33:b2:24:16:f8:f7:1e:ea:f7:16:fe:fa:34: + c3:dd:bb:2c:ba:7a:df:4d:e2:da:1e:e5:d2:28:44: + 6e:c8:96:e0:fd:09:0c:14:0c:31:dc:e0:ca:c1:a7: + 9b:bf:16:8c:f7:36:3f:1b:2e:dd:90:eb:45:78:51: + bf:59:22:1e:c6:8c:0a:69:88:e5:03:5e:73:b7:fc: + 93:7f:1b:46:1b:97:68:c5:c0:8b:35:1f:bb:1e:67: + 7f:55:b7:3b:55:3f:ea:f2:ca:db:cc:52:cd:16:89: + db:15:47:bd:f2:cd:6c:7a:d7:b4:1a:ac:c8:15:6c: + 6a:fb:77:c4:e9:f2:30:e0:14:24:66:65:6f:2a:e5: + 2d:cc:f6:81:ae:57:c8:d1:9b:38:90:dc:60:93:02: + 5e:cb + Exponent: 65537 (0x10001) + Signature Algorithm: sha256WithRSAEncryption + 1c:7c:39:e8:3d:49:b2:09:1e:68:5a:2f:74:18:f4:63:b5:8c: + f6:e6:a1:e3:4d:95:90:99:ef:32:5c:34:40:e8:55:13:0e:e0: + 1c:be:cd:ab:3f:64:38:99:5e:2b:c1:81:53:a0:18:a8:f6:ee: + 6a:33:73:6c:9a:73:9d:86:08:5d:c7:11:38:46:4c:cd:a0:47: + 37:8f:fe:a6:50:a9:02:21:99:42:86:5e:47:fe:65:56:60:1d: + 16:53:86:bd:e4:63:c5:69:cf:fa:30:51:ab:a1:c3:50:53:cc: + 66:1c:4c:ff:3f:2a:39:4d:a2:8f:9d:d1:a7:8b:22:e4:78:69: + 24:06:83:4d:cc:0a:c0:87:69:9b:bc:80:a9:d2:b7:a5:23:84: + 7e:a2:32:26:7c:78:0e:bd:db:cd:3b:69:18:33:b8:44:ef:96: + b4:99:86:ee:06:bd:51:1c:c7:a1:a4:0c:c4:4c:51:a0:df:ac: + 14:07:88:8e:d7:39:45:fe:52:e0:a3:4c:db:5d:7a:ab:4d:e4: + ca:06:e8:bd:74:6f:46:e7:93:4a:4f:1b:67:e7:a5:9f:ef:9c: + 02:49:d1:f2:d5:e9:53:ee:09:21:ac:08:c8:15:f7:af:35:b9: + 4f:11:0f:43:ae:46:8e:fd:5b:8d:a3:4e:a7:2c:b7:25:ed:e4: + e5:94:1d:e3 +-----BEGIN CERTIFICATE----- +MIICtTCCAZ0CAhAAMA0GCSqGSIb3DQEBCwUAMB0xCzAJBgNVBAYTAlVTMQ4wDAYD +VQQDEwVNeSBDQTAgFw0xNzA1MjMxNjAwMjNaGA8yMTE3MDQyOTE2MDAyM1owITES +MBAGA1UEAxMJbG9jYWxob3N0MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMnUQ2BQ/NYPOE1dXqp8wF6p7NmTeNOTcihB9Qil6qxn +B9cf9310aX5GiSBLei2bAgjnbw8dDA/HYGkZS99+ynWUC0lx423y6Hn97QqUZ1Xz +ymthuli3Lt17yrkCnyQ2rCaPBI+ByDUQ9KozsiQW+Pce6vcW/vo0w927LLp6303i +2h7l0ihEbsiW4P0JDBQMMdzgysGnm78WjPc2Pxsu3ZDrRXhRv1kiHsaMCmmI5QNe +c7f8k38bRhuXaMXAizUfux5nf1W3O1U/6vLK28xSzRaJ2xVHvfLNbHrXtBqsyBVs +avt3xOnyMOAUJGZlbyrlLcz2ga5XyNGbOJDcYJMCXssCAwEAATANBgkqhkiG9w0B +AQsFAAOCAQEAHHw56D1JsgkeaFovdBj0Y7WM9uah402VkJnvMlw0QOhVEw7gHL7N +qz9kOJleK8GBU6AYqPbuajNzbJpznYYIXccROEZMzaBHN4/+plCpAiGZQoZeR/5l +VmAdFlOGveRjxWnP+jBRq6HDUFPMZhxM/z8qOU2ij53Rp4si5HhpJAaDTcwKwIdp +m7yAqdK3pSOEfqIyJnx4Dr3bzTtpGDO4RO+WtJmG7ga9URzHoaQMxExRoN+sFAeI +jtc5Rf5S4KNM2116q03kygbovXRvRueTSk8bZ+eln++cAknR8tXpU+4JIawIyBX3 +rzW5TxEPQ65Gjv1bjaNOpyy3Je3k5ZQd4w== +-----END CERTIFICATE----- diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem b/modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem new file mode 100644 index 00000000000..29c00682922 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ1ENgUPzWDzhN +XV6qfMBeqezZk3jTk3IoQfUIpeqsZwfXH/d9dGl+RokgS3otmwII528PHQwPx2Bp +GUvffsp1lAtJceNt8uh5/e0KlGdV88prYbpYty7de8q5Ap8kNqwmjwSPgcg1EPSq +M7IkFvj3Hur3Fv76NMPduyy6et9N4toe5dIoRG7IluD9CQwUDDHc4MrBp5u/Foz3 +Nj8bLt2Q60V4Ub9ZIh7GjAppiOUDXnO3/JN/G0Ybl2jFwIs1H7seZ39VtztVP+ry +ytvMUs0WidsVR73yzWx617QarMgVbGr7d8Tp8jDgFCRmZW8q5S3M9oGuV8jRmziQ +3GCTAl7LAgMBAAECggEBAKEd1q9j14KWYc64s6KLthGbutyxsinMMbxbct11fdIk +6YhdF3fJ35ETg9IJDr6rWEN9ZRX+jStncNpVfFEs6ThVd3Eo/nI+EEGaaIkikR93 +X2a7fEPn7/yVHu70XdBN6L1bPDvHUeiy4W2hmRrgT90OjGm1rNRWHOm7yugOwIZu +HclzbR9Ca7EInFnotUiDQm9sw9VKHbJHqWx6OORdZrxR2ytYs0Qkq0XpGMvti2HW +7WAmKTg5QM8myXW7+/4iqb/u68wVBR2BBalShKmIf7lim9O3W2a1RjDdsvm/wNe9 +I+D+Iq825vpqkKXcrxYlpVg7hYiaQaW/MNsEb7lQRjECgYEA/RJYby0POW+/k0Jn +jO8UmJVEMiuGa8WIUu/JJWMOmzRCukjSRNQOkt7niQrZPJYE8W6clM6RJTolWf9L +IL6mIb+mRaoudUk8SHGDq7ho1iMg9GK8lhYxvKh1Q6uv8EyVSkgLknAEY0NANKC1 +zNdU5Dhven9aRX2gq9vP4XwMz2MCgYEAzCogQ7IFk+gkp3k491dOZnrGRoRCfuzo +4CJtyKFgOSd7BjmpcKkj0IPfVBjw6GjMIxfQRMTQmxAjjWevH45vG8l0Iiwz/gSp +81b5nsDEX5uv2Olcmcz5zxRFy36jOZ9ihMWinxcIlT2oDbyCdbruDKZq9ieJ9S8g +4qGx0OkwE3kCgYEA7CmAiU89U9YqqttfEq/RQoqY91CSwmO10d+ej9seuEtOsdRf +FIfnibulycdr7hP5TOxyBpO1802NqayJiWcgVYIpQf2MGTtcnCYCP+95NcvWZvj1 +EAJqK6nwtFO1fcOZ1ZXh5qfOEGujsPkAbsXLnKXlsiTCMvMHSxl3pu5Cbg0CgYBf +JjbZNctRrjv+7Qj2hPLd4dQsIxGWc7ToWENP4J2mpVa5hQAJqFovoHXhjKohtk2F +AWEn243Y5oGbMjo0e74edhmwn2cvuF64MM2vBem/ISCn98IXT6cQskMA3qkVfsl8 +VVs/x41ReGWs2TD3y0GMFbb9t1mdMfSiincDhNnKCQKBgGfeT4jKyYeCoCw4OLI1 +G75Gd0METt/IkppwODPpNwj3Rp9I5jctWZFA/3wCX/zk0HgBeou5AFNS4nQZ/X/L +L9axbSdR7UJTGkT1r4gu3rLkPV4Tk+8XM03/JT2cofMlzQBuhvl1Pn4SgKowz7hl +lS76ECw4Av3T0S34VW9Z5oye +-----END PRIVATE KEY----- diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server.mustache b/modules/swagger-codegen/src/main/resources/rust2/example-server.mustache new file mode 100644 index 00000000000..7da74ee26e7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-server.mustache @@ -0,0 +1,58 @@ +#![allow(missing_docs)] + +extern crate {{externCrateName}}; +extern crate iron; +extern crate futures; +extern crate hyper_openssl; +extern crate clap; +extern crate swagger; + +use hyper_openssl::OpensslServer; +use hyper_openssl::openssl::x509::X509_FILETYPE_PEM; +use hyper_openssl::openssl::ssl::{SslAcceptorBuilder, SslMethod}; +use hyper_openssl::openssl::error::ErrorStack; +use clap::{App, Arg}; +use iron::{Iron, Chain}; +use swagger::auth::AllowAllMiddleware; + +// Import the module that defines the Server struct. +mod server_lib; + +/// Builds an SSL implementation for Simple HTTPS from some hard-coded file names +fn ssl() -> Result { + let mut ssl = SslAcceptorBuilder::mozilla_intermediate_raw(SslMethod::tls())?; + + // Server authentication + ssl.builder_mut().set_private_key_file("examples/server-key.pem", X509_FILETYPE_PEM)?; + ssl.builder_mut().set_certificate_chain_file("examples/server-chain.pem")?; + ssl.builder_mut().check_private_key()?; + + Ok(OpensslServer::from(ssl.build())) +} + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +fn main() { + let matches = App::new("server") + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let server = server_lib::Server{}; + let router = {{externCrateName}}::router(server); + + let mut chain = Chain::new(router); + chain.link_before({{externCrateName}}::server::ExtractAuthData); + // add authentication middlewares into the chain here + // for the purpose of this example, pretend we have authenticated a user + chain.link_before(AllowAllMiddleware::new("cosmo")); + + if matches.is_present("https") { + // Using Simple HTTPS + Iron::new(chain).https("localhost:{{serverPort}}", ssl().expect("Failed to load SSL keys")).expect("Failed to start HTTPS server"); + } else { + // Using HTTP + Iron::new(chain).http("localhost:{{serverPort}}").expect("Failed to start HTTP server"); + } +} diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache b/modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache new file mode 100644 index 00000000000..b9288a38cc8 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache @@ -0,0 +1,31 @@ +#![allow(missing_docs, unused_extern_crates)] +extern crate chrono; +extern crate swagger; + +use futures::{self, Future}; +{{#apiHasFile}}use futures::Stream;{{/apiHasFile}} + +#[allow(unused_imports)] +use std::collections::HashMap; +{{#apiHasFile}}use std::io::Error;{{/apiHasFile}} + +use {{externCrateName}}::{Api, ApiError, Context{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, + {{operationId}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +}; +#[allow(unused_imports)] +use {{externCrateName}}::models; + +#[derive(Copy, Clone)] +pub struct Server; + +impl Api for Server { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +{{#summary}} /// {{{summary}}}{{/summary}} + fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{^isFile}}{{#vendorExtensions}}{{{formatString}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/isFile}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}{{^isFile}}, {{paramName}}{{/isFile}}{{/allParams}}, context.x_span_id.unwrap_or(String::from("")).clone());{{#allParams}}{{#isFile}} + let _ = {{paramName}}; //Suppresses unused param warning{{/isFile}}{{/allParams}} + Box::new(futures::failed("Generic failure".into())) + } +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} diff --git a/modules/swagger-codegen/src/main/resources/rust2/gitignore b/modules/swagger-codegen/src/main/resources/rust2/gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/modules/swagger-codegen/src/main/resources/rust2/lib.mustache b/modules/swagger-codegen/src/main/resources/rust2/lib.mustache new file mode 100644 index 00000000000..2c913125401 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/lib.mustache @@ -0,0 +1,96 @@ +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; +{{#usesXml}}extern crate serde_xml_rs;{{/usesXml}} +extern crate futures; +extern crate chrono; +{{#apiHasFile}}extern crate multipart;{{/apiHasFile}} +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; + +// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. +#[cfg(any(feature = "client", feature = "server"))] +#[macro_use] +extern crate hyper; + +extern crate swagger; + +use futures::Stream; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::HashMap; + +pub use futures::Future; + +#[cfg(any(feature = "client", feature = "server"))] +mod mimetypes; + +pub use swagger::{ApiError, Context, ContextWrapper}; + +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +{{^isResponseFile}} +#[derive(Debug, PartialEq)] +{{/isResponseFile}} +pub enum {{operationId}}Response { +{{#responses}} {{message}} {{#dataType}}{{^headers}}( {{{dataType}}} ) {{/headers}}{{#headers}}{{#-first}}{ body: {{{dataType}}}{{/-first}}{{/headers}}{{/dataType}}{{#headers}}{{#-first}}{{^dataType}} { {{/dataType}}{{#dataType}}, {{/dataType}}{{/-first}}{{^-first}}, {{/-first}}{{name}}: {{{datatype}}}{{#-last}} } {{/-last}}{{/headers}}, +{{/responses}} +} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +/// API +pub trait Api { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +{{#summary}} /// {{{summary}}}{{/summary}} + fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}, context: &Context) -> Box + Send>; +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +/// API without a `Context` +pub trait ApiNoContext { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +{{#summary}} /// {{{summary}}}{{/summary}} + fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}) -> Box + Send>; +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +/// Trait to extend an API to make it easy to bind it to a context. +pub trait ContextWrapperExt<'a> where Self: Sized { + /// Binds this API to a context. + fn with_context(self: &'a Self, context: Context) -> ContextWrapper<'a, Self>; +} + +impl<'a, T: Api + Sized> ContextWrapperExt<'a> for T { + fn with_context(self: &'a T, context: Context) -> ContextWrapper<'a, T> { + ContextWrapper::::new(self, context) + } +} + +impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +{{#summary}} /// {{{summary}}}{{/summary}} + fn {{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}(&self{{#allParams}}, {{paramName}}: {{^required}}{{#isFile}}Box{{#isFile}}, Error=Error> + Send>{{/isFile}}{{/required}}{{/allParams}}) -> Box + Send> { + self.api().{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}{{paramName}}, {{/allParams}}&self.context()) + } +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +#[cfg(feature = "client")] +pub mod client; + +// Re-export Client as a top-level name +#[cfg(feature = "client")] +pub use self::client::Client; + +#[cfg(feature = "server")] +pub mod server; + +// Re-export router() as a top-level name +#[cfg(feature = "server")] +pub use self::server::router; + +pub mod models; diff --git a/modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache b/modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache new file mode 100644 index 00000000000..336e12dfe64 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache @@ -0,0 +1,21 @@ +/// mime types for requests and responses + +pub mod responses { + use hyper::mime::*; + + // 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}}_{{uppercase_message}}{{/vendorExtensions}}: Mime = mime!({{{mediaType}}}); + } +{{/dataType}}{{/-first}}{{/produces}}{{/responses}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +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}}); + } +{{/bodyParam}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} diff --git a/modules/swagger-codegen/src/main/resources/rust2/models.mustache b/modules/swagger-codegen/src/main/resources/rust2/models.mustache new file mode 100755 index 00000000000..4c31931dde0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/models.mustache @@ -0,0 +1,175 @@ +#![allow(unused_imports, unused_qualifications, unused_extern_crates)] +extern crate chrono; +extern crate uuid; + +{{#usesXml}}use serde_xml_rs;{{/usesXml}} +use serde::ser::Serializer; + +use std::collections::HashMap; +use models; +use swagger; + +{{#models}}{{#model}} +{{#description}}/// {{{description}}} +{{/description}}{{#isEnum}}/// Enumeration of values. +/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` +/// which helps with FFI. +#[allow(non_camel_case_types)] +#[repr(C)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize)]{{#xmlName}} +#[serde(rename = "{{xmlName}}")]{{/xmlName}} +pub enum {{classname}} { {{#allowableValues}}{{#enumVars}} + #[serde(rename = {{{value}}})] + {{name}},{{/enumVars}}{{/allowableValues}} +} + +impl ::std::fmt::Display for {{classname}} { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { {{#allowableValues}}{{#enumVars}} + {{classname}}::{{name}} => write!(f, "{}", {{{value}}}),{{/enumVars}}{{/allowableValues}} + } + } +} + +impl ::std::str::FromStr for {{classname}} { + type Err = (); + fn from_str(s: &str) -> Result { + match s { +{{#allowableValues}}{{#enumVars}} {{{value}}} => Ok({{classname}}::{{name}}), +{{/enumVars}}{{/allowableValues}} _ => Err(()), + } + } +} +{{/isEnum}}{{^isEnum}}{{#dataType}}{{! newtype}}#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] +{{#xmlName}}#[serde(rename = "{{xmlName}}")]{{/xmlName}} +pub struct {{classname}}({{{dataType}}}); + +impl ::std::convert::From<{{dataType}}> for {{classname}} { + fn from(x: {{dataType}}) -> Self { + {{classname}}(x) + } +} + +impl ::std::convert::From<{{classname}}> for {{dataType}} { + fn from(x: {{classname}}) -> Self { + x.0 + } +} + +impl ::std::ops::Deref for {{classname}} { + type Target = {{{dataType}}}; + fn deref(&self) -> &{{{dataType}}} { + &self.0 + } +} + +impl ::std::ops::DerefMut for {{classname}} { + fn deref_mut(&mut self) -> &mut {{{dataType}}} { + &mut self.0 + } +} + +{{/dataType}}{{^dataType}}{{#arrayModelType}}{{#vendorExtensions}}{{#itemXmlName}}// Utility function for wrapping list elements when serializing xml +fn wrap_in_{{itemXmlName}}(item: &Vec<{{arrayModelType}}>, serializer: S) -> Result +where + S: Serializer, +{ + serde_xml_rs::wrap_primitives(item, serializer, "{{itemXmlName}}") +} + +{{/itemXmlName}}{{/vendorExtensions}}{{! vec}}#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct {{classname}}(Vec<{{{arrayModelType}}}>); + +impl ::std::convert::From> for {{classname}} { + fn from(x: Vec<{{arrayModelType}}>) -> Self { + {{classname}}(x) + } +} + +impl ::std::convert::From<{{classname}}> for Vec<{{arrayModelType}}> { + fn from(x: {{classname}}) -> Self { + x.0 + } +} + +impl ::std::iter::FromIterator<{{arrayModelType}}> for {{classname}} { + fn from_iter>(u: U) -> Self { + {{classname}}(Vec::<{{arrayModelType}}>::from_iter(u)) + } +} + +impl ::std::iter::IntoIterator for {{classname}} { + type Item = {{arrayModelType}}; + type IntoIter = ::std::vec::IntoIter<{{arrayModelType}}>; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a {{classname}} { + type Item = &'a {{arrayModelType}}; + type IntoIter = ::std::slice::Iter<'a, {{arrayModelType}}>; + + fn into_iter(self) -> Self::IntoIter { + (&self.0).into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a mut {{classname}} { + type Item = &'a mut {{arrayModelType}}; + type IntoIter = ::std::slice::IterMut<'a, {{arrayModelType}}>; + + fn into_iter(self) -> Self::IntoIter { + (&mut self.0).into_iter() + } +} + +impl ::std::ops::Deref for {{classname}} { + type Target = Vec<{{{arrayModelType}}}>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl ::std::ops::DerefMut for {{classname}} { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +{{/arrayModelType}}{{^arrayModelType}}{{! general struct}}#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]{{#xmlName}} +#[serde(rename = "{{xmlName}}")]{{/xmlName}} +pub struct {{classname}} { +{{#vars}}{{#description}} /// {{{description}}} +{{/description}}{{#isEnum}} // Note: inline enums are not fully supported by swagger-codegen +{{/isEnum}} #[serde(rename = "{{baseName}}")]{{#vendorExtensions}}{{#itemXmlName}} + #[serde(serialize_with = "wrap_in_{{itemXmlName}}")]{{/itemXmlName}}{{/vendorExtensions}}{{#required}} + pub {{name}}: {{#vendorExtensions}}{{#x-nullable}}swagger::Nullable<{{/x-nullable}}{{/vendorExtensions}}{{{datatype}}}{{#vendorExtensions}}{{#x-nullable}}>{{/x-nullable}}{{/vendorExtensions}}, +{{/required}}{{^required}}{{#vendorExtensions}}{{#x-nullable}} #[serde(deserialize_with = "swagger::nullable_format::deserialize_optional_nullable")] + #[serde(default = "swagger::nullable_format::default_optional_nullable")] +{{/x-nullable}}{{/vendorExtensions}} + #[serde(skip_serializing_if="Option::is_none")] + pub {{name}}: Option<{{#vendorExtensions}}{{#x-nullable}}swagger::Nullable<{{/x-nullable}}{{/vendorExtensions}}{{#isListContainer}}Vec<{{#items}}{{{datatype}}}{{/items}}>{{/isListContainer}}{{^isListContainer}}{{{datatype}}}{{/isListContainer}}{{#vendorExtensions}}{{#x-nullable}}>{{/x-nullable}}{{/vendorExtensions}}>, +{{/required}} + +{{/vars}} +} + +impl {{classname}} { + pub fn new({{#vars}}{{^defaultValue}}{{name}}: {{#vendorExtensions}}{{#x-nullable}}swagger::Nullable<{{/x-nullable}}{{/vendorExtensions}}{{{datatype}}}{{#vendorExtensions}}{{#x-nullable}}>{{/x-nullable}}{{/vendorExtensions}}, {{/defaultValue}}{{/vars}}) -> {{classname}} { + {{classname}} { +{{#vars}} {{name}}: {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}{{name}}{{/defaultValue}}, +{{/vars}} + } + } +} +{{/arrayModelType}}{{/dataType}}{{/isEnum}}{{/model}}{{/models}}{{#usesXmlNamespaces}} +//XML namespaces +pub mod namespaces { + lazy_static!{ + {{#models}}{{#model}}{{#xmlNamespace}}pub static ref {{#vendorExtensions}}{{upperCaseName}}{{/vendorExtensions}}: String = "{{xmlNamespace}}".to_string(); + {{/xmlNamespace}}{{/model}}{{/models}} + } +} +{{/usesXmlNamespaces}} diff --git a/modules/swagger-codegen/src/main/resources/rust2/server.mustache b/modules/swagger-codegen/src/main/resources/rust2/server.mustache new file mode 100644 index 00000000000..6091527455f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/server.mustache @@ -0,0 +1,338 @@ +#![allow(unused_extern_crates)] +extern crate serde_ignored; +extern crate iron; +extern crate router; +extern crate bodyparser; +extern crate urlencoded; +extern crate uuid; +extern crate chrono; +{{#apiHasFile}}extern crate multipart;{{/apiHasFile}} + +use futures::Future; +use futures::future; +use futures::{stream, Stream}; +use hyper; +use hyper::header::{Headers, ContentType}; +use self::iron::prelude::*; +use self::iron::{status, modifiers, BeforeMiddleware}; +use self::iron::url::percent_encoding::percent_decode; +use self::router::Router; +use self::urlencoded::UrlEncodedQuery; +use mimetypes; +{{#apiHasFile}}use multipart::server::{Multipart, SaveResult};{{/apiHasFile}} + +use serde_json; +{{#usesXml}}use serde_xml_rs;{{/usesXml}} + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::BTreeSet; + +use swagger::auth::{Authorization, AuthData, Scopes}; +use swagger::{ApiError, Context, XSpanId}; + +use {Api{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, + {{operationId}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + }; +#[allow(unused_imports)] +use models; + +header! { (Warning, "Warning") => [String] } + +/// Create a new router for `Api` +pub fn router(api: T) -> Router where T: Api + Send + Sync + Clone + 'static { + let mut router = Router::new(); + add_routes(&mut router, api); + router +} + +/// Add routes for `Api` to a provided router. +/// +/// Note that these routes are added straight onto the router. This means that if the router +/// already has a route for an endpoint which clashes with those provided by this API, then the +/// old route will be lost. +/// +/// It is generally a bad idea to add routes in this way to an existing router, which may have +/// routes on it for other APIs. Distinct APIs should be behind distinct paths to encourage +/// separation of interfaces, which this function does not enforce. APIs should not overlap. +/// +/// Alternative approaches include: +/// +/// - generate an `iron::middleware::Handler` (usually a `router::Router` or +/// `iron::middleware::chain`) for each interface, and add those handlers inside an existing +/// router, mounted at different paths - so the interfaces are separated by path +/// - use a different instance of `iron::Iron` for each interface - so the interfaces are +/// separated by the address/port they listen on +/// +/// This function exists to allow legacy code, which doesn't separate its APIs properly, to make +/// use of this crate. +#[deprecated(note="APIs should not overlap - only for use in legacy code.")] +pub fn route(router: &mut Router, api: T) where T: Api + Send + Sync + Clone + 'static { + add_routes(router, api) +} + +/// Add routes for `Api` to a provided router +fn add_routes(router: &mut Router, api: T) where T: Api + Send + Sync + Clone + 'static { +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} + let api_clone = api.clone(); + router.{{#vendorExtensions}}{{httpmethod}}{{/vendorExtensions}}( + "{{#vendorExtensions}}{{basePathWithoutHost}}{{path}}{{/vendorExtensions}}", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + {{#hasAuthMethods}} + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + {{#authMethods}} + {{#isOAuth}} + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + {{#scopes}} + "{{scope}}".to_string(), // {{description}} + {{/scopes}} + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + +{{#pathParams}}{{#-first}} + // Path parameters +{{/-first}} let param_{{paramName}} = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("{{baseName}}").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter {{baseName}}".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter {{baseName}}: {}", e))))? + }; +{{/pathParams}} +{{#headerParams}}{{#-first}} + // Header parameters +{{/-first}} header! { (Request{{vendorExtensions.typeName}}, "{{baseName}}") => {{#isListContainer}}({{{baseType}}})*{{/isListContainer}}{{^isListContainer}}[{{{dataType}}}]{{/isListContainer}} } +{{#required}} let param_{{paramName}} = req.headers.get::().ok_or_else(|| Response::with((status::BadRequest, "Missing or invalid required header {{baseName}}".to_string())))?.0.clone(); +{{/required}}{{^required}} let param_{{paramName}} = req.headers.get::().map(|header| header.0.clone()); +{{/required}}{{/headerParams}} +{{#queryParams}}{{#-first}} + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); +{{/-first}} let param_{{paramName}} = query_params.get("{{baseName}}") +{{#required}} .ok_or_else(|| Response::with((status::BadRequest, "Missing required query parameter {{baseName}}".to_string())))? +{{#isListContainer}} .iter().flat_map(|x| x.parse::<{{{baseType}}}>()).collect::>(); +{{/isListContainer}}{{^isListContainer}} .first().ok_or_else(|| Response::with((status::BadRequest, "Required query parameter {{baseName}} was empty".to_string())))? + .parse::<{{{dataType}}}>().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse query parameter {{baseName}} - doesn't match schema: {}", e))))?; +{{/isListContainer}}{{/required}}{{^required}}{{#isListContainer}} .map(|list| list.iter().flat_map(|x| x.parse::<{{{baseType}}}>()).collect::>()); +{{/isListContainer}}{{^isListContainer}} .and_then(|list| list.first()).and_then(|x| x.parse::<{{{dataType}}}>().ok()); +{{/isListContainer}}{{/required}}{{/queryParams}} +{{#bodyParams}}{{#-first}} // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. +{{/-first}}{{#required}} + let param_{{paramName}}_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter {{baseName}} - not valid UTF-8: {}", e))))?; +{{/required}}{{^required}} + let param_{{paramName}}_raw = req.get::().unwrap_or(None); +{{/required}} + let mut unused_elements = Vec::new(); + + let param_{{paramName}} = if let Some(param_{{paramName}}_raw) = param_{{paramName}}_raw { {{#vendorExtensions}}{{#consumesXml}} + let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(param_{{paramName}}_raw.as_bytes());{{/consumesXml}}{{^consumesXml}} + let deserializer = &mut serde_json::Deserializer::from_str(¶m_{{paramName}}_raw);{{/consumesXml}}{{/vendorExtensions}} + + let param_{{paramName}}: Option<{{{dataType}}}> = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }){{#required}}.map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter {{baseName}} - doesn't match schema: {}", e))))?{{/required}}{{^required}}.unwrap_or(None){{/required}}; + + param_{{paramName}} + } else { + None + };{{#required}} + let param_{{paramName}} = param_{{paramName}}.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter {{baseName}}".to_string())))?{{/required}}; + +{{/bodyParams}} +{{#formParams}} + {{#-first}} + // Form parameters +{{/-first}}{{/formParams}}{{#vendorExtensions}}{{#hasFile}} + // Expecting a multipart form, extract and parse it now. + let mut entries = match Multipart::from_request(req) { + Ok(mut multipart) => { + + match multipart.save().temp() { + SaveResult::Full(entries) => { + Ok(entries) + }, + _ => { + Err(Response::with((status::InternalServerError, format!("Unable to process all message parts")))) + }, + } + }, + Err(e) => { + // Unable to parse as multipart + Err(Response::with((status::BadRequest, format!("Couldn't parse body as multipart")))) + } + }?; + +{{/hasFile}}{{/vendorExtensions}}{{#allParams}}{{#isFormParam}}{{#isFile}} + + let param_{{paramName}} = entries.fields.remove("{{paramName}}"); + + let param_{{paramName}} = match param_{{paramName}} { + Some(body) => { + Ok({let bytes = body.as_bytes(); + {{^required}}Some({{/required}} + Box::new(stream::once(Ok(bytes.to_vec()))) as Box, Error=Error> + Send> + {{^required}}){{/required}}} + ) + } + None => {Err(Response::with((status::BadRequest, format!("Body part not found!"))))} + }?; +{{/isFile}} + let param_{{paramName}} = {{#isFile}}{{^required}}Box::new(future::ok({{/required}}param_{{paramName}}{{^required}})){{/required}};{{/isFile}}{{^isFile}}{{^isContainer}}{{#vendorExtensions}}{{{example}}};{{/vendorExtensions}}{{/isContainer}}{{#isListContainer}}{{#required}}Vec::new();{{/required}}{{^required}}None;{{/required}}{{/isListContainer}}{{#isMapContainer}}None;{{/isMapContainer}}{{/isFile}} + {{/isFormParam}} +{{/allParams}} + + match api.{{#vendorExtensions}}{{operation_id}}{{/vendorExtensions}}({{#allParams}}param_{{paramName}}{{#isListContainer}}.as_ref(){{/isListContainer}}, {{/allParams}}context).wait() { + Ok(rsp) => match rsp { +{{#responses}} + {{operationId}}Response::{{message}}{{#dataType}}{{^headers}}(body){{/headers}}{{#headers}}{{#-first}}{ body{{/-first}}{{/headers}}{{/dataType}}{{#headers}}{{#-first}}{{^dataType}}{ {{/dataType}}{{#dataType}}, {{/dataType}}{{/-first}}{{^-first}}, {{/-first}}{{name}}{{#-last}} }{{/-last}}{{/headers}} => { +{{^isFile}} +{{#dataType}}{{#vendorExtensions}}{{#producesXml}} +{{^has_namespace}} let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize");{{/has_namespace}}{{#has_namespace}} + let mut namespaces = BTreeMap::new(); + // An empty string is used to indicate a global namespace in xmltree. + namespaces.insert("".to_string(), models::namespaces::{{uppercase_data_type}}.clone()); + let body_string = serde_xml_rs::to_string_with_namespaces(&body, namespaces).expect("impossible to fail to serialize");{{/has_namespace}}{{/producesXml}}{{^producesXml}} + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize");{{/producesXml}}{{/vendorExtensions}}{{/dataType}} + + let mut response = Response::with((status::Status::from_u16({{code}}){{#dataType}}, body_string{{/dataType}}));{{/isFile}}{{#isFile}} body.fold(Vec::new(), |mut body, chunk| { + body.extend(chunk.iter()); + future::ok::, Error>(body) + }) + + // Block whilst waiting for the stream to complete + .wait() + + // It's possible that errors were received in the stream, if this is the case then we can't return a success response to the client and instead must return an internal error. + .map_err(|_| Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + + // Assuming no errors then create an Iron response. + .map(|rsp| { + let mut response = Response::new(); + response.status = Some(status::Status::from_u16({{code}})); + response.body = Some(Box::new(rsp)); +{{/isFile}} +{{#headers}}{{#isFile}} {{/isFile}} header! { (Response{{nameInCamelCase}}, "{{baseName}}") => [{{{datatype}}}] } +{{#isFile}} {{/isFile}} response.headers.set(Response{{nameInCamelCase}}({{name}})); +{{/headers}} + {{#produces}}{{#-first}} +{{#dataType}}{{#isFile}} {{/isFile}} response.headers.set(ContentType(mimetypes::responses::{{#vendorExtensions}}{{uppercase_operation_id}}_{{uppercase_message}}{{/vendorExtensions}}.clone()));{{/dataType}} +{{/-first}}{{/produces}} +{{#isFile}} {{/isFile}} context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); +{{#bodyParams}} if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + }{{/bodyParams}} + {{^isFile}}Ok(response){{/isFile}}{{#isFile}} response + }){{/isFile}} + }, +{{/responses}} + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "{{operationId}}"); +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +} + +/// Middleware to extract authentication data from request +pub struct ExtractAuthData; + +impl BeforeMiddleware for ExtractAuthData { + fn before(&self, req: &mut Request) -> IronResult<()> { + {{#authMethods}} + {{#isBasic}} + { + use hyper::header::{Authorization, Basic, Bearer}; + use std::ops::Deref; + if let Some(basic) = req.headers.get::>() { + req.extensions.insert::(AuthData::Basic(basic.deref().clone())); + return Ok(()); + } + } + {{/isBasic}} + {{#isOAuth}} + { + use hyper::header::{Authorization, Basic, Bearer}; + use std::ops::Deref; + if let Some(bearer) = req.headers.get::>() { + req.extensions.insert::(AuthData::Bearer(bearer.deref().clone())); + return Ok(()); + } + } + {{/isOAuth}} + {{#isApiKey}} + {{#isKeyInHeader}} + { + header! { (ApiKey{{-index}}, "{{keyParamName}}") => [String] } + if let Some(header) = req.headers.get::() { + req.extensions.insert::(AuthData::ApiKey(header.0.clone())); + return Ok(()); + } + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + { + let header = match req.get_ref::() { + Ok(query) => query.get("{{keyParamName}}").map(|v| v[0].clone()), + _ => None + }; + if let Some(key) = header { + req.extensions.insert::(AuthData::ApiKey(key)); + return Ok(()); + } + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + + Ok(()) + } +} diff --git a/modules/swagger-codegen/src/main/resources/rust2/swagger.mustache b/modules/swagger-codegen/src/main/resources/rust2/swagger.mustache new file mode 100644 index 00000000000..51560926bba --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/rust2/swagger.mustache @@ -0,0 +1 @@ +{{{swagger-yaml}}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/Rust2OptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/Rust2OptionsProvider.java new file mode 100644 index 00000000000..68c0d94088d --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/Rust2OptionsProvider.java @@ -0,0 +1,22 @@ +package io.swagger.codegen.options; + +import com.google.common.collect.ImmutableMap; + +import java.util.Map; + +public class Rust2OptionsProvider implements OptionsProvider { + @Override + public String getLanguage() { + return "rust2"; + } + + @Override + public Map createOptions() { + return ImmutableMap.of(); + } + + @Override + public boolean isServer() { + return true; + } +} diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index c947e95d926..d7ba1c46589 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -898,6 +898,35 @@ paths: responses: '200': description: successful operation + /fake/xmlFeatures: + get: + summary: Get some XML + operationId: getXmlFeatures + produces: + - application/xml + consumes: + - application/xml + responses: + 200: + description: Success + schema: + $ref: '#/definitions/xmlObject' + post: + parameters: + - name: xmlObject + in: body + required: true + schema: + $ref: '#/definitions/xmlObject' + summary: Post some xml + operationId: postXmlFeatures + produces: + - application/xml + consumes: + - application/xml + responses: + 200: + description: Success /fake/inline-additionalProperties: post: tags: @@ -942,6 +971,7 @@ paths: description: successful operation schema: $ref: '#/definitions/Client' + securityDefinitions: petstore_auth: type: oauth2 @@ -957,7 +987,7 @@ securityDefinitions: api_key_query: type: apiKey name: api_key_query - in: query + in: query http_basic_test: type: basic definitions: @@ -980,7 +1010,7 @@ definitions: type: string description: Order Status enum: - - placed + - placedtest - approved - delivered complete: diff --git a/samples/client/petstore/rust2/.cargo/config b/samples/client/petstore/rust2/.cargo/config new file mode 100644 index 00000000000..b8acc9c00c8 --- /dev/null +++ b/samples/client/petstore/rust2/.cargo/config @@ -0,0 +1,18 @@ +[build] +rustflags = [ + "-W", "missing_docs", # detects missing documentation for public members + + "-W", "trivial_casts", # detects trivial casts which could be removed + + "-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed + + "-W", "unsafe_code", # usage of `unsafe` code + + "-W", "unused_qualifications", # detects unnecessarily qualified names + + "-W", "unused_extern_crates", # extern crates that are never used + + "-W", "unused_import_braces", # unnecessary braces around an imported item + + "-D", "warnings", # all warnings should be denied +] diff --git a/samples/client/petstore/rust2/.gitignore b/samples/client/petstore/rust2/.gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/samples/client/petstore/rust2/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/client/petstore/rust2/.swagger-codegen-ignore b/samples/client/petstore/rust2/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/rust2/.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/rust2/.swagger-codegen/VERSION b/samples/client/petstore/rust2/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/rust2/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust2/Cargo.toml b/samples/client/petstore/rust2/Cargo.toml new file mode 100644 index 00000000000..da42d20714b --- /dev/null +++ b/samples/client/petstore/rust2/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "petstore_api" +version = "1.0.0" +authors = ["apiteam@swagger.io"] + +[features] +default = ["client", "server"] +client = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-openssl", "uuid", "multipart"] +server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "iron", "router", "bodyparser", "urlencoded", "uuid", "multipart"] + +[dependencies] +bodyparser = {version = "0.7", optional = true} +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.10", optional = true} +hyper-openssl = {version = "0.2", optional = true } +iron = {version = "0.5", optional = true} +lazy_static = "0.2" +log = "0.3.0" +multipart = {version = "0.13", optional = true} +router = {version = "0.5", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +swagger = "0.7" +urlencoded = {version = "0.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream +serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master", optional = true} + +[dev-dependencies] +clap = "2.25" diff --git a/samples/client/petstore/rust2/README.md b/samples/client/petstore/rust2/README.md new file mode 100644 index 00000000000..1e98c25281c --- /dev/null +++ b/samples/client/petstore/rust2/README.md @@ -0,0 +1,85 @@ +# Rust API for petstore_api + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## Overview +This client/server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +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-09-26T16:36:55.563+01:00 + +## Examples + +Run examples with: + +``` +cargo run --example +``` + +To pass in arguments to the examples, put them after `--`, for example: + +``` +cargo run --example client -- --help +``` + +### Running the server +To run the server, follow these simple steps: + +``` +cargo run --example server +``` + +### Running a client +To run a client, follow one of the following simple steps: + +``` +cargo run --example client TestSpecialTags +cargo run --example client GetXmlFeatures +cargo run --example client PostXmlFeatures +cargo run --example client FakeOuterBooleanSerialize +cargo run --example client FakeOuterCompositeSerialize +cargo run --example client FakeOuterNumberSerialize +cargo run --example client FakeOuterStringSerialize +cargo run --example client TestClientModel +cargo run --example client TestEndpointParameters +cargo run --example client TestEnumParameters +cargo run --example client TestJsonFormData +cargo run --example client TestClassname +cargo run --example client AddPet +cargo run --example client DeletePet +cargo run --example client FindPetsByStatus +cargo run --example client FindPetsByTags +cargo run --example client GetPetById +cargo run --example client UpdatePet +cargo run --example client UpdatePetWithForm +cargo run --example client UploadFile +cargo run --example client DeleteOrder +cargo run --example client GetInventory +cargo run --example client GetOrderById +cargo run --example client PlaceOrder +cargo run --example client CreateUser +cargo run --example client CreateUsersWithArrayInput +cargo run --example client CreateUsersWithListInput +cargo run --example client DeleteUser +cargo run --example client GetUserByName +cargo run --example client LoginUser +cargo run --example client LogoutUser +cargo run --example client UpdateUser +``` + +### HTTPS +The examples can be run in HTTPS mode by passing in the flag `--https`, for example: + +``` +cargo run --example server -- --https +``` + +This will use the keys/certificates from the examples directory. Note that the server chain is signed with +`CN=localhost`. diff --git a/samples/client/petstore/rust2/api/swagger.yaml b/samples/client/petstore/rust2/api/swagger.yaml new file mode 100644 index 00000000000..1dc845be640 --- /dev/null +++ b/samples/client/petstore/rust2/api/swagger.yaml @@ -0,0 +1,2020 @@ +--- +swagger: "2.0" +info: + 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:\ + \ \" \\" + 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:80" +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" + uppercase_data_type: "PET" + refName: "Pet" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "ADD_PET" + consumesXml: true + responses: + 405: + description: "Invalid input" + uppercase_operation_id: "ADD_PET" + uppercase_message: "INVALID_INPUT" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "add_pet" + uppercase_operation_id: "ADD_PET" + path: "/pet" + HttpMethod: "Post" + httpmethod: "post" + noClientExample: true + 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" + uppercase_data_type: "PET" + refName: "Pet" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "UPDATE_PET" + consumesXml: true + responses: + 400: + description: "Invalid ID supplied" + uppercase_operation_id: "UPDATE_PET" + uppercase_message: "INVALID_ID_SUPPLIED" + 404: + description: "Pet not found" + uppercase_operation_id: "UPDATE_PET" + uppercase_message: "PET_NOT_FOUND" + 405: + description: "Validation exception" + uppercase_operation_id: "UPDATE_PET" + uppercase_message: "VALIDATION_EXCEPTION" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "update_pet" + uppercase_operation_id: "UPDATE_PET" + path: "/pet" + HttpMethod: "Put" + httpmethod: "put" + noClientExample: true + /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" + formatString: "{:?}" + example: "&Vec::new()" + responses: + 200: + description: "successful operation" + schema: + type: "array" + items: + $ref: "#/definitions/Pet" + uppercase_operation_id: "FIND_PETS_BY_STATUS" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "VEC" + producesXml: true + 400: + description: "Invalid status value" + uppercase_operation_id: "FIND_PETS_BY_STATUS" + uppercase_message: "INVALID_STATUS_VALUE" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "find_pets_by_status" + uppercase_operation_id: "FIND_PETS_BY_STATUS" + path: "/pet/findByStatus" + HttpMethod: "Get" + httpmethod: "get" + /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" + formatString: "{:?}" + example: "&Vec::new()" + responses: + 200: + description: "successful operation" + schema: + type: "array" + items: + $ref: "#/definitions/Pet" + uppercase_operation_id: "FIND_PETS_BY_TAGS" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "VEC" + producesXml: true + 400: + description: "Invalid tag value" + uppercase_operation_id: "FIND_PETS_BY_TAGS" + uppercase_message: "INVALID_TAG_VALUE" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + deprecated: true + operation_id: "find_pets_by_tags" + uppercase_operation_id: "FIND_PETS_BY_TAGS" + path: "/pet/findByTags" + HttpMethod: "Get" + httpmethod: "get" + /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" + formatString: "{}" + example: "789" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Pet" + uppercase_operation_id: "GET_PET_BY_ID" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "PET" + producesXml: true + 400: + description: "Invalid ID supplied" + uppercase_operation_id: "GET_PET_BY_ID" + uppercase_message: "INVALID_ID_SUPPLIED" + 404: + description: "Pet not found" + uppercase_operation_id: "GET_PET_BY_ID" + uppercase_message: "PET_NOT_FOUND" + security: + - api_key: [] + operation_id: "get_pet_by_id" + uppercase_operation_id: "GET_PET_BY_ID" + path: "/pet/:petId" + HttpMethod: "Get" + httpmethod: "get" + 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" + formatString: "{}" + example: "789" + - name: "name" + in: "formData" + description: "Updated name of the pet" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"name_example\".to_string())" + - name: "status" + in: "formData" + description: "Updated status of the pet" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"status_example\".to_string())" + responses: + 405: + description: "Invalid input" + uppercase_operation_id: "UPDATE_PET_WITH_FORM" + uppercase_message: "INVALID_INPUT" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "update_pet_with_form" + uppercase_operation_id: "UPDATE_PET_WITH_FORM" + path: "/pet/:petId" + HttpMethod: "Post" + httpmethod: "post" + 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" + formatString: "{:?}" + example: "Some(\"api_key_example\".to_string())" + - name: "petId" + in: "path" + description: "Pet id to delete" + required: true + type: "integer" + format: "int64" + formatString: "{}" + example: "789" + responses: + 400: + description: "Invalid pet value" + uppercase_operation_id: "DELETE_PET" + uppercase_message: "INVALID_PET_VALUE" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "delete_pet" + uppercase_operation_id: "DELETE_PET" + path: "/pet/:petId" + HttpMethod: "Delete" + httpmethod: "delete" + /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" + formatString: "{}" + example: "789" + - name: "additionalMetadata" + in: "formData" + description: "Additional data to pass to server" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"additional_metadata_example\".to_string())" + - name: "file" + in: "formData" + description: "file to upload" + required: false + type: "file" + formatString: "{:?}" + example: "Box::new(future::ok(Some(Box::new(stream::once(Ok(b\"hello\".to_vec())))\ + \ as Box + Send>))) as Box\ + \ + Send>" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + uppercase_operation_id: "UPLOAD_FILE" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "APIRESPONSE" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + operation_id: "upload_file" + uppercase_operation_id: "UPLOAD_FILE" + path: "/pet/:petId/uploadImage" + HttpMethod: "Post" + httpmethod: "post" + hasFile: true + /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" + uppercase_operation_id: "GET_INVENTORY" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "HASHMAP" + security: + - api_key: [] + operation_id: "get_inventory" + uppercase_operation_id: "GET_INVENTORY" + path: "/store/inventory" + HttpMethod: "Get" + httpmethod: "get" + /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" + uppercase_data_type: "ORDER" + refName: "Order" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "PLACE_ORDER" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Order" + uppercase_operation_id: "PLACE_ORDER" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "ORDER" + producesXml: true + 400: + description: "Invalid Order" + uppercase_operation_id: "PLACE_ORDER" + uppercase_message: "INVALID_ORDER" + operation_id: "place_order" + uppercase_operation_id: "PLACE_ORDER" + path: "/store/order" + HttpMethod: "Post" + httpmethod: "post" + noClientExample: true + /store/order/{order_id}: + 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: "order_id" + in: "path" + description: "ID of pet that needs to be fetched" + required: true + type: "integer" + maximum: 5 + minimum: 1 + format: "int64" + formatString: "{}" + example: "789" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Order" + uppercase_operation_id: "GET_ORDER_BY_ID" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "ORDER" + producesXml: true + 400: + description: "Invalid ID supplied" + uppercase_operation_id: "GET_ORDER_BY_ID" + uppercase_message: "INVALID_ID_SUPPLIED" + 404: + description: "Order not found" + uppercase_operation_id: "GET_ORDER_BY_ID" + uppercase_message: "ORDER_NOT_FOUND" + operation_id: "get_order_by_id" + uppercase_operation_id: "GET_ORDER_BY_ID" + path: "/store/order/:order_id" + HttpMethod: "Get" + httpmethod: "get" + 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: "order_id" + in: "path" + description: "ID of the order that needs to be deleted" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"order_id_example\".to_string()" + responses: + 400: + description: "Invalid ID supplied" + uppercase_operation_id: "DELETE_ORDER" + uppercase_message: "INVALID_ID_SUPPLIED" + 404: + description: "Order not found" + uppercase_operation_id: "DELETE_ORDER" + uppercase_message: "ORDER_NOT_FOUND" + operation_id: "delete_order" + uppercase_operation_id: "DELETE_ORDER" + path: "/store/order/:order_id" + HttpMethod: "Delete" + httpmethod: "delete" + /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" + uppercase_data_type: "USER" + refName: "User" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "CREATE_USER" + responses: + default: + description: "successful operation" + uppercase_operation_id: "CREATE_USER" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "create_user" + uppercase_operation_id: "CREATE_USER" + path: "/user" + HttpMethod: "Post" + httpmethod: "post" + noClientExample: true + /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" + formatString: "{:?}" + example: "&Vec::new()" + model_key: "itemList" + uppercase_operation_id: "CREATE_USERS_WITH_ARRAY_INPUT" + responses: + default: + description: "successful operation" + uppercase_operation_id: "CREATE_USERS_WITH_ARRAY_INPUT" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "create_users_with_array_input" + uppercase_operation_id: "CREATE_USERS_WITH_ARRAY_INPUT" + path: "/user/createWithArray" + HttpMethod: "Post" + httpmethod: "post" + /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" + formatString: "{:?}" + example: "&Vec::new()" + model_key: "itemList" + uppercase_operation_id: "CREATE_USERS_WITH_LIST_INPUT" + responses: + default: + description: "successful operation" + uppercase_operation_id: "CREATE_USERS_WITH_LIST_INPUT" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "create_users_with_list_input" + uppercase_operation_id: "CREATE_USERS_WITH_LIST_INPUT" + path: "/user/createWithList" + HttpMethod: "Post" + httpmethod: "post" + /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" + formatString: "\\\"{}\\\"" + example: "\"username_example\".to_string()" + - name: "password" + in: "query" + description: "The password for login in clear text" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"password_example\".to_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" + uppercase_operation_id: "LOGIN_USER" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "STRING" + producesXml: true + 400: + description: "Invalid username/password supplied" + uppercase_operation_id: "LOGIN_USER" + uppercase_message: "INVALID_USERNAME" + operation_id: "login_user" + uppercase_operation_id: "LOGIN_USER" + path: "/user/login" + HttpMethod: "Get" + httpmethod: "get" + /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" + uppercase_operation_id: "LOGOUT_USER" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "logout_user" + uppercase_operation_id: "LOGOUT_USER" + path: "/user/logout" + HttpMethod: "Get" + httpmethod: "get" + /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" + formatString: "\\\"{}\\\"" + example: "\"username_example\".to_string()" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/User" + uppercase_operation_id: "GET_USER_BY_NAME" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "USER" + producesXml: true + 400: + description: "Invalid username supplied" + uppercase_operation_id: "GET_USER_BY_NAME" + uppercase_message: "INVALID_USERNAME_SUPPLIED" + 404: + description: "User not found" + uppercase_operation_id: "GET_USER_BY_NAME" + uppercase_message: "USER_NOT_FOUND" + operation_id: "get_user_by_name" + uppercase_operation_id: "GET_USER_BY_NAME" + path: "/user/:username" + HttpMethod: "Get" + httpmethod: "get" + 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" + formatString: "\\\"{}\\\"" + example: "\"username_example\".to_string()" + - in: "body" + name: "body" + description: "Updated user object" + required: true + schema: + $ref: "#/definitions/User" + uppercase_data_type: "USER" + refName: "User" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "UPDATE_USER" + responses: + 400: + description: "Invalid user supplied" + uppercase_operation_id: "UPDATE_USER" + uppercase_message: "INVALID_USER_SUPPLIED" + 404: + description: "User not found" + uppercase_operation_id: "UPDATE_USER" + uppercase_message: "USER_NOT_FOUND" + operation_id: "update_user" + uppercase_operation_id: "UPDATE_USER" + path: "/user/:username" + HttpMethod: "Put" + httpmethod: "put" + noClientExample: true + 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" + formatString: "\\\"{}\\\"" + example: "\"username_example\".to_string()" + responses: + 400: + description: "Invalid username supplied" + uppercase_operation_id: "DELETE_USER" + uppercase_message: "INVALID_USERNAME_SUPPLIED" + 404: + description: "User not found" + uppercase_operation_id: "DELETE_USER" + uppercase_message: "USER_NOT_FOUND" + operation_id: "delete_user" + uppercase_operation_id: "DELETE_USER" + path: "/user/:username" + HttpMethod: "Delete" + httpmethod: "delete" + /fake_classname_test: + patch: + tags: + - "fake_classname_tags 123#$%^" + summary: "To test class name in snake case" + operationId: "testClassname" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + uppercase_data_type: "CLIENT" + refName: "Client" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "TEST_CLASSNAME" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + uppercase_operation_id: "TEST_CLASSNAME" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "CLIENT" + security: + - api_key_query: [] + operation_id: "test_classname" + uppercase_operation_id: "TEST_CLASSNAME" + path: "/fake_classname_test" + HttpMethod: "Patch" + httpmethod: "patch" + noClientExample: true + /fake: + get: + tags: + - "fake" + summary: "To test enum parameters" + description: "To test enum parameters" + operationId: "testEnumParameters" + consumes: + - "*/*" + produces: + - "*/*" + parameters: + - name: "enum_form_string_array" + in: "formData" + description: "Form parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + formatString: "{:?}" + example: "Some(&Vec::new())" + - name: "enum_form_string" + in: "formData" + description: "Form parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + formatString: "{:?}" + example: "Some(\"enum_form_string_example\".to_string())" + - name: "enum_header_string_array" + in: "header" + description: "Header parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + formatString: "{:?}" + example: "Some(&Vec::new())" + - name: "enum_header_string" + in: "header" + description: "Header parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + formatString: "{:?}" + example: "Some(\"enum_header_string_example\".to_string())" + - name: "enum_query_string_array" + in: "query" + description: "Query parameter enum test (string array)" + required: false + type: "array" + items: + type: "string" + default: "$" + enum: + - ">" + - "$" + formatString: "{:?}" + example: "Some(&Vec::new())" + - name: "enum_query_string" + in: "query" + description: "Query parameter enum test (string)" + required: false + type: "string" + default: "-efg" + enum: + - "_abc" + - "-efg" + - "(xyz)" + formatString: "{:?}" + example: "Some(\"enum_query_string_example\".to_string())" + - name: "enum_query_integer" + in: "query" + description: "Query parameter enum test (double)" + required: false + type: "integer" + format: "int32" + enum: + - 1 + - -2 + formatString: "{:?}" + example: "Some(56)" + - name: "enum_query_double" + in: "formData" + description: "Query parameter enum test (double)" + required: false + type: "number" + format: "double" + enum: + - 1.1 + - -1.2 + formatString: "{:?}" + example: "Some(1.2)" + responses: + 400: + description: "Invalid request" + uppercase_operation_id: "TEST_ENUM_PARAMETERS" + uppercase_message: "INVALID_REQUEST" + 404: + description: "Not found" + uppercase_operation_id: "TEST_ENUM_PARAMETERS" + uppercase_message: "NOT_FOUND" + operation_id: "test_enum_parameters" + uppercase_operation_id: "TEST_ENUM_PARAMETERS" + path: "/fake" + HttpMethod: "Get" + httpmethod: "get" + post: + tags: + - "fake" + summary: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔\ + 드 포인트\n" + description: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n\ + 가짜 엔드 포인트\n" + operationId: "testEndpointParameters" + consumes: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + produces: + - "application/xml; charset=utf-8" + - "application/json; charset=utf-8" + parameters: + - name: "integer" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 100 + minimum: 10 + formatString: "{:?}" + example: "Some(56)" + - name: "int32" + in: "formData" + description: "None" + required: false + type: "integer" + maximum: 200 + minimum: 20 + format: "int32" + formatString: "{:?}" + example: "Some(56)" + - name: "int64" + in: "formData" + description: "None" + required: false + type: "integer" + format: "int64" + formatString: "{:?}" + example: "Some(789)" + - name: "number" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 543.2 + minimum: 32.1 + formatString: "{}" + example: "3.4" + - name: "float" + in: "formData" + description: "None" + required: false + type: "number" + maximum: 987.6 + format: "float" + formatString: "{:?}" + example: "Some(3.4)" + - name: "double" + in: "formData" + description: "None" + required: true + type: "number" + maximum: 123.4 + minimum: 67.8 + format: "double" + formatString: "{}" + example: "1.2" + - name: "string" + in: "formData" + description: "None" + required: false + type: "string" + pattern: "/[a-z]/i" + formatString: "{:?}" + example: "Some(\"string_example\".to_string())" + - name: "pattern_without_delimiter" + in: "formData" + description: "None" + required: true + type: "string" + pattern: "^[A-Z].*" + formatString: "\\\"{}\\\"" + example: "\"pattern_without_delimiter_example\".to_string()" + - name: "byte" + in: "formData" + description: "None" + required: true + type: "string" + format: "byte" + formatString: "\\\"{:?}\\\"" + example: "swagger::ByteArray(\"byte_example\".to_string().into_bytes())" + - name: "binary" + in: "formData" + description: "None" + required: false + type: "string" + format: "binary" + formatString: "{:?}" + example: "Some(swagger::ByteArray(Vec::from(\"B\")))" + - name: "date" + in: "formData" + description: "None" + required: false + type: "string" + format: "date" + formatString: "{:?}" + example: "None" + - name: "dateTime" + in: "formData" + description: "None" + required: false + type: "string" + format: "date-time" + formatString: "{:?}" + example: "None" + - name: "password" + in: "formData" + description: "None" + required: false + type: "string" + maxLength: 64 + minLength: 10 + format: "password" + formatString: "{:?}" + example: "Some(\"password_example\".to_string())" + - name: "callback" + in: "formData" + description: "None" + required: false + type: "string" + formatString: "{:?}" + example: "Some(\"callback_example\".to_string())" + responses: + 400: + description: "Invalid username supplied" + uppercase_operation_id: "TEST_ENDPOINT_PARAMETERS" + uppercase_message: "INVALID_USERNAME_SUPPLIED" + 404: + description: "User not found" + uppercase_operation_id: "TEST_ENDPOINT_PARAMETERS" + uppercase_message: "USER_NOT_FOUND" + security: + - http_basic_test: [] + operation_id: "test_endpoint_parameters" + uppercase_operation_id: "TEST_ENDPOINT_PARAMETERS" + path: "/fake" + HttpMethod: "Post" + httpmethod: "post" + patch: + tags: + - "fake" + summary: "To test \"client\" model" + description: "To test \"client\" model" + operationId: "testClientModel" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + uppercase_data_type: "CLIENT" + refName: "Client" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "TEST_CLIENT_MODEL" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + uppercase_operation_id: "TEST_CLIENT_MODEL" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "CLIENT" + operation_id: "test_client_model" + uppercase_operation_id: "TEST_CLIENT_MODEL" + path: "/fake" + HttpMethod: "Patch" + httpmethod: "patch" + noClientExample: true + /fake/outer/number: + post: + tags: + - "fake" + description: "Test serialization of outer number types" + operationId: "fakeOuterNumberSerialize" + parameters: + - in: "body" + name: "body" + description: "Input number as post body" + required: false + schema: + $ref: "#/definitions/OuterNumber" + uppercase_data_type: "OUTERNUMBER" + refName: "OuterNumber" + formatString: "{:?}" + example: "None" + model_key: "itemList" + uppercase_operation_id: "FAKE_OUTER_NUMBER_SERIALIZE" + responses: + 200: + description: "Output number" + schema: + $ref: "#/definitions/OuterNumber" + uppercase_operation_id: "FAKE_OUTER_NUMBER_SERIALIZE" + uppercase_message: "OUTPUT_NUMBER" + uppercase_data_type: "OUTERNUMBER" + operation_id: "fake_outer_number_serialize" + uppercase_operation_id: "FAKE_OUTER_NUMBER_SERIALIZE" + path: "/fake/outer/number" + HttpMethod: "Post" + httpmethod: "post" + /fake/outer/string: + post: + tags: + - "fake" + description: "Test serialization of outer string types" + operationId: "fakeOuterStringSerialize" + parameters: + - in: "body" + name: "body" + description: "Input string as post body" + required: false + schema: + $ref: "#/definitions/OuterString" + uppercase_data_type: "OUTERSTRING" + refName: "OuterString" + formatString: "{:?}" + example: "None" + model_key: "itemList" + uppercase_operation_id: "FAKE_OUTER_STRING_SERIALIZE" + responses: + 200: + description: "Output string" + schema: + $ref: "#/definitions/OuterString" + uppercase_operation_id: "FAKE_OUTER_STRING_SERIALIZE" + uppercase_message: "OUTPUT_STRING" + uppercase_data_type: "OUTERSTRING" + operation_id: "fake_outer_string_serialize" + uppercase_operation_id: "FAKE_OUTER_STRING_SERIALIZE" + path: "/fake/outer/string" + HttpMethod: "Post" + httpmethod: "post" + /fake/outer/boolean: + post: + tags: + - "fake" + description: "Test serialization of outer boolean types" + operationId: "fakeOuterBooleanSerialize" + parameters: + - in: "body" + name: "body" + description: "Input boolean as post body" + required: false + schema: + $ref: "#/definitions/OuterBoolean" + uppercase_data_type: "OUTERBOOLEAN" + refName: "OuterBoolean" + formatString: "{:?}" + example: "None" + model_key: "itemList" + uppercase_operation_id: "FAKE_OUTER_BOOLEAN_SERIALIZE" + responses: + 200: + description: "Output boolean" + schema: + $ref: "#/definitions/OuterBoolean" + uppercase_operation_id: "FAKE_OUTER_BOOLEAN_SERIALIZE" + uppercase_message: "OUTPUT_BOOLEAN" + uppercase_data_type: "OUTERBOOLEAN" + operation_id: "fake_outer_boolean_serialize" + uppercase_operation_id: "FAKE_OUTER_BOOLEAN_SERIALIZE" + path: "/fake/outer/boolean" + HttpMethod: "Post" + httpmethod: "post" + /fake/outer/composite: + post: + tags: + - "fake" + description: "Test serialization of object with outer number type" + operationId: "fakeOuterCompositeSerialize" + parameters: + - in: "body" + name: "body" + description: "Input composite as post body" + required: false + schema: + $ref: "#/definitions/OuterComposite" + uppercase_data_type: "OUTERCOMPOSITE" + refName: "OuterComposite" + formatString: "{:?}" + example: "None" + model_key: "itemList" + uppercase_operation_id: "FAKE_OUTER_COMPOSITE_SERIALIZE" + responses: + 200: + description: "Output composite" + schema: + $ref: "#/definitions/OuterComposite" + uppercase_operation_id: "FAKE_OUTER_COMPOSITE_SERIALIZE" + uppercase_message: "OUTPUT_COMPOSITE" + uppercase_data_type: "OUTERCOMPOSITE" + operation_id: "fake_outer_composite_serialize" + uppercase_operation_id: "FAKE_OUTER_COMPOSITE_SERIALIZE" + path: "/fake/outer/composite" + HttpMethod: "Post" + httpmethod: "post" + /fake/jsonFormData: + get: + tags: + - "fake" + summary: "test json serialization of form data" + description: "" + operationId: "testJsonFormData" + consumes: + - "application/json" + parameters: + - name: "param" + in: "formData" + description: "field1" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"param_example\".to_string()" + - name: "param2" + in: "formData" + description: "field2" + required: true + type: "string" + formatString: "\\\"{}\\\"" + example: "\"param2_example\".to_string()" + responses: + 200: + description: "successful operation" + uppercase_operation_id: "TEST_JSON_FORM_DATA" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "test_json_form_data" + uppercase_operation_id: "TEST_JSON_FORM_DATA" + path: "/fake/jsonFormData" + HttpMethod: "Get" + httpmethod: "get" + /fake/xmlFeatures: + get: + summary: "Get some XML" + operationId: "getXmlFeatures" + consumes: + - "application/xml" + produces: + - "application/xml" + parameters: [] + responses: + 200: + description: "Success" + schema: + $ref: "#/definitions/xmlObject" + uppercase_operation_id: "GET_XML_FEATURES" + uppercase_message: "SUCCESS" + uppercase_data_type: "XMLOBJECT" + producesXml: true + has_namespace: "true" + operation_id: "get_xml_features" + uppercase_operation_id: "GET_XML_FEATURES" + path: "/fake/xmlFeatures" + HttpMethod: "Get" + httpmethod: "get" + post: + summary: "Post some xml" + operationId: "postXmlFeatures" + consumes: + - "application/xml" + produces: + - "application/xml" + parameters: + - in: "body" + name: "xmlObject" + required: true + schema: + $ref: "#/definitions/xmlObject" + uppercase_data_type: "XMLOBJECT" + refName: "xmlObject" + formatString: "{:?}" + example: "???" + has_namespace: "true" + model_key: "itemList" + uppercase_operation_id: "POST_XML_FEATURES" + consumesXml: true + responses: + 200: + description: "Success" + uppercase_operation_id: "POST_XML_FEATURES" + uppercase_message: "SUCCESS" + operation_id: "post_xml_features" + uppercase_operation_id: "POST_XML_FEATURES" + path: "/fake/xmlFeatures" + HttpMethod: "Post" + httpmethod: "post" + noClientExample: true + /another-fake/dummy: + patch: + tags: + - "$another-fake?" + summary: "To test special tags" + description: "To test special tags" + operationId: "test_special_tags" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - in: "body" + name: "body" + description: "client model" + required: true + schema: + $ref: "#/definitions/Client" + uppercase_data_type: "CLIENT" + refName: "Client" + formatString: "{:?}" + example: "???" + model_key: "itemList" + uppercase_operation_id: "TEST_SPECIAL_TAGS" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Client" + uppercase_operation_id: "TEST_SPECIAL_TAGS" + uppercase_message: "SUCCESSFUL_OPERATION" + uppercase_data_type: "CLIENT" + operation_id: "test_special_tags" + uppercase_operation_id: "TEST_SPECIAL_TAGS" + path: "/another-fake/dummy" + HttpMethod: "Patch" + httpmethod: "patch" + noClientExample: true +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" + api_key_query: + type: "apiKey" + name: "api_key_query" + in: "query" + http_basic_test: + type: "basic" +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: + - "placedtest" + - "approved" + - "delivered" + complete: + type: "boolean" + default: false + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: "2000-01-23T04:56:07.000+00:00" + complete: false + status: "placedtest" + xml: + name: "Order" + upperCaseName: "ORDER" + Category: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + example: + name: "name" + id: 6 + xml: + name: "Category" + upperCaseName: "CATEGORY" + User: + type: "object" + properties: + id: + type: "integer" + format: "int64" + x-is-unique: true + 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" + example: + firstName: "firstName" + lastName: "lastName" + password: "password" + userStatus: 6 + phone: "phone" + id: 0 + email: "email" + username: "username" + xml: + name: "User" + upperCaseName: "USER" + Tag: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + example: + name: "name" + id: 1 + xml: + name: "Tag" + upperCaseName: "TAG" + Pet: + type: "object" + required: + - "name" + - "photoUrls" + properties: + id: + type: "integer" + format: "int64" + x-is-unique: true + 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" + 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" + upperCaseName: "PET" + ApiResponse: + type: "object" + properties: + code: + type: "integer" + format: "int32" + type: + type: "string" + message: + type: "string" + example: + code: 0 + type: "type" + message: "message" + upperCaseName: "APIRESPONSE" + $special[model.name]: + properties: + $special[property.name]: + type: "integer" + format: "int64" + xml: + name: "$special[model.name]" + upperCaseName: "$SPECIAL[MODEL.NAME]" + Return: + properties: + return: + type: "integer" + format: "int32" + description: "Model for testing reserved words" + xml: + name: "Return" + upperCaseName: "RETURN" + Name: + required: + - "name" + properties: + name: + type: "integer" + format: "int32" + snake_case: + type: "integer" + format: "int32" + readOnly: true + property: + type: "string" + 123Number: + type: "integer" + readOnly: true + description: "Model for testing model name same as property name" + xml: + name: "Name" + upperCaseName: "NAME" + 200_response: + properties: + name: + type: "integer" + format: "int32" + class: + type: "string" + description: "Model for testing model name starting with number" + xml: + name: "Name" + upperCaseName: "200_RESPONSE" + ClassModel: + properties: + _class: + type: "string" + description: "Model for testing model with \"_class\" property" + upperCaseName: "CLASSMODEL" + Dog: + allOf: + - $ref: "#/definitions/Animal" + - type: "object" + properties: + breed: + type: "string" + upperCaseName: "DOG" + Cat: + allOf: + - $ref: "#/definitions/Animal" + - type: "object" + properties: + declawed: + type: "boolean" + upperCaseName: "CAT" + Animal: + type: "object" + required: + - "className" + discriminator: "className" + properties: + className: + type: "string" + color: + type: "string" + default: "red" + upperCaseName: "ANIMAL" + AnimalFarm: + type: "array" + items: + $ref: "#/definitions/Animal" + upperCaseName: "ANIMALFARM" + format_test: + type: "object" + required: + - "byte" + - "date" + - "number" + - "password" + properties: + integer: + type: "integer" + minimum: 10 + maximum: 100 + int32: + type: "integer" + format: "int32" + minimum: 20 + maximum: 200 + int64: + type: "integer" + format: "int64" + number: + type: "number" + minimum: 32.1 + maximum: 543.2 + float: + type: "number" + format: "float" + minimum: 54.3 + maximum: 987.6 + double: + type: "number" + format: "double" + minimum: 67.8 + maximum: 123.4 + string: + type: "string" + pattern: "/[a-z]/i" + byte: + type: "string" + format: "byte" + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + binary: + type: "string" + format: "binary" + date: + type: "string" + format: "date" + dateTime: + type: "string" + format: "date-time" + uuid: + type: "string" + format: "uuid" + password: + type: "string" + format: "password" + minLength: 10 + maxLength: 64 + upperCaseName: "FORMAT_TEST" + EnumClass: + type: "string" + enum: + - "_abc" + - "-efg" + - "(xyz)" + default: "-efg" + upperCaseName: "ENUMCLASS" + Enum_Test: + type: "object" + properties: + enum_string: + type: "string" + enum: + - "UPPER" + - "lower" + - "" + enum_integer: + type: "integer" + format: "int32" + enum: + - 1 + - -1 + enum_number: + type: "number" + format: "double" + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: "#/definitions/OuterEnum" + upperCaseName: "ENUM_TEST" + AdditionalPropertiesClass: + type: "object" + properties: + map_property: + type: "object" + additionalProperties: + type: "string" + map_of_map_property: + type: "object" + additionalProperties: + type: "object" + additionalProperties: + type: "string" + upperCaseName: "ADDITIONALPROPERTIESCLASS" + MixedPropertiesAndAdditionalPropertiesClass: + type: "object" + properties: + uuid: + type: "string" + format: "uuid" + dateTime: + type: "string" + format: "date-time" + map: + type: "object" + additionalProperties: + $ref: "#/definitions/Animal" + upperCaseName: "MIXEDPROPERTIESANDADDITIONALPROPERTIESCLASS" + List: + type: "object" + properties: + 123-list: + type: "string" + upperCaseName: "LIST" + Client: + type: "object" + properties: + client: + type: "string" + example: + client: "client" + upperCaseName: "CLIENT" + ReadOnlyFirst: + type: "object" + properties: + bar: + type: "string" + readOnly: true + baz: + type: "string" + upperCaseName: "READONLYFIRST" + hasOnlyReadOnly: + type: "object" + properties: + bar: + type: "string" + readOnly: true + foo: + type: "string" + readOnly: true + upperCaseName: "HASONLYREADONLY" + Capitalization: + type: "object" + properties: + smallCamel: + type: "string" + CapitalCamel: + type: "string" + small_Snake: + type: "string" + Capital_Snake: + type: "string" + SCA_ETH_Flow_Points: + type: "string" + ATT_NAME: + type: "string" + description: "Name of the pet\n" + upperCaseName: "CAPITALIZATION" + MapTest: + type: "object" + properties: + map_map_of_string: + type: "object" + additionalProperties: + type: "object" + additionalProperties: + type: "string" + map_of_enum_string: + type: "object" + additionalProperties: + type: "string" + enum: + - "UPPER" + - "lower" + upperCaseName: "MAPTEST" + ArrayTest: + type: "object" + properties: + array_of_string: + type: "array" + items: + type: "string" + array_array_of_integer: + type: "array" + items: + type: "array" + items: + type: "integer" + format: "int64" + array_array_of_model: + type: "array" + items: + type: "array" + items: + $ref: "#/definitions/ReadOnlyFirst" + upperCaseName: "ARRAYTEST" + NumberOnly: + type: "object" + properties: + JustNumber: + type: "number" + upperCaseName: "NUMBERONLY" + ArrayOfNumberOnly: + type: "object" + properties: + ArrayNumber: + type: "array" + items: + type: "number" + upperCaseName: "ARRAYOFNUMBERONLY" + ArrayOfArrayOfNumberOnly: + type: "object" + properties: + ArrayArrayNumber: + type: "array" + items: + type: "array" + items: + type: "number" + upperCaseName: "ARRAYOFARRAYOFNUMBERONLY" + EnumArrays: + type: "object" + properties: + just_symbol: + type: "string" + enum: + - ">=" + - "$" + array_enum: + type: "array" + items: + type: "string" + enum: + - "fish" + - "crab" + upperCaseName: "ENUMARRAYS" + OuterEnum: + type: "string" + enum: + - "placed" + - "approved" + - "delivered" + upperCaseName: "OUTERENUM" + OuterNumber: + type: "number" + upperCaseName: "OUTERNUMBER" + OuterString: + type: "string" + upperCaseName: "OUTERSTRING" + OuterBoolean: + type: "boolean" + upperCaseName: "OUTERBOOLEAN" + OuterComposite: + type: "object" + properties: + my_number: + $ref: "#/definitions/OuterNumber" + my_string: + $ref: "#/definitions/OuterString" + my_boolean: + $ref: "#/definitions/OuterBoolean" + example: + my_string: {} + my_number: {} + my_boolean: {} + upperCaseName: "OUTERCOMPOSITE" + xmlObject: + required: + - "itemList" + - "name" + properties: + name: + type: "string" + example: "myXmlObject" + itemList: + $ref: "#/definitions/itemList" + itemXmlName: "item" + xml: + name: "group" + namespace: "http://example.com/schema.xsd" + upperCaseName: "XMLOBJECT" + itemList: + type: "array" + items: + type: "string" + example: "my item" + xml: + name: "item" + upperCaseName: "ITEMLIST" + itemXmlName: "item" +externalDocs: + description: "Find out more about Swagger" + url: "http://swagger.io" diff --git a/samples/client/petstore/rust2/examples/ca.pem b/samples/client/petstore/rust2/examples/ca.pem new file mode 100644 index 00000000000..d2317fb5db7 --- /dev/null +++ b/samples/client/petstore/rust2/examples/ca.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICtjCCAZ4CCQDpKecRERZ0xDANBgkqhkiG9w0BAQsFADAdMQswCQYDVQQGEwJV +UzEOMAwGA1UEAxMFTXkgQ0EwHhcNMTcwNTIzMTYwMDIzWhcNMTcwNjIyMTYwMDIz +WjAdMQswCQYDVQQGEwJVUzEOMAwGA1UEAxMFTXkgQ0EwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCt66py3x7sCSASRF2D05L5wkNDxAUjQKYx23W8Gbwv +GMGykk89BIdU5LX1JB1cKiUOkoIxfwAYuWc2V/wzTvVV7+11besnk3uX1c9KiqUF +LIX7kn/z5hzS4aelhKvH+MJlSZCSlp1ytpZbwo5GB5Pi2SGH56jDBiBoDRNBVdWL +z4wH7TdrQjqWwNxIZumD5OGMtcfJyuX08iPiEOaslOeoMqzObhvjc9aUgjVjhqyA +FkJGTXsi0oaD7oml+NE+mTNfEeZvEJQpLSjBY0OvQHzuHkyGBShBnfu/9x7/NRwd +WaqsLiF7/re9KDGYdJwP7Cu6uxYfKAyWarp6h2mG/GIdAgMBAAEwDQYJKoZIhvcN +AQELBQADggEBAGIl/VVIafeq/AJOQ9r7TzzB2ABJYr7NZa6bTu5O1jSp1Fonac15 +SZ8gvRxODgH22ZYSqghPG4xzq4J3hkytlQqm57ZEt2I2M3OqIp17Ndcc1xDYzpLl +tA0FrVn6crQTM8vQkTDtGesaCWX+7Fir5dK7HnYWzfpSmsOpST07PfbNisEXKOxG +Dj4lBL1OnhTjsJeymVS1pFvkKkrcEJO+IxFiHL3CDsWjcXB0Z+E1zBtPoYyYsNsO +rBrjUxcZewF4xqWZhpW90Mt61fY2nRgU0uUwHcvDQUqvmzKcsqYa4mPKzfBI5mxo +01Ta96cDD6pS5Y1hOflZ0g84f2g/7xBLLDA= +-----END CERTIFICATE----- diff --git a/samples/client/petstore/rust2/examples/client.rs b/samples/client/petstore/rust2/examples/client.rs new file mode 100644 index 00000000000..6fd88afc5b6 --- /dev/null +++ b/samples/client/petstore/rust2/examples/client.rs @@ -0,0 +1,275 @@ +#![allow(missing_docs, unused_variables, trivial_casts)] + +extern crate petstore_api; +#[allow(unused_extern_crates)] +extern crate futures; +#[allow(unused_extern_crates)] +extern crate swagger; +#[allow(unused_extern_crates)] +extern crate uuid; +extern crate clap; + +#[allow(unused_imports)] +use futures::{Future, future, Stream, stream}; +#[allow(unused_imports)] +use petstore_api::{ApiNoContext, ContextWrapperExt, + ApiError, + TestSpecialTagsResponse, + GetXmlFeaturesResponse, + PostXmlFeaturesResponse, + FakeOuterBooleanSerializeResponse, + FakeOuterCompositeSerializeResponse, + FakeOuterNumberSerializeResponse, + FakeOuterStringSerializeResponse, + TestClientModelResponse, + TestEndpointParametersResponse, + TestEnumParametersResponse, + TestJsonFormDataResponse, + TestClassnameResponse, + AddPetResponse, + DeletePetResponse, + FindPetsByStatusResponse, + FindPetsByTagsResponse, + GetPetByIdResponse, + UpdatePetResponse, + UpdatePetWithFormResponse, + UploadFileResponse, + DeleteOrderResponse, + GetInventoryResponse, + GetOrderByIdResponse, + PlaceOrderResponse, + CreateUserResponse, + CreateUsersWithArrayInputResponse, + CreateUsersWithListInputResponse, + DeleteUserResponse, + GetUserByNameResponse, + LoginUserResponse, + LogoutUserResponse, + UpdateUserResponse + }; +use clap::{App, Arg}; + +fn main() { + let matches = App::new("client") + .arg(Arg::with_name("operation") + .help("Sets the operation to run") + .possible_values(&[ + "GetXmlFeatures", + "FakeOuterBooleanSerialize", + "FakeOuterCompositeSerialize", + "FakeOuterNumberSerialize", + "FakeOuterStringSerialize", + "TestEndpointParameters", + "TestEnumParameters", + "TestJsonFormData", + "DeletePet", + "FindPetsByStatus", + "FindPetsByTags", + "GetPetById", + "UpdatePetWithForm", + "UploadFile", + "DeleteOrder", + "GetInventory", + "GetOrderById", + "CreateUsersWithArrayInput", + "CreateUsersWithListInput", + "DeleteUser", + "GetUserByName", + "LoginUser", + "LogoutUser", +]) + .required(true) + .index(1)) + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let client = if matches.is_present("https") { + // Using Simple HTTPS + petstore_api::Client::try_new_https("https://localhost:8080", "examples/ca.pem").expect("Failed to create HTTPS client") + } else { + // Using HTTP + petstore_api::Client::try_new_http("http://localhost:8080").expect("Failed to create HTTP client") + }; + + // Using a non-default `Context` is not required; this is just an example! + let client = client.with_context(petstore_api::Context::new_with_span_id(self::uuid::Uuid::new_v4().to_string())); + + match matches.value_of("operation") { + + // Disabled because there's no example. + // Some("TestSpecialTags") => { + // let result = client.test_special_tags(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("GetXmlFeatures") => { + let result = client.get_xml_features().wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("PostXmlFeatures") => { + // let result = client.post_xml_features(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("FakeOuterBooleanSerialize") => { + let result = client.fake_outer_boolean_serialize(None).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("FakeOuterCompositeSerialize") => { + let result = client.fake_outer_composite_serialize(None).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("FakeOuterNumberSerialize") => { + let result = client.fake_outer_number_serialize(None).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("FakeOuterStringSerialize") => { + let result = client.fake_outer_string_serialize(None).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("TestClientModel") => { + // let result = client.test_client_model(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("TestEndpointParameters") => { + let result = client.test_endpoint_parameters(3.4, 1.2, "pattern_without_delimiter_example".to_string(), swagger::ByteArray("byte_example".to_string().into_bytes()), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Some(swagger::ByteArray(Vec::from("B"))), None, None, Some("password_example".to_string()), Some("callback_example".to_string())).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("TestEnumParameters") => { + let result = client.test_enum_parameters(Some(&Vec::new()), Some("enum_form_string_example".to_string()), Some(&Vec::new()), Some("enum_header_string_example".to_string()), Some(&Vec::new()), Some("enum_query_string_example".to_string()), Some(56), Some(1.2)).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("TestJsonFormData") => { + let result = client.test_json_form_data("param_example".to_string(), "param2_example".to_string()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("TestClassname") => { + // let result = client.test_classname(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + // Disabled because there's no example. + // Some("AddPet") => { + // let result = client.add_pet(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("DeletePet") => { + let result = client.delete_pet(789, Some("api_key_example".to_string())).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("FindPetsByStatus") => { + let result = client.find_pets_by_status(&Vec::new()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("FindPetsByTags") => { + let result = client.find_pets_by_tags(&Vec::new()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("GetPetById") => { + let result = client.get_pet_by_id(789).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("UpdatePet") => { + // let result = client.update_pet(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("UpdatePetWithForm") => { + let result = client.update_pet_with_form(789, Some("name_example".to_string()), Some("status_example".to_string())).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("UploadFile") => { + let result = client.upload_file(789, Some("additional_metadata_example".to_string()), Box::new(future::ok(Some(Box::new(stream::once(Ok(b"hello".to_vec()))) as Box + Send>))) as Box + Send>).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("DeleteOrder") => { + let result = client.delete_order("order_id_example".to_string()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("GetInventory") => { + let result = client.get_inventory().wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("GetOrderById") => { + let result = client.get_order_by_id(789).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("PlaceOrder") => { + // let result = client.place_order(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + // Disabled because there's no example. + // Some("CreateUser") => { + // let result = client.create_user(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + Some("CreateUsersWithArrayInput") => { + let result = client.create_users_with_array_input(&Vec::new()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("CreateUsersWithListInput") => { + let result = client.create_users_with_list_input(&Vec::new()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("DeleteUser") => { + let result = client.delete_user("username_example".to_string()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("GetUserByName") => { + let result = client.get_user_by_name("username_example".to_string()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("LoginUser") => { + let result = client.login_user("username_example".to_string(), "password_example".to_string()).wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + Some("LogoutUser") => { + let result = client.logout_user().wait(); + println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + }, + + // Disabled because there's no example. + // Some("UpdateUser") => { + // let result = client.update_user("username_example".to_string(), ???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + + _ => { + panic!("Invalid operation provided") + } + } +} + diff --git a/samples/client/petstore/rust2/examples/server-chain.pem b/samples/client/petstore/rust2/examples/server-chain.pem new file mode 100644 index 00000000000..47d7e201404 --- /dev/null +++ b/samples/client/petstore/rust2/examples/server-chain.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, CN=My CA + Validity + Not Before: May 23 16:00:23 2017 GMT + Not After : Apr 29 16:00:23 2117 GMT + Subject: CN=localhost, C=US + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c9:d4:43:60:50:fc:d6:0f:38:4d:5d:5e:aa:7c: + c0:5e:a9:ec:d9:93:78:d3:93:72:28:41:f5:08:a5: + ea:ac:67:07:d7:1f:f7:7d:74:69:7e:46:89:20:4b: + 7a:2d:9b:02:08:e7:6f:0f:1d:0c:0f:c7:60:69:19: + 4b:df:7e:ca:75:94:0b:49:71:e3:6d:f2:e8:79:fd: + ed:0a:94:67:55:f3:ca:6b:61:ba:58:b7:2e:dd:7b: + ca:b9:02:9f:24:36:ac:26:8f:04:8f:81:c8:35:10: + f4:aa:33:b2:24:16:f8:f7:1e:ea:f7:16:fe:fa:34: + c3:dd:bb:2c:ba:7a:df:4d:e2:da:1e:e5:d2:28:44: + 6e:c8:96:e0:fd:09:0c:14:0c:31:dc:e0:ca:c1:a7: + 9b:bf:16:8c:f7:36:3f:1b:2e:dd:90:eb:45:78:51: + bf:59:22:1e:c6:8c:0a:69:88:e5:03:5e:73:b7:fc: + 93:7f:1b:46:1b:97:68:c5:c0:8b:35:1f:bb:1e:67: + 7f:55:b7:3b:55:3f:ea:f2:ca:db:cc:52:cd:16:89: + db:15:47:bd:f2:cd:6c:7a:d7:b4:1a:ac:c8:15:6c: + 6a:fb:77:c4:e9:f2:30:e0:14:24:66:65:6f:2a:e5: + 2d:cc:f6:81:ae:57:c8:d1:9b:38:90:dc:60:93:02: + 5e:cb + Exponent: 65537 (0x10001) + Signature Algorithm: sha256WithRSAEncryption + 1c:7c:39:e8:3d:49:b2:09:1e:68:5a:2f:74:18:f4:63:b5:8c: + f6:e6:a1:e3:4d:95:90:99:ef:32:5c:34:40:e8:55:13:0e:e0: + 1c:be:cd:ab:3f:64:38:99:5e:2b:c1:81:53:a0:18:a8:f6:ee: + 6a:33:73:6c:9a:73:9d:86:08:5d:c7:11:38:46:4c:cd:a0:47: + 37:8f:fe:a6:50:a9:02:21:99:42:86:5e:47:fe:65:56:60:1d: + 16:53:86:bd:e4:63:c5:69:cf:fa:30:51:ab:a1:c3:50:53:cc: + 66:1c:4c:ff:3f:2a:39:4d:a2:8f:9d:d1:a7:8b:22:e4:78:69: + 24:06:83:4d:cc:0a:c0:87:69:9b:bc:80:a9:d2:b7:a5:23:84: + 7e:a2:32:26:7c:78:0e:bd:db:cd:3b:69:18:33:b8:44:ef:96: + b4:99:86:ee:06:bd:51:1c:c7:a1:a4:0c:c4:4c:51:a0:df:ac: + 14:07:88:8e:d7:39:45:fe:52:e0:a3:4c:db:5d:7a:ab:4d:e4: + ca:06:e8:bd:74:6f:46:e7:93:4a:4f:1b:67:e7:a5:9f:ef:9c: + 02:49:d1:f2:d5:e9:53:ee:09:21:ac:08:c8:15:f7:af:35:b9: + 4f:11:0f:43:ae:46:8e:fd:5b:8d:a3:4e:a7:2c:b7:25:ed:e4: + e5:94:1d:e3 +-----BEGIN CERTIFICATE----- +MIICtTCCAZ0CAhAAMA0GCSqGSIb3DQEBCwUAMB0xCzAJBgNVBAYTAlVTMQ4wDAYD +VQQDEwVNeSBDQTAgFw0xNzA1MjMxNjAwMjNaGA8yMTE3MDQyOTE2MDAyM1owITES +MBAGA1UEAxMJbG9jYWxob3N0MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMnUQ2BQ/NYPOE1dXqp8wF6p7NmTeNOTcihB9Qil6qxn +B9cf9310aX5GiSBLei2bAgjnbw8dDA/HYGkZS99+ynWUC0lx423y6Hn97QqUZ1Xz +ymthuli3Lt17yrkCnyQ2rCaPBI+ByDUQ9KozsiQW+Pce6vcW/vo0w927LLp6303i +2h7l0ihEbsiW4P0JDBQMMdzgysGnm78WjPc2Pxsu3ZDrRXhRv1kiHsaMCmmI5QNe +c7f8k38bRhuXaMXAizUfux5nf1W3O1U/6vLK28xSzRaJ2xVHvfLNbHrXtBqsyBVs +avt3xOnyMOAUJGZlbyrlLcz2ga5XyNGbOJDcYJMCXssCAwEAATANBgkqhkiG9w0B +AQsFAAOCAQEAHHw56D1JsgkeaFovdBj0Y7WM9uah402VkJnvMlw0QOhVEw7gHL7N +qz9kOJleK8GBU6AYqPbuajNzbJpznYYIXccROEZMzaBHN4/+plCpAiGZQoZeR/5l +VmAdFlOGveRjxWnP+jBRq6HDUFPMZhxM/z8qOU2ij53Rp4si5HhpJAaDTcwKwIdp +m7yAqdK3pSOEfqIyJnx4Dr3bzTtpGDO4RO+WtJmG7ga9URzHoaQMxExRoN+sFAeI +jtc5Rf5S4KNM2116q03kygbovXRvRueTSk8bZ+eln++cAknR8tXpU+4JIawIyBX3 +rzW5TxEPQ65Gjv1bjaNOpyy3Je3k5ZQd4w== +-----END CERTIFICATE----- diff --git a/samples/client/petstore/rust2/examples/server-key.pem b/samples/client/petstore/rust2/examples/server-key.pem new file mode 100644 index 00000000000..29c00682922 --- /dev/null +++ b/samples/client/petstore/rust2/examples/server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ1ENgUPzWDzhN +XV6qfMBeqezZk3jTk3IoQfUIpeqsZwfXH/d9dGl+RokgS3otmwII528PHQwPx2Bp +GUvffsp1lAtJceNt8uh5/e0KlGdV88prYbpYty7de8q5Ap8kNqwmjwSPgcg1EPSq +M7IkFvj3Hur3Fv76NMPduyy6et9N4toe5dIoRG7IluD9CQwUDDHc4MrBp5u/Foz3 +Nj8bLt2Q60V4Ub9ZIh7GjAppiOUDXnO3/JN/G0Ybl2jFwIs1H7seZ39VtztVP+ry +ytvMUs0WidsVR73yzWx617QarMgVbGr7d8Tp8jDgFCRmZW8q5S3M9oGuV8jRmziQ +3GCTAl7LAgMBAAECggEBAKEd1q9j14KWYc64s6KLthGbutyxsinMMbxbct11fdIk +6YhdF3fJ35ETg9IJDr6rWEN9ZRX+jStncNpVfFEs6ThVd3Eo/nI+EEGaaIkikR93 +X2a7fEPn7/yVHu70XdBN6L1bPDvHUeiy4W2hmRrgT90OjGm1rNRWHOm7yugOwIZu +HclzbR9Ca7EInFnotUiDQm9sw9VKHbJHqWx6OORdZrxR2ytYs0Qkq0XpGMvti2HW +7WAmKTg5QM8myXW7+/4iqb/u68wVBR2BBalShKmIf7lim9O3W2a1RjDdsvm/wNe9 +I+D+Iq825vpqkKXcrxYlpVg7hYiaQaW/MNsEb7lQRjECgYEA/RJYby0POW+/k0Jn +jO8UmJVEMiuGa8WIUu/JJWMOmzRCukjSRNQOkt7niQrZPJYE8W6clM6RJTolWf9L +IL6mIb+mRaoudUk8SHGDq7ho1iMg9GK8lhYxvKh1Q6uv8EyVSkgLknAEY0NANKC1 +zNdU5Dhven9aRX2gq9vP4XwMz2MCgYEAzCogQ7IFk+gkp3k491dOZnrGRoRCfuzo +4CJtyKFgOSd7BjmpcKkj0IPfVBjw6GjMIxfQRMTQmxAjjWevH45vG8l0Iiwz/gSp +81b5nsDEX5uv2Olcmcz5zxRFy36jOZ9ihMWinxcIlT2oDbyCdbruDKZq9ieJ9S8g +4qGx0OkwE3kCgYEA7CmAiU89U9YqqttfEq/RQoqY91CSwmO10d+ej9seuEtOsdRf +FIfnibulycdr7hP5TOxyBpO1802NqayJiWcgVYIpQf2MGTtcnCYCP+95NcvWZvj1 +EAJqK6nwtFO1fcOZ1ZXh5qfOEGujsPkAbsXLnKXlsiTCMvMHSxl3pu5Cbg0CgYBf +JjbZNctRrjv+7Qj2hPLd4dQsIxGWc7ToWENP4J2mpVa5hQAJqFovoHXhjKohtk2F +AWEn243Y5oGbMjo0e74edhmwn2cvuF64MM2vBem/ISCn98IXT6cQskMA3qkVfsl8 +VVs/x41ReGWs2TD3y0GMFbb9t1mdMfSiincDhNnKCQKBgGfeT4jKyYeCoCw4OLI1 +G75Gd0METt/IkppwODPpNwj3Rp9I5jctWZFA/3wCX/zk0HgBeou5AFNS4nQZ/X/L +L9axbSdR7UJTGkT1r4gu3rLkPV4Tk+8XM03/JT2cofMlzQBuhvl1Pn4SgKowz7hl +lS76ECw4Av3T0S34VW9Z5oye +-----END PRIVATE KEY----- diff --git a/samples/client/petstore/rust2/examples/server.rs b/samples/client/petstore/rust2/examples/server.rs new file mode 100644 index 00000000000..f3f3f50de4b --- /dev/null +++ b/samples/client/petstore/rust2/examples/server.rs @@ -0,0 +1,58 @@ +#![allow(missing_docs)] + +extern crate petstore_api; +extern crate iron; +extern crate futures; +extern crate hyper_openssl; +extern crate clap; +extern crate swagger; + +use hyper_openssl::OpensslServer; +use hyper_openssl::openssl::x509::X509_FILETYPE_PEM; +use hyper_openssl::openssl::ssl::{SslAcceptorBuilder, SslMethod}; +use hyper_openssl::openssl::error::ErrorStack; +use clap::{App, Arg}; +use iron::{Iron, Chain}; +use swagger::auth::AllowAllMiddleware; + +// Import the module that defines the Server struct. +mod server_lib; + +/// Builds an SSL implementation for Simple HTTPS from some hard-coded file names +fn ssl() -> Result { + let mut ssl = SslAcceptorBuilder::mozilla_intermediate_raw(SslMethod::tls())?; + + // Server authentication + ssl.builder_mut().set_private_key_file("examples/server-key.pem", X509_FILETYPE_PEM)?; + ssl.builder_mut().set_certificate_chain_file("examples/server-chain.pem")?; + ssl.builder_mut().check_private_key()?; + + Ok(OpensslServer::from(ssl.build())) +} + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +fn main() { + let matches = App::new("server") + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let server = server_lib::Server{}; + let router = petstore_api::router(server); + + let mut chain = Chain::new(router); + chain.link_before(petstore_api::server::ExtractAuthData); + // add authentication middlewares into the chain here + // for the purpose of this example, pretend we have authenticated a user + chain.link_before(AllowAllMiddleware::new("cosmo")); + + if matches.is_present("https") { + // Using Simple HTTPS + Iron::new(chain).https("localhost:8080", ssl().expect("Failed to load SSL keys")).expect("Failed to start HTTPS server"); + } else { + // Using HTTP + Iron::new(chain).http("localhost:8080").expect("Failed to start HTTP server"); + } +} diff --git a/samples/client/petstore/rust2/examples/server_lib/mod.rs b/samples/client/petstore/rust2/examples/server_lib/mod.rs new file mode 100644 index 00000000000..598d4a0e946 --- /dev/null +++ b/samples/client/petstore/rust2/examples/server_lib/mod.rs @@ -0,0 +1,279 @@ +#![allow(missing_docs, unused_extern_crates)] +extern crate chrono; +extern crate swagger; + +use futures::{self, Future}; +use futures::Stream; + +#[allow(unused_imports)] +use std::collections::HashMap; +use std::io::Error; + +use petstore_api::{Api, ApiError, Context, + TestSpecialTagsResponse, + GetXmlFeaturesResponse, + PostXmlFeaturesResponse, + FakeOuterBooleanSerializeResponse, + FakeOuterCompositeSerializeResponse, + FakeOuterNumberSerializeResponse, + FakeOuterStringSerializeResponse, + TestClientModelResponse, + TestEndpointParametersResponse, + TestEnumParametersResponse, + TestJsonFormDataResponse, + TestClassnameResponse, + AddPetResponse, + DeletePetResponse, + FindPetsByStatusResponse, + FindPetsByTagsResponse, + GetPetByIdResponse, + UpdatePetResponse, + UpdatePetWithFormResponse, + UploadFileResponse, + DeleteOrderResponse, + GetInventoryResponse, + GetOrderByIdResponse, + PlaceOrderResponse, + CreateUserResponse, + CreateUsersWithArrayInputResponse, + CreateUsersWithListInputResponse, + DeleteUserResponse, + GetUserByNameResponse, + LoginUserResponse, + LogoutUserResponse, + UpdateUserResponse +}; +#[allow(unused_imports)] +use petstore_api::models; + +#[derive(Copy, Clone)] +pub struct Server; + +impl Api for Server { + + /// To test special tags + fn test_special_tags(&self, body: models::Client, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_special_tags({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Get some XML + fn get_xml_features(&self, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("get_xml_features() - X-Span-ID: {:?}", context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Post some xml + fn post_xml_features(&self, xml_object: models::XmlObject, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("post_xml_features({:?}) - X-Span-ID: {:?}", xml_object, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn fake_outer_boolean_serialize(&self, body: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("fake_outer_boolean_serialize({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn fake_outer_composite_serialize(&self, body: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("fake_outer_composite_serialize({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn fake_outer_number_serialize(&self, body: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("fake_outer_number_serialize({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn fake_outer_string_serialize(&self, body: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("fake_outer_string_serialize({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// To test \"client\" model + fn test_client_model(&self, body: models::Client, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_client_model({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_endpoint_parameters({}, {}, \"{}\", \"{:?}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// To test enum parameters + fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_enum_parameters({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", enum_form_string_array, enum_form_string, enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// test json serialization of form data + fn test_json_form_data(&self, param: String, param2: String, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_json_form_data(\"{}\", \"{}\") - X-Span-ID: {:?}", param, param2, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// To test class name in snake case + fn test_classname(&self, body: models::Client, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_classname({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Add a new pet to the store + fn add_pet(&self, body: models::Pet, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("add_pet({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Deletes a pet + fn delete_pet(&self, pet_id: i64, api_key: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("delete_pet({}, {:?}) - X-Span-ID: {:?}", pet_id, api_key, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Finds Pets by status + fn find_pets_by_status(&self, status: &Vec, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("find_pets_by_status({:?}) - X-Span-ID: {:?}", status, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Finds Pets by tags + fn find_pets_by_tags(&self, tags: &Vec, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("find_pets_by_tags({:?}) - X-Span-ID: {:?}", tags, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Find pet by ID + fn get_pet_by_id(&self, pet_id: i64, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("get_pet_by_id({}) - X-Span-ID: {:?}", pet_id, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Update an existing pet + fn update_pet(&self, body: models::Pet, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("update_pet({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Updates a pet in the store with form data + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("update_pet_with_form({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, name, status, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// uploads an image + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Box, Error=Error> + Send>>, Error=Error> + Send>, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("upload_file({}, {:?}, ) - X-Span-ID: {:?}", pet_id, additional_metadata, context.x_span_id.unwrap_or(String::from("")).clone()); + let _ = file; //Suppresses unused param warning + Box::new(futures::failed("Generic failure".into())) + } + + /// Delete purchase order by ID + fn delete_order(&self, order_id: String, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("delete_order(\"{}\") - X-Span-ID: {:?}", order_id, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Returns pet inventories by status + fn get_inventory(&self, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("get_inventory() - X-Span-ID: {:?}", context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Find purchase order by ID + fn get_order_by_id(&self, order_id: i64, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("get_order_by_id({}) - X-Span-ID: {:?}", order_id, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Place an order for a pet + fn place_order(&self, body: models::Order, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("place_order({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Create user + fn create_user(&self, body: models::User, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("create_user({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Creates list of users with given input array + fn create_users_with_array_input(&self, body: &Vec, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("create_users_with_array_input({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Creates list of users with given input array + fn create_users_with_list_input(&self, body: &Vec, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("create_users_with_list_input({:?}) - X-Span-ID: {:?}", body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Delete user + fn delete_user(&self, username: String, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("delete_user(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Get user by user name + fn get_user_by_name(&self, username: String, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("get_user_by_name(\"{}\") - X-Span-ID: {:?}", username, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Logs user into the system + fn login_user(&self, username: String, password: String, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("login_user(\"{}\", \"{}\") - X-Span-ID: {:?}", username, password, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Logs out current logged in user session + fn logout_user(&self, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("logout_user() - X-Span-ID: {:?}", context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + + /// Updated user + fn update_user(&self, username: String, body: models::User, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("update_user(\"{}\", {:?}) - X-Span-ID: {:?}", username, body, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + +} diff --git a/samples/client/petstore/rust2/src/client.rs b/samples/client/petstore/rust2/src/client.rs new file mode 100644 index 00000000000..b5a5e27bf6b --- /dev/null +++ b/samples/client/petstore/rust2/src/client.rs @@ -0,0 +1,1970 @@ +#![allow(unused_extern_crates)] +extern crate hyper_openssl; +extern crate chrono; +extern crate multipart; + +use multipart::client::lazy::Multipart; +use hyper; +use hyper::client::IntoUrl; +use hyper::mime; +use hyper::header::{Headers, ContentType}; +use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; +use hyper::Url; +use self::hyper_openssl::openssl; +use futures; +use futures::{Future, Stream}; +use futures::{future, stream}; +use std::borrow::Cow; +use std::io::{Read, Error}; +use std::error; +use std::fmt; +use std::path::Path; +use std::sync::Arc; +use std::str; + +use mimetypes; + +use serde_json; +use serde_xml_rs; + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; + +use swagger::{Context, ApiError, XSpanId}; + +use {Api, + TestSpecialTagsResponse, + GetXmlFeaturesResponse, + PostXmlFeaturesResponse, + FakeOuterBooleanSerializeResponse, + FakeOuterCompositeSerializeResponse, + FakeOuterNumberSerializeResponse, + FakeOuterStringSerializeResponse, + TestClientModelResponse, + TestEndpointParametersResponse, + TestEnumParametersResponse, + TestJsonFormDataResponse, + TestClassnameResponse, + AddPetResponse, + DeletePetResponse, + FindPetsByStatusResponse, + FindPetsByTagsResponse, + GetPetByIdResponse, + UpdatePetResponse, + UpdatePetWithFormResponse, + UploadFileResponse, + DeleteOrderResponse, + GetInventoryResponse, + GetOrderByIdResponse, + PlaceOrderResponse, + CreateUserResponse, + CreateUsersWithArrayInputResponse, + CreateUsersWithListInputResponse, + DeleteUserResponse, + GetUserByNameResponse, + LoginUserResponse, + LogoutUserResponse, + UpdateUserResponse + }; +use models; + +/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. +fn into_base_path(input: T, correct_scheme: Option<&'static str>) -> Result { + // First convert to Url, since a base path is a subset of Url. + let url = input.into_url()?; + + let scheme = url.scheme(); + + // Check the scheme if necessary + if let Some(correct_scheme) = correct_scheme { + if scheme != correct_scheme { + return Err(ClientInitError::InvalidScheme); + } + } + + let host = url.host().ok_or_else(|| ClientInitError::MissingHost)?; + let port = url.port().map(|x| format!(":{}", x)).unwrap_or_default(); + Ok(format!("{}://{}{}", scheme, host, port)) +} + +/// A client that implements the API by making HTTP calls out to a server. +#[derive(Clone)] +pub struct Client { + base_path: String, + hyper_client: Arc hyper::client::Client + Sync + Send>, +} + +impl fmt::Debug for Client { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Client {{ base_path: {} }}", self.base_path) + } +} + +impl Client { + pub fn try_new_http(base_path: T) -> Result + where T: IntoUrl + { + Ok(Client { + base_path: into_base_path(base_path, Some("http"))?, + hyper_client: Arc::new(hyper::client::Client::new), + }) + } + + pub fn try_new_https(base_path: T, + ca_certificate: CA) + -> Result + where T: IntoUrl, + CA: AsRef + { + let ca_certificate = ca_certificate.as_ref().to_owned(); + + let https_hyper_client = move || { + // SSL implementation + let mut ssl = openssl::ssl::SslConnectorBuilder::new(openssl::ssl::SslMethod::tls()).unwrap(); + + // Server authentication + ssl.builder_mut().set_ca_file(ca_certificate.clone()).unwrap(); + + let ssl = hyper_openssl::OpensslClient::from(ssl.build()); + let connector = hyper::net::HttpsConnector::new(ssl); + hyper::client::Client::with_connector(connector) + }; + + Ok(Client { + base_path: into_base_path(base_path, Some("https"))?, + hyper_client: Arc::new(https_hyper_client), + }) + } + + pub fn try_new_https_mutual(base_path: T, + ca_certificate: CA, + client_key: K, + client_certificate: C) + -> Result + where T: IntoUrl, + CA: AsRef, + K: AsRef, + C: AsRef + { + let ca_certificate = ca_certificate.as_ref().to_owned(); + let client_key = client_key.as_ref().to_owned(); + let client_certificate = client_certificate.as_ref().to_owned(); + + let https_mutual_hyper_client = move || { + // SSL implementation + let mut ssl = openssl::ssl::SslConnectorBuilder::new(openssl::ssl::SslMethod::tls()).unwrap(); + + // Server authentication + ssl.builder_mut().set_ca_file(ca_certificate.clone()).unwrap(); + + // Client authentication + ssl.builder_mut().set_private_key_file(client_key.clone(), openssl::x509::X509_FILETYPE_PEM).unwrap(); + ssl.builder_mut().set_certificate_chain_file(client_certificate.clone()).unwrap(); + ssl.builder_mut().check_private_key().unwrap(); + + let ssl = hyper_openssl::OpensslClient::from(ssl.build()); + let connector = hyper::net::HttpsConnector::new(ssl); + hyper::client::Client::with_connector(connector) + }; + + Ok(Client { + base_path: into_base_path(base_path, Some("https"))?, + hyper_client: Arc::new(https_mutual_hyper_client) + }) + } + + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client. + /// + /// One should avoid relying on this function if possible, since it adds a dependency on the underlying transport + /// implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of + /// code generality, which may make it harder to move the application to a serverless environment, for example. + /// + /// The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. + /// This is not a recommended way to write new tests. If other reasons are found for using this function, they + /// should be mentioned here. + pub fn try_new_with_hyper_client(base_path: T, + hyper_client: Arc hyper::client::Client + Sync + Send>) + -> Result + where T: IntoUrl + { + Ok(Client { + base_path: into_base_path(base_path, None)?, + hyper_client: hyper_client + }) + } +} + +impl Api for Client { + + fn test_special_tags(&self, param_body: models::Client, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/another-fake/dummy?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Patch, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::TEST_SPECIAL_TAGS.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(TestSpecialTagsResponse::SuccessfulOperation(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn get_xml_features(&self, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/xmlFeatures?", self.base_path); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(GetXmlFeaturesResponse::Success(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn post_xml_features(&self, param_xml_object: models::XmlObject, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/xmlFeatures?", self.base_path); + + + + let mut namespaces = BTreeMap::new(); + // An empty string is used to indicate a global namespace in xmltree. + namespaces.insert("".to_string(), models::namespaces::XMLOBJECT.clone()); + let body = serde_xml_rs::to_string_with_namespaces(¶m_xml_object, namespaces).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::POST_XML_FEATURES.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + + + Ok(PostXmlFeaturesResponse::Success) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn fake_outer_boolean_serialize(&self, param_body: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/outer/boolean?", self.base_path); + + let body = param_body.map(|ref body| { + + serde_json::to_string(body).expect("impossible to fail to serialize") + }); + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = match body { + Some(ref body) => request.body(body), + None => request, + }; + + custom_headers.set(ContentType(mimetypes::requests::FAKE_OUTER_BOOLEAN_SERIALIZE.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(FakeOuterBooleanSerializeResponse::OutputBoolean(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn fake_outer_composite_serialize(&self, param_body: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/outer/composite?", self.base_path); + + let body = param_body.map(|ref body| { + + serde_json::to_string(body).expect("impossible to fail to serialize") + }); + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = match body { + Some(ref body) => request.body(body), + None => request, + }; + + custom_headers.set(ContentType(mimetypes::requests::FAKE_OUTER_COMPOSITE_SERIALIZE.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(FakeOuterCompositeSerializeResponse::OutputComposite(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn fake_outer_number_serialize(&self, param_body: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/outer/number?", self.base_path); + + let body = param_body.map(|ref body| { + + serde_json::to_string(body).expect("impossible to fail to serialize") + }); + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = match body { + Some(ref body) => request.body(body), + None => request, + }; + + custom_headers.set(ContentType(mimetypes::requests::FAKE_OUTER_NUMBER_SERIALIZE.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(FakeOuterNumberSerializeResponse::OutputNumber(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn fake_outer_string_serialize(&self, param_body: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/outer/string?", self.base_path); + + let body = param_body.map(|ref body| { + + serde_json::to_string(body).expect("impossible to fail to serialize") + }); + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = match body { + Some(ref body) => request.body(body), + None => request, + }; + + custom_headers.set(ContentType(mimetypes::requests::FAKE_OUTER_STRING_SERIALIZE.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(FakeOuterStringSerializeResponse::OutputString(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn test_client_model(&self, param_body: models::Client, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Patch, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::TEST_CLIENT_MODEL.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(TestClientModelResponse::SuccessfulOperation(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn test_endpoint_parameters(&self, param_number: f64, param_double: f64, param_pattern_without_delimiter: String, param_byte: swagger::ByteArray, param_integer: Option, param_int32: Option, param_int64: Option, param_float: Option, param_string: Option, param_binary: Option, param_date: Option>, param_date_time: Option>, param_password: Option, param_callback: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake?", self.base_path); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(TestEndpointParametersResponse::InvalidUsernameSupplied) + }, + 404 => { + + + Ok(TestEndpointParametersResponse::UserNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn test_enum_parameters(&self, param_enum_form_string_array: Option<&Vec>, param_enum_form_string: Option, param_enum_header_string_array: Option<&Vec>, param_enum_header_string: Option, param_enum_query_string_array: Option<&Vec>, param_enum_query_string: Option, param_enum_query_integer: Option, param_enum_query_double: Option, context: &Context) -> Box + Send> { + + // Query parameters + let query_enum_query_string_array = param_enum_query_string_array.map_or_else(String::new, |query| format!("enum_query_string_array={enum_query_string_array}&", enum_query_string_array=query.join(","))); + let query_enum_query_string = param_enum_query_string.map_or_else(String::new, |query| format!("enum_query_string={enum_query_string}&", enum_query_string=query.to_string())); + let query_enum_query_integer = param_enum_query_integer.map_or_else(String::new, |query| format!("enum_query_integer={enum_query_integer}&", enum_query_integer=query.to_string())); + + + let url = format!("{}/v2/fake?{enum_query_string_array}{enum_query_string}{enum_query_integer}", self.base_path, enum_query_string_array=query_enum_query_string_array, enum_query_string=query_enum_query_string, enum_query_integer=query_enum_query_integer); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + // Header parameters + header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } + param_enum_header_string_array.map(|header| custom_headers.set(RequestEnumHeaderStringArray(header.clone()))); + header! { (RequestEnumHeaderString, "enum_header_string") => [String] } + param_enum_header_string.map(|header| custom_headers.set(RequestEnumHeaderString(header))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(TestEnumParametersResponse::InvalidRequest) + }, + 404 => { + + + Ok(TestEnumParametersResponse::NotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn test_json_form_data(&self, param_param: String, param_param2: String, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/jsonFormData?", self.base_path); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + + + Ok(TestJsonFormDataResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn test_classname(&self, param_body: models::Client, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake_classname_test?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Patch, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::TEST_CLASSNAME.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(TestClassnameResponse::SuccessfulOperation(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn add_pet(&self, param_body: models::Pet, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet?", self.base_path); + + + let body = serde_xml_rs::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::ADD_PET.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 405 => { + + + Ok(AddPetResponse::InvalidInput) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn delete_pet(&self, param_pet_id: i64, param_api_key: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet/{petId}?", self.base_path, petId=param_pet_id.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Delete, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + // Header parameters + header! { (RequestApiKey, "api_key") => [String] } + param_api_key.map(|header| custom_headers.set(RequestApiKey(header))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(DeletePetResponse::InvalidPetValue) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn find_pets_by_status(&self, param_status: &Vec, context: &Context) -> Box + Send> { + + // Query parameters + let query_status = format!("status={status}&", status=param_status.join(",")); + + + let url = format!("{}/v2/pet/findByStatus?{status}", self.base_path, status=query_status); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::>(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(FindPetsByStatusResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(FindPetsByStatusResponse::InvalidStatusValue) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn find_pets_by_tags(&self, param_tags: &Vec, context: &Context) -> Box + Send> { + + // Query parameters + let query_tags = format!("tags={tags}&", tags=param_tags.join(",")); + + + let url = format!("{}/v2/pet/findByTags?{tags}", self.base_path, tags=query_tags); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::>(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(FindPetsByTagsResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(FindPetsByTagsResponse::InvalidTagValue) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn get_pet_by_id(&self, param_pet_id: i64, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet/{petId}?", self.base_path, petId=param_pet_id.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(GetPetByIdResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(GetPetByIdResponse::InvalidIDSupplied) + }, + 404 => { + + + Ok(GetPetByIdResponse::PetNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn update_pet(&self, param_body: models::Pet, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet?", self.base_path); + + + let body = serde_xml_rs::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Put, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::UPDATE_PET.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(UpdatePetResponse::InvalidIDSupplied) + }, + 404 => { + + + Ok(UpdatePetResponse::PetNotFound) + }, + 405 => { + + + Ok(UpdatePetResponse::ValidationException) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn update_pet_with_form(&self, param_pet_id: i64, param_name: Option, param_status: Option, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet/{petId}?", self.base_path, petId=param_pet_id.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 405 => { + + + Ok(UpdatePetWithFormResponse::InvalidInput) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn upload_file(&self, param_pet_id: i64, param_additional_metadata: Option, param_file: Box, Error=Error> + Send>>, Error=Error> + Send>, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/pet/{petId}/uploadImage?", self.base_path, petId=param_pet_id.to_string()); + + // Form data body + let mut multipart = Multipart::new(); + + if let Ok(Some(param_file)) = param_file.wait() { + match convert_stream_to_string(param_file) { + Ok(param_file) => { + // Add file to multipart form. + multipart.add_text("file", param_file); + }, + Err(err) => return Box::new(futures::done(Err(err))), + } + } + + let mut fields = match multipart.prepare() { + Ok(fields) => fields, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))), + }; + + let mut body_string = String::new(); + let body = fields.to_body().read_to_string(&mut body_string); + let boundary = fields.boundary(); + let multipart_header = Mime(TopLevel::Multipart, SubLevel::FormData, vec![(Attr::Boundary, Value::Ext(boundary.to_string()))]); + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + let request = request.header(ContentType(multipart_header)) + .body(&body_string); + + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(&buf)?; + + + + Ok(UploadFileResponse::SuccessfulOperation(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + // Helper function to convert a Stream into a String. The String can then be used to build the HTTP body. + fn convert_stream_to_string(stream: Box, Error=Error> + Send>) -> Result { + + stream.fold(Vec::new(), |mut body, chunk| { + body.extend(chunk.iter()); + future::ok::,Error>(body) + }).wait() + .map_err(|e| ApiError(format!("Unable to fold stream: {}", e))) + .and_then(|body| String::from_utf8(body) + .map_err(|e| ApiError(format!("Failed to convert utf8 stream to String: {}", e)))) + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn delete_order(&self, param_order_id: String, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/store/order/{order_id}?", self.base_path, order_id=param_order_id.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Delete, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(DeleteOrderResponse::InvalidIDSupplied) + }, + 404 => { + + + Ok(DeleteOrderResponse::OrderNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn get_inventory(&self, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/store/inventory?", self.base_path); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::>(&buf)?; + + + + Ok(GetInventoryResponse::SuccessfulOperation(body)) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn get_order_by_id(&self, param_order_id: i64, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/store/order/{order_id}?", self.base_path, order_id=param_order_id.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(GetOrderByIdResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(GetOrderByIdResponse::InvalidIDSupplied) + }, + 404 => { + + + Ok(GetOrderByIdResponse::OrderNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn place_order(&self, param_body: models::Order, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/store/order?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::PLACE_ORDER.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(PlaceOrderResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(PlaceOrderResponse::InvalidOrder) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn create_user(&self, param_body: models::User, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::CREATE_USER.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 0 => { + + + Ok(CreateUserResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn create_users_with_array_input(&self, param_body: &Vec, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/createWithArray?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::CREATE_USERS_WITH_ARRAY_INPUT.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 0 => { + + + Ok(CreateUsersWithArrayInputResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn create_users_with_list_input(&self, param_body: &Vec, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/createWithList?", self.base_path); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::CREATE_USERS_WITH_LIST_INPUT.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 0 => { + + + Ok(CreateUsersWithListInputResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn delete_user(&self, param_username: String, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/{username}?", self.base_path, username=param_username.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Delete, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(DeleteUserResponse::InvalidUsernameSupplied) + }, + 404 => { + + + Ok(DeleteUserResponse::UserNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn get_user_by_name(&self, param_username: String, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/{username}?", self.base_path, username=param_username.to_string()); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + + Ok(GetUserByNameResponse::SuccessfulOperation(body)) + }, + 400 => { + + + Ok(GetUserByNameResponse::InvalidUsernameSupplied) + }, + 404 => { + + + Ok(GetUserByNameResponse::UserNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn login_user(&self, param_username: String, param_password: String, context: &Context) -> Box + Send> { + + // Query parameters + let query_username = format!("username={username}&", username=param_username.to_string()); + let query_password = format!("password={password}&", password=param_password.to_string()); + + + let url = format!("{}/v2/user/login?{username}{password}", self.base_path, username=query_username, password=query_password); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + // ToDo: this will move to swagger-rs and become a standard From conversion trait + // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + let body = serde_xml_rs::from_str::(&buf) + .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; + + header! { (ResponseXRateLimit, "X-Rate-Limit") => [i32] } + let response_x_rate_limit = response.headers.get::().ok_or_else(|| "Required response header X-Rate-Limit for response 200 was not found.")?; + header! { (ResponseXExpiresAfter, "X-Expires-After") => [chrono::DateTime] } + let response_x_expires_after = response.headers.get::().ok_or_else(|| "Required response header X-Expires-After for response 200 was not found.")?; + + Ok(LoginUserResponse::SuccessfulOperation{ body: body, x_rate_limit: response_x_rate_limit.0.clone(), x_expires_after: response_x_expires_after.0.clone() }) + }, + 400 => { + + + Ok(LoginUserResponse::InvalidUsername) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn logout_user(&self, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/logout?", self.base_path); + + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Get, &url); + let mut custom_headers = hyper::header::Headers::new(); + + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 0 => { + + + Ok(LogoutUserResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + + fn update_user(&self, param_username: String, param_body: models::User, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/user/{username}?", self.base_path, username=param_username.to_string()); + + + let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Put, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::UPDATE_USER.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 400 => { + + + Ok(UpdateUserResponse::InvalidUserSupplied) + }, + 404 => { + + + Ok(UpdateUserResponse::UserNotFound) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + +} + +#[derive(Debug)] +pub enum ClientInitError { + InvalidScheme, + InvalidUrl(hyper::error::ParseError), + MissingHost, + SslError(openssl::error::ErrorStack) +} + +impl From for ClientInitError { + fn from(err: hyper::error::ParseError) -> ClientInitError { + ClientInitError::InvalidUrl(err) + } +} + +impl From for ClientInitError { + fn from(err: openssl::error::ErrorStack) -> ClientInitError { + ClientInitError::SslError(err) + } +} + +impl fmt::Display for ClientInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + (self as &fmt::Debug).fmt(f) + } +} + +impl error::Error for ClientInitError { + fn description(&self) -> &str { + "Failed to produce a hyper client." + } +} diff --git a/samples/client/petstore/rust2/src/lib.rs b/samples/client/petstore/rust2/src/lib.rs new file mode 100644 index 00000000000..a923266374c --- /dev/null +++ b/samples/client/petstore/rust2/src/lib.rs @@ -0,0 +1,606 @@ +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; +extern crate serde_xml_rs; +extern crate futures; +extern crate chrono; +extern crate multipart; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; + +// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. +#[cfg(any(feature = "client", feature = "server"))] +#[macro_use] +extern crate hyper; + +extern crate swagger; + +use futures::Stream; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::HashMap; + +pub use futures::Future; + +#[cfg(any(feature = "client", feature = "server"))] +mod mimetypes; + +pub use swagger::{ApiError, Context, ContextWrapper}; + + +#[derive(Debug, PartialEq)] +pub enum TestSpecialTagsResponse { + SuccessfulOperation ( models::Client ) , +} + +#[derive(Debug, PartialEq)] +pub enum GetXmlFeaturesResponse { + Success ( models::XmlObject ) , +} + +#[derive(Debug, PartialEq)] +pub enum PostXmlFeaturesResponse { + Success , +} + +#[derive(Debug, PartialEq)] +pub enum FakeOuterBooleanSerializeResponse { + OutputBoolean ( models::OuterBoolean ) , +} + +#[derive(Debug, PartialEq)] +pub enum FakeOuterCompositeSerializeResponse { + OutputComposite ( models::OuterComposite ) , +} + +#[derive(Debug, PartialEq)] +pub enum FakeOuterNumberSerializeResponse { + OutputNumber ( models::OuterNumber ) , +} + +#[derive(Debug, PartialEq)] +pub enum FakeOuterStringSerializeResponse { + OutputString ( models::OuterString ) , +} + +#[derive(Debug, PartialEq)] +pub enum TestClientModelResponse { + SuccessfulOperation ( models::Client ) , +} + +#[derive(Debug, PartialEq)] +pub enum TestEndpointParametersResponse { + InvalidUsernameSupplied , + UserNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum TestEnumParametersResponse { + InvalidRequest , + NotFound , +} + +#[derive(Debug, PartialEq)] +pub enum TestJsonFormDataResponse { + SuccessfulOperation , +} + +#[derive(Debug, PartialEq)] +pub enum TestClassnameResponse { + SuccessfulOperation ( models::Client ) , +} + +#[derive(Debug, PartialEq)] +pub enum AddPetResponse { + InvalidInput , +} + +#[derive(Debug, PartialEq)] +pub enum DeletePetResponse { + InvalidPetValue , +} + +#[derive(Debug, PartialEq)] +pub enum FindPetsByStatusResponse { + SuccessfulOperation ( Vec ) , + InvalidStatusValue , +} + +#[derive(Debug, PartialEq)] +pub enum FindPetsByTagsResponse { + SuccessfulOperation ( Vec ) , + InvalidTagValue , +} + +#[derive(Debug, PartialEq)] +pub enum GetPetByIdResponse { + SuccessfulOperation ( models::Pet ) , + InvalidIDSupplied , + PetNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum UpdatePetResponse { + InvalidIDSupplied , + PetNotFound , + ValidationException , +} + +#[derive(Debug, PartialEq)] +pub enum UpdatePetWithFormResponse { + InvalidInput , +} + +#[derive(Debug, PartialEq)] +pub enum UploadFileResponse { + SuccessfulOperation ( models::ApiResponse ) , +} + +#[derive(Debug, PartialEq)] +pub enum DeleteOrderResponse { + InvalidIDSupplied , + OrderNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum GetInventoryResponse { + SuccessfulOperation ( HashMap ) , +} + +#[derive(Debug, PartialEq)] +pub enum GetOrderByIdResponse { + SuccessfulOperation ( models::Order ) , + InvalidIDSupplied , + OrderNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum PlaceOrderResponse { + SuccessfulOperation ( models::Order ) , + InvalidOrder , +} + +#[derive(Debug, PartialEq)] +pub enum CreateUserResponse { + SuccessfulOperation , +} + +#[derive(Debug, PartialEq)] +pub enum CreateUsersWithArrayInputResponse { + SuccessfulOperation , +} + +#[derive(Debug, PartialEq)] +pub enum CreateUsersWithListInputResponse { + SuccessfulOperation , +} + +#[derive(Debug, PartialEq)] +pub enum DeleteUserResponse { + InvalidUsernameSupplied , + UserNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum GetUserByNameResponse { + SuccessfulOperation ( models::User ) , + InvalidUsernameSupplied , + UserNotFound , +} + +#[derive(Debug, PartialEq)] +pub enum LoginUserResponse { + SuccessfulOperation { body: String, x_rate_limit: i32, x_expires_after: chrono::DateTime } , + InvalidUsername , +} + +#[derive(Debug, PartialEq)] +pub enum LogoutUserResponse { + SuccessfulOperation , +} + +#[derive(Debug, PartialEq)] +pub enum UpdateUserResponse { + InvalidUserSupplied , + UserNotFound , +} + + +/// API +pub trait Api { + + /// To test special tags + fn test_special_tags(&self, body: models::Client, context: &Context) -> Box + Send>; + + /// Get some XML + fn get_xml_features(&self, context: &Context) -> Box + Send>; + + /// Post some xml + fn post_xml_features(&self, xml_object: models::XmlObject, context: &Context) -> Box + Send>; + + + fn fake_outer_boolean_serialize(&self, body: Option, context: &Context) -> Box + Send>; + + + fn fake_outer_composite_serialize(&self, body: Option, context: &Context) -> Box + Send>; + + + fn fake_outer_number_serialize(&self, body: Option, context: &Context) -> Box + Send>; + + + fn fake_outer_string_serialize(&self, body: Option, context: &Context) -> Box + Send>; + + /// To test \"client\" model + fn test_client_model(&self, body: models::Client, context: &Context) -> Box + Send>; + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option, context: &Context) -> Box + Send>; + + /// To test enum parameters + fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, context: &Context) -> Box + Send>; + + /// test json serialization of form data + fn test_json_form_data(&self, param: String, param2: String, context: &Context) -> Box + Send>; + + /// To test class name in snake case + fn test_classname(&self, body: models::Client, context: &Context) -> Box + Send>; + + /// Add a new pet to the store + fn add_pet(&self, body: models::Pet, context: &Context) -> Box + Send>; + + /// Deletes a pet + fn delete_pet(&self, pet_id: i64, api_key: Option, context: &Context) -> Box + Send>; + + /// Finds Pets by status + fn find_pets_by_status(&self, status: &Vec, context: &Context) -> Box + Send>; + + /// Finds Pets by tags + fn find_pets_by_tags(&self, tags: &Vec, context: &Context) -> Box + Send>; + + /// Find pet by ID + fn get_pet_by_id(&self, pet_id: i64, context: &Context) -> Box + Send>; + + /// Update an existing pet + fn update_pet(&self, body: models::Pet, context: &Context) -> Box + Send>; + + /// Updates a pet in the store with form data + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option, context: &Context) -> Box + Send>; + + /// uploads an image + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Box, Error=Error> + Send>>, Error=Error> + Send>, context: &Context) -> Box + Send>; + + /// Delete purchase order by ID + fn delete_order(&self, order_id: String, context: &Context) -> Box + Send>; + + /// Returns pet inventories by status + fn get_inventory(&self, context: &Context) -> Box + Send>; + + /// Find purchase order by ID + fn get_order_by_id(&self, order_id: i64, context: &Context) -> Box + Send>; + + /// Place an order for a pet + fn place_order(&self, body: models::Order, context: &Context) -> Box + Send>; + + /// Create user + fn create_user(&self, body: models::User, context: &Context) -> Box + Send>; + + /// Creates list of users with given input array + fn create_users_with_array_input(&self, body: &Vec, context: &Context) -> Box + Send>; + + /// Creates list of users with given input array + fn create_users_with_list_input(&self, body: &Vec, context: &Context) -> Box + Send>; + + /// Delete user + fn delete_user(&self, username: String, context: &Context) -> Box + Send>; + + /// Get user by user name + fn get_user_by_name(&self, username: String, context: &Context) -> Box + Send>; + + /// Logs user into the system + fn login_user(&self, username: String, password: String, context: &Context) -> Box + Send>; + + /// Logs out current logged in user session + fn logout_user(&self, context: &Context) -> Box + Send>; + + /// Updated user + fn update_user(&self, username: String, body: models::User, context: &Context) -> Box + Send>; + +} + +/// API without a `Context` +pub trait ApiNoContext { + + /// To test special tags + fn test_special_tags(&self, body: models::Client) -> Box + Send>; + + /// Get some XML + fn get_xml_features(&self) -> Box + Send>; + + /// Post some xml + fn post_xml_features(&self, xml_object: models::XmlObject) -> Box + Send>; + + + fn fake_outer_boolean_serialize(&self, body: Option) -> Box + Send>; + + + fn fake_outer_composite_serialize(&self, body: Option) -> Box + Send>; + + + fn fake_outer_number_serialize(&self, body: Option) -> Box + Send>; + + + fn fake_outer_string_serialize(&self, body: Option) -> Box + Send>; + + /// To test \"client\" model + fn test_client_model(&self, body: models::Client) -> Box + Send>; + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box + Send>; + + /// To test enum parameters + fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option) -> Box + Send>; + + /// test json serialization of form data + fn test_json_form_data(&self, param: String, param2: String) -> Box + Send>; + + /// To test class name in snake case + fn test_classname(&self, body: models::Client) -> Box + Send>; + + /// Add a new pet to the store + fn add_pet(&self, body: models::Pet) -> Box + Send>; + + /// Deletes a pet + fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box + Send>; + + /// Finds Pets by status + fn find_pets_by_status(&self, status: &Vec) -> Box + Send>; + + /// Finds Pets by tags + fn find_pets_by_tags(&self, tags: &Vec) -> Box + Send>; + + /// Find pet by ID + fn get_pet_by_id(&self, pet_id: i64) -> Box + Send>; + + /// Update an existing pet + fn update_pet(&self, body: models::Pet) -> Box + Send>; + + /// Updates a pet in the store with form data + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box + Send>; + + /// uploads an image + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Box, Error=Error> + Send>>, Error=Error> + Send>) -> Box + Send>; + + /// Delete purchase order by ID + fn delete_order(&self, order_id: String) -> Box + Send>; + + /// Returns pet inventories by status + fn get_inventory(&self) -> Box + Send>; + + /// Find purchase order by ID + fn get_order_by_id(&self, order_id: i64) -> Box + Send>; + + /// Place an order for a pet + fn place_order(&self, body: models::Order) -> Box + Send>; + + /// Create user + fn create_user(&self, body: models::User) -> Box + Send>; + + /// Creates list of users with given input array + fn create_users_with_array_input(&self, body: &Vec) -> Box + Send>; + + /// Creates list of users with given input array + fn create_users_with_list_input(&self, body: &Vec) -> Box + Send>; + + /// Delete user + fn delete_user(&self, username: String) -> Box + Send>; + + /// Get user by user name + fn get_user_by_name(&self, username: String) -> Box + Send>; + + /// Logs user into the system + fn login_user(&self, username: String, password: String) -> Box + Send>; + + /// Logs out current logged in user session + fn logout_user(&self) -> Box + Send>; + + /// Updated user + fn update_user(&self, username: String, body: models::User) -> Box + Send>; + +} + +/// Trait to extend an API to make it easy to bind it to a context. +pub trait ContextWrapperExt<'a> where Self: Sized { + /// Binds this API to a context. + fn with_context(self: &'a Self, context: Context) -> ContextWrapper<'a, Self>; +} + +impl<'a, T: Api + Sized> ContextWrapperExt<'a> for T { + fn with_context(self: &'a T, context: Context) -> ContextWrapper<'a, T> { + ContextWrapper::::new(self, context) + } +} + +impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { + + /// To test special tags + fn test_special_tags(&self, body: models::Client) -> Box + Send> { + self.api().test_special_tags(body, &self.context()) + } + + /// Get some XML + fn get_xml_features(&self) -> Box + Send> { + self.api().get_xml_features(&self.context()) + } + + /// Post some xml + fn post_xml_features(&self, xml_object: models::XmlObject) -> Box + Send> { + self.api().post_xml_features(xml_object, &self.context()) + } + + + fn fake_outer_boolean_serialize(&self, body: Option) -> Box + Send> { + self.api().fake_outer_boolean_serialize(body, &self.context()) + } + + + fn fake_outer_composite_serialize(&self, body: Option) -> Box + Send> { + self.api().fake_outer_composite_serialize(body, &self.context()) + } + + + fn fake_outer_number_serialize(&self, body: Option) -> Box + Send> { + self.api().fake_outer_number_serialize(body, &self.context()) + } + + + fn fake_outer_string_serialize(&self, body: Option) -> Box + Send> { + self.api().fake_outer_string_serialize(body, &self.context()) + } + + /// To test \"client\" model + fn test_client_model(&self, body: models::Client) -> Box + Send> { + self.api().test_client_model(body, &self.context()) + } + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option, int32: Option, int64: Option, float: Option, string: Option, binary: Option, date: Option>, date_time: Option>, password: Option, callback: Option) -> Box + Send> { + self.api().test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, &self.context()) + } + + /// To test enum parameters + fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option) -> Box + Send> { + self.api().test_enum_parameters(enum_form_string_array, enum_form_string, enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, &self.context()) + } + + /// test json serialization of form data + fn test_json_form_data(&self, param: String, param2: String) -> Box + Send> { + self.api().test_json_form_data(param, param2, &self.context()) + } + + /// To test class name in snake case + fn test_classname(&self, body: models::Client) -> Box + Send> { + self.api().test_classname(body, &self.context()) + } + + /// Add a new pet to the store + fn add_pet(&self, body: models::Pet) -> Box + Send> { + self.api().add_pet(body, &self.context()) + } + + /// Deletes a pet + fn delete_pet(&self, pet_id: i64, api_key: Option) -> Box + Send> { + self.api().delete_pet(pet_id, api_key, &self.context()) + } + + /// Finds Pets by status + fn find_pets_by_status(&self, status: &Vec) -> Box + Send> { + self.api().find_pets_by_status(status, &self.context()) + } + + /// Finds Pets by tags + fn find_pets_by_tags(&self, tags: &Vec) -> Box + Send> { + self.api().find_pets_by_tags(tags, &self.context()) + } + + /// Find pet by ID + fn get_pet_by_id(&self, pet_id: i64) -> Box + Send> { + self.api().get_pet_by_id(pet_id, &self.context()) + } + + /// Update an existing pet + fn update_pet(&self, body: models::Pet) -> Box + Send> { + self.api().update_pet(body, &self.context()) + } + + /// Updates a pet in the store with form data + fn update_pet_with_form(&self, pet_id: i64, name: Option, status: Option) -> Box + Send> { + self.api().update_pet_with_form(pet_id, name, status, &self.context()) + } + + /// uploads an image + fn upload_file(&self, pet_id: i64, additional_metadata: Option, file: Box, Error=Error> + Send>>, Error=Error> + Send>) -> Box + Send> { + self.api().upload_file(pet_id, additional_metadata, file, &self.context()) + } + + /// Delete purchase order by ID + fn delete_order(&self, order_id: String) -> Box + Send> { + self.api().delete_order(order_id, &self.context()) + } + + /// Returns pet inventories by status + fn get_inventory(&self) -> Box + Send> { + self.api().get_inventory(&self.context()) + } + + /// Find purchase order by ID + fn get_order_by_id(&self, order_id: i64) -> Box + Send> { + self.api().get_order_by_id(order_id, &self.context()) + } + + /// Place an order for a pet + fn place_order(&self, body: models::Order) -> Box + Send> { + self.api().place_order(body, &self.context()) + } + + /// Create user + fn create_user(&self, body: models::User) -> Box + Send> { + self.api().create_user(body, &self.context()) + } + + /// Creates list of users with given input array + fn create_users_with_array_input(&self, body: &Vec) -> Box + Send> { + self.api().create_users_with_array_input(body, &self.context()) + } + + /// Creates list of users with given input array + fn create_users_with_list_input(&self, body: &Vec) -> Box + Send> { + self.api().create_users_with_list_input(body, &self.context()) + } + + /// Delete user + fn delete_user(&self, username: String) -> Box + Send> { + self.api().delete_user(username, &self.context()) + } + + /// Get user by user name + fn get_user_by_name(&self, username: String) -> Box + Send> { + self.api().get_user_by_name(username, &self.context()) + } + + /// Logs user into the system + fn login_user(&self, username: String, password: String) -> Box + Send> { + self.api().login_user(username, password, &self.context()) + } + + /// Logs out current logged in user session + fn logout_user(&self) -> Box + Send> { + self.api().logout_user(&self.context()) + } + + /// Updated user + fn update_user(&self, username: String, body: models::User) -> Box + Send> { + self.api().update_user(username, body, &self.context()) + } + +} + +#[cfg(feature = "client")] +pub mod client; + +// Re-export Client as a top-level name +#[cfg(feature = "client")] +pub use self::client::Client; + +#[cfg(feature = "server")] +pub mod server; + +// Re-export router() as a top-level name +#[cfg(feature = "server")] +pub use self::server::router; + +pub mod models; diff --git a/samples/client/petstore/rust2/src/mimetypes.rs b/samples/client/petstore/rust2/src/mimetypes.rs new file mode 100644 index 00000000000..1f9be4ef9c5 --- /dev/null +++ b/samples/client/petstore/rust2/src/mimetypes.rs @@ -0,0 +1,125 @@ +/// mime types for requests and responses + +pub mod responses { + use hyper::mime::*; + + // 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); + } + /// Create Mime objects for the response content types for GetXmlFeatures + lazy_static! { + pub static ref GET_XML_FEATURES_SUCCESS: Mime = mime!(Application/Xml); + } + /// Create Mime objects for the response content types for TestClientModel + lazy_static! { + pub static ref TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + } + /// Create Mime objects for the response content types for TestClassname + lazy_static! { + pub static ref TEST_CLASSNAME_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + } + /// 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); + } + /// 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); + } + /// 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); + } + /// Create Mime objects for the response content types for UploadFile + lazy_static! { + pub static ref UPLOAD_FILE_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + } + /// Create Mime objects for the response content types for GetInventory + lazy_static! { + pub static ref GET_INVENTORY_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + } + /// 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); + } + /// Create Mime objects for the response content types for PlaceOrder + lazy_static! { + pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + } + /// 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); + } + /// Create Mime objects for the response content types for LoginUser + lazy_static! { + pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + } + +} + +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); + } + /// Create Mime objects for the request content types for PostXmlFeatures + lazy_static! { + pub static ref POST_XML_FEATURES: Mime = mime!(Application/Xml); + } + /// Create Mime objects for the request content types for FakeOuterBooleanSerialize + lazy_static! { + pub static ref FAKE_OUTER_BOOLEAN_SERIALIZE: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for FakeOuterCompositeSerialize + lazy_static! { + pub static ref FAKE_OUTER_COMPOSITE_SERIALIZE: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for FakeOuterNumberSerialize + lazy_static! { + pub static ref FAKE_OUTER_NUMBER_SERIALIZE: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for FakeOuterStringSerialize + lazy_static! { + pub static ref FAKE_OUTER_STRING_SERIALIZE: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for TestClientModel + lazy_static! { + pub static ref TEST_CLIENT_MODEL: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for TestClassname + lazy_static! { + pub static ref TEST_CLASSNAME: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for AddPet + lazy_static! { + pub static ref ADD_PET: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for UpdatePet + lazy_static! { + pub static ref UPDATE_PET: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for PlaceOrder + lazy_static! { + pub static ref PLACE_ORDER: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for CreateUser + lazy_static! { + pub static ref CREATE_USER: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for CreateUsersWithArrayInput + lazy_static! { + pub static ref CREATE_USERS_WITH_ARRAY_INPUT: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for CreateUsersWithListInput + lazy_static! { + pub static ref CREATE_USERS_WITH_LIST_INPUT: Mime = mime!(Application/Json); + } + /// Create Mime objects for the request content types for UpdateUser + lazy_static! { + pub static ref UPDATE_USER: Mime = mime!(Application/Json); + } + +} diff --git a/samples/client/petstore/rust2/src/models.rs b/samples/client/petstore/rust2/src/models.rs new file mode 100644 index 00000000000..8b5a3251c8b --- /dev/null +++ b/samples/client/petstore/rust2/src/models.rs @@ -0,0 +1,1136 @@ +#![allow(unused_imports, unused_qualifications, unused_extern_crates)] +extern crate chrono; +extern crate uuid; + +use serde_xml_rs; +use serde::ser::Serializer; + +use std::collections::HashMap; +use models; +use swagger; + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AdditionalPropertiesClass { + #[serde(rename = "map_property")] + #[serde(skip_serializing_if="Option::is_none")] + pub map_property: Option>, + + #[serde(rename = "map_of_map_property")] + #[serde(skip_serializing_if="Option::is_none")] + pub map_of_map_property: Option>>, + +} + +impl AdditionalPropertiesClass { + pub fn new() -> AdditionalPropertiesClass { + AdditionalPropertiesClass { + map_property: None, + map_of_map_property: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Animal { + #[serde(rename = "className")] + pub class_name: String, + + #[serde(rename = "color")] + #[serde(skip_serializing_if="Option::is_none")] + pub color: Option, + +} + +impl Animal { + pub fn new(class_name: String, ) -> Animal { + Animal { + class_name: class_name, + color: Some("red".to_string()), + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct AnimalFarm(Vec); + +impl ::std::convert::From> for AnimalFarm { + fn from(x: Vec) -> Self { + AnimalFarm(x) + } +} + +impl ::std::convert::From for Vec { + fn from(x: AnimalFarm) -> Self { + x.0 + } +} + +impl ::std::iter::FromIterator for AnimalFarm { + fn from_iter>(u: U) -> Self { + AnimalFarm(Vec::::from_iter(u)) + } +} + +impl ::std::iter::IntoIterator for AnimalFarm { + type Item = Animal; + type IntoIter = ::std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a AnimalFarm { + type Item = &'a Animal; + type IntoIter = ::std::slice::Iter<'a, Animal>; + + fn into_iter(self) -> Self::IntoIter { + (&self.0).into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a mut AnimalFarm { + type Item = &'a mut Animal; + type IntoIter = ::std::slice::IterMut<'a, Animal>; + + fn into_iter(self) -> Self::IntoIter { + (&mut self.0).into_iter() + } +} + +impl ::std::ops::Deref for AnimalFarm { + type Target = Vec; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl ::std::ops::DerefMut for AnimalFarm { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ApiResponse { + #[serde(rename = "code")] + #[serde(skip_serializing_if="Option::is_none")] + pub code: Option, + + #[serde(rename = "type")] + #[serde(skip_serializing_if="Option::is_none")] + pub _type: Option, + + #[serde(rename = "message")] + #[serde(skip_serializing_if="Option::is_none")] + pub message: Option, + +} + +impl ApiResponse { + pub fn new() -> ApiResponse { + ApiResponse { + code: None, + _type: None, + message: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ArrayOfArrayOfNumberOnly { + #[serde(rename = "ArrayArrayNumber")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_array_number: Option>>, + +} + +impl ArrayOfArrayOfNumberOnly { + pub fn new() -> ArrayOfArrayOfNumberOnly { + ArrayOfArrayOfNumberOnly { + array_array_number: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ArrayOfNumberOnly { + #[serde(rename = "ArrayNumber")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_number: Option>, + +} + +impl ArrayOfNumberOnly { + pub fn new() -> ArrayOfNumberOnly { + ArrayOfNumberOnly { + array_number: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ArrayTest { + #[serde(rename = "array_of_string")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_of_string: Option>, + + #[serde(rename = "array_array_of_integer")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_array_of_integer: Option>>, + + #[serde(rename = "array_array_of_model")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_array_of_model: Option>>, + +} + +impl ArrayTest { + pub fn new() -> ArrayTest { + ArrayTest { + array_of_string: None, + array_array_of_integer: None, + array_array_of_model: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Capitalization { + #[serde(rename = "smallCamel")] + #[serde(skip_serializing_if="Option::is_none")] + pub small_camel: Option, + + #[serde(rename = "CapitalCamel")] + #[serde(skip_serializing_if="Option::is_none")] + pub capital_camel: Option, + + #[serde(rename = "small_Snake")] + #[serde(skip_serializing_if="Option::is_none")] + pub small_snake: Option, + + #[serde(rename = "Capital_Snake")] + #[serde(skip_serializing_if="Option::is_none")] + pub capital_snake: Option, + + #[serde(rename = "SCA_ETH_Flow_Points")] + #[serde(skip_serializing_if="Option::is_none")] + pub sca_eth_flow_points: Option, + + /// Name of the pet + #[serde(rename = "ATT_NAME")] + #[serde(skip_serializing_if="Option::is_none")] + pub att_name: Option, + +} + +impl Capitalization { + pub fn new() -> Capitalization { + Capitalization { + small_camel: None, + capital_camel: None, + small_snake: None, + capital_snake: None, + sca_eth_flow_points: None, + att_name: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Category")] +pub struct Category { + #[serde(rename = "id")] + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + + #[serde(rename = "name")] + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + +} + +impl Category { + pub fn new() -> Category { + Category { + id: None, + name: None, + } + } +} + +/// Model for testing model with \"_class\" property +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ClassModel { + #[serde(rename = "_class")] + #[serde(skip_serializing_if="Option::is_none")] + pub _class: Option, + +} + +impl ClassModel { + pub fn new() -> ClassModel { + ClassModel { + _class: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Client { + #[serde(rename = "client")] + #[serde(skip_serializing_if="Option::is_none")] + pub client: Option, + +} + +impl Client { + pub fn new() -> Client { + Client { + client: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct EnumArrays { + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "just_symbol")] + #[serde(skip_serializing_if="Option::is_none")] + pub just_symbol: Option, + + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "array_enum")] + #[serde(skip_serializing_if="Option::is_none")] + pub array_enum: Option>, + +} + +impl EnumArrays { + pub fn new() -> EnumArrays { + EnumArrays { + just_symbol: None, + array_enum: None, + } + } +} + +/// Enumeration of values. +/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` +/// which helps with FFI. +#[allow(non_camel_case_types)] +#[repr(C)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize)] +pub enum EnumClass { + #[serde(rename = "_abc")] + _ABC, + #[serde(rename = "-efg")] + _EFG, + #[serde(rename = "(xyz)")] + _XYZ_, +} + +impl ::std::fmt::Display for EnumClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { + EnumClass::_ABC => write!(f, "{}", "_abc"), + EnumClass::_EFG => write!(f, "{}", "-efg"), + EnumClass::_XYZ_ => write!(f, "{}", "(xyz)"), + } + } +} + +impl ::std::str::FromStr for EnumClass { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "_abc" => Ok(EnumClass::_ABC), + "-efg" => Ok(EnumClass::_EFG), + "(xyz)" => Ok(EnumClass::_XYZ_), + _ => Err(()), + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct EnumTest { + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "enum_string")] + #[serde(skip_serializing_if="Option::is_none")] + pub enum_string: Option, + + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "enum_integer")] + #[serde(skip_serializing_if="Option::is_none")] + pub enum_integer: Option, + + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "enum_number")] + #[serde(skip_serializing_if="Option::is_none")] + pub enum_number: Option, + + #[serde(rename = "outerEnum")] + #[serde(skip_serializing_if="Option::is_none")] + pub outer_enum: Option, + +} + +impl EnumTest { + pub fn new() -> EnumTest { + EnumTest { + enum_string: None, + enum_integer: None, + enum_number: None, + outer_enum: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct FormatTest { + #[serde(rename = "integer")] + #[serde(skip_serializing_if="Option::is_none")] + pub integer: Option, + + #[serde(rename = "int32")] + #[serde(skip_serializing_if="Option::is_none")] + pub int32: Option, + + #[serde(rename = "int64")] + #[serde(skip_serializing_if="Option::is_none")] + pub int64: Option, + + #[serde(rename = "number")] + pub number: f64, + + #[serde(rename = "float")] + #[serde(skip_serializing_if="Option::is_none")] + pub float: Option, + + #[serde(rename = "double")] + #[serde(skip_serializing_if="Option::is_none")] + pub double: Option, + + #[serde(rename = "string")] + #[serde(skip_serializing_if="Option::is_none")] + pub string: Option, + + #[serde(rename = "byte")] + pub byte: swagger::ByteArray, + + #[serde(rename = "binary")] + #[serde(skip_serializing_if="Option::is_none")] + pub binary: Option, + + #[serde(rename = "date")] + pub date: chrono::DateTime, + + #[serde(rename = "dateTime")] + #[serde(skip_serializing_if="Option::is_none")] + pub date_time: Option>, + + #[serde(rename = "uuid")] + #[serde(skip_serializing_if="Option::is_none")] + pub uuid: Option, + + #[serde(rename = "password")] + pub password: String, + +} + +impl FormatTest { + pub fn new(number: f64, byte: swagger::ByteArray, date: chrono::DateTime, password: String, ) -> FormatTest { + FormatTest { + integer: None, + int32: None, + int64: None, + number: number, + float: None, + double: None, + string: None, + byte: byte, + binary: None, + date: date, + date_time: None, + uuid: None, + password: password, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct HasOnlyReadOnly { + #[serde(rename = "bar")] + #[serde(skip_serializing_if="Option::is_none")] + pub bar: Option, + + #[serde(rename = "foo")] + #[serde(skip_serializing_if="Option::is_none")] + pub foo: Option, + +} + +impl HasOnlyReadOnly { + pub fn new() -> HasOnlyReadOnly { + HasOnlyReadOnly { + bar: None, + foo: None, + } + } +} + +// Utility function for wrapping list elements when serializing xml +fn wrap_in_item(item: &Vec, serializer: S) -> Result +where + S: Serializer, +{ + serde_xml_rs::wrap_primitives(item, serializer, "item") +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ItemList(Vec); + +impl ::std::convert::From> for ItemList { + fn from(x: Vec) -> Self { + ItemList(x) + } +} + +impl ::std::convert::From for Vec { + fn from(x: ItemList) -> Self { + x.0 + } +} + +impl ::std::iter::FromIterator for ItemList { + fn from_iter>(u: U) -> Self { + ItemList(Vec::::from_iter(u)) + } +} + +impl ::std::iter::IntoIterator for ItemList { + type Item = String; + type IntoIter = ::std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a ItemList { + type Item = &'a String; + type IntoIter = ::std::slice::Iter<'a, String>; + + fn into_iter(self) -> Self::IntoIter { + (&self.0).into_iter() + } +} + +impl<'a> ::std::iter::IntoIterator for &'a mut ItemList { + type Item = &'a mut String; + type IntoIter = ::std::slice::IterMut<'a, String>; + + fn into_iter(self) -> Self::IntoIter { + (&mut self.0).into_iter() + } +} + +impl ::std::ops::Deref for ItemList { + type Target = Vec; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl ::std::ops::DerefMut for ItemList { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct List { + #[serde(rename = "123-list")] + #[serde(skip_serializing_if="Option::is_none")] + pub _123_list: Option, + +} + +impl List { + pub fn new() -> List { + List { + _123_list: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MapTest { + #[serde(rename = "map_map_of_string")] + #[serde(skip_serializing_if="Option::is_none")] + pub map_map_of_string: Option>>, + + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "map_of_enum_string")] + #[serde(skip_serializing_if="Option::is_none")] + pub map_of_enum_string: Option>, + +} + +impl MapTest { + pub fn new() -> MapTest { + MapTest { + map_map_of_string: None, + map_of_enum_string: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MixedPropertiesAndAdditionalPropertiesClass { + #[serde(rename = "uuid")] + #[serde(skip_serializing_if="Option::is_none")] + pub uuid: Option, + + #[serde(rename = "dateTime")] + #[serde(skip_serializing_if="Option::is_none")] + pub date_time: Option>, + + #[serde(rename = "map")] + #[serde(skip_serializing_if="Option::is_none")] + pub map: Option>, + +} + +impl MixedPropertiesAndAdditionalPropertiesClass { + pub fn new() -> MixedPropertiesAndAdditionalPropertiesClass { + MixedPropertiesAndAdditionalPropertiesClass { + uuid: None, + date_time: None, + map: None, + } + } +} + +/// Model for testing model name starting with number +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Name")] +pub struct Model200Response { + #[serde(rename = "name")] + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + + #[serde(rename = "class")] + #[serde(skip_serializing_if="Option::is_none")] + pub class: Option, + +} + +impl Model200Response { + pub fn new() -> Model200Response { + Model200Response { + name: None, + class: None, + } + } +} + +/// Model for testing reserved words +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Return")] +pub struct ModelReturn { + #[serde(rename = "return")] + #[serde(skip_serializing_if="Option::is_none")] + pub _return: Option, + +} + +impl ModelReturn { + pub fn new() -> ModelReturn { + ModelReturn { + _return: None, + } + } +} + +/// Model for testing model name same as property name +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Name")] +pub struct Name { + #[serde(rename = "name")] + pub name: i32, + + #[serde(rename = "snake_case")] + #[serde(skip_serializing_if="Option::is_none")] + pub snake_case: Option, + + #[serde(rename = "property")] + #[serde(skip_serializing_if="Option::is_none")] + pub property: Option, + + #[serde(rename = "123Number")] + #[serde(skip_serializing_if="Option::is_none")] + pub _123_number: Option, + +} + +impl Name { + pub fn new(name: i32, ) -> Name { + Name { + name: name, + snake_case: None, + property: None, + _123_number: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct NumberOnly { + #[serde(rename = "JustNumber")] + #[serde(skip_serializing_if="Option::is_none")] + pub just_number: Option, + +} + +impl NumberOnly { + pub fn new() -> NumberOnly { + NumberOnly { + just_number: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Order")] +pub struct Order { + #[serde(rename = "id")] + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + + #[serde(rename = "petId")] + #[serde(skip_serializing_if="Option::is_none")] + pub pet_id: Option, + + #[serde(rename = "quantity")] + #[serde(skip_serializing_if="Option::is_none")] + pub quantity: Option, + + #[serde(rename = "shipDate")] + #[serde(skip_serializing_if="Option::is_none")] + pub ship_date: Option>, + + /// Order Status + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "status")] + #[serde(skip_serializing_if="Option::is_none")] + pub status: Option, + + #[serde(rename = "complete")] + #[serde(skip_serializing_if="Option::is_none")] + pub complete: Option, + +} + +impl Order { + pub fn new() -> Order { + Order { + id: None, + pet_id: None, + quantity: None, + ship_date: None, + status: None, + complete: Some(false), + } + } +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] + +pub struct OuterBoolean(bool); + +impl ::std::convert::From for OuterBoolean { + fn from(x: bool) -> Self { + OuterBoolean(x) + } +} + +impl ::std::convert::From for bool { + fn from(x: OuterBoolean) -> Self { + x.0 + } +} + +impl ::std::ops::Deref for OuterBoolean { + type Target = bool; + fn deref(&self) -> &bool { + &self.0 + } +} + +impl ::std::ops::DerefMut for OuterBoolean { + fn deref_mut(&mut self) -> &mut bool { + &mut self.0 + } +} + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct OuterComposite { + #[serde(rename = "my_number")] + #[serde(skip_serializing_if="Option::is_none")] + pub my_number: Option, + + #[serde(rename = "my_string")] + #[serde(skip_serializing_if="Option::is_none")] + pub my_string: Option, + + #[serde(rename = "my_boolean")] + #[serde(skip_serializing_if="Option::is_none")] + pub my_boolean: Option, + +} + +impl OuterComposite { + pub fn new() -> OuterComposite { + OuterComposite { + my_number: None, + my_string: None, + my_boolean: None, + } + } +} + +/// Enumeration of values. +/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` +/// which helps with FFI. +#[allow(non_camel_case_types)] +#[repr(C)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize)] +pub enum OuterEnum { + #[serde(rename = "placed")] + PLACED, + #[serde(rename = "approved")] + APPROVED, + #[serde(rename = "delivered")] + DELIVERED, +} + +impl ::std::fmt::Display for OuterEnum { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { + OuterEnum::PLACED => write!(f, "{}", "placed"), + OuterEnum::APPROVED => write!(f, "{}", "approved"), + OuterEnum::DELIVERED => write!(f, "{}", "delivered"), + } + } +} + +impl ::std::str::FromStr for OuterEnum { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "placed" => Ok(OuterEnum::PLACED), + "approved" => Ok(OuterEnum::APPROVED), + "delivered" => Ok(OuterEnum::DELIVERED), + _ => Err(()), + } + } +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] + +pub struct OuterNumber(f64); + +impl ::std::convert::From for OuterNumber { + fn from(x: f64) -> Self { + OuterNumber(x) + } +} + +impl ::std::convert::From for f64 { + fn from(x: OuterNumber) -> Self { + x.0 + } +} + +impl ::std::ops::Deref for OuterNumber { + type Target = f64; + fn deref(&self) -> &f64 { + &self.0 + } +} + +impl ::std::ops::DerefMut for OuterNumber { + fn deref_mut(&mut self) -> &mut f64 { + &mut self.0 + } +} + + +#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] + +pub struct OuterString(String); + +impl ::std::convert::From for OuterString { + fn from(x: String) -> Self { + OuterString(x) + } +} + +impl ::std::convert::From for String { + fn from(x: OuterString) -> Self { + x.0 + } +} + +impl ::std::ops::Deref for OuterString { + type Target = String; + fn deref(&self) -> &String { + &self.0 + } +} + +impl ::std::ops::DerefMut for OuterString { + fn deref_mut(&mut self) -> &mut String { + &mut self.0 + } +} + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Pet")] +pub struct Pet { + #[serde(rename = "id")] + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + + #[serde(rename = "category")] + #[serde(skip_serializing_if="Option::is_none")] + pub category: Option, + + #[serde(rename = "name")] + pub name: String, + + #[serde(rename = "photoUrls")] + pub photo_urls: Vec, + + #[serde(rename = "tags")] + #[serde(skip_serializing_if="Option::is_none")] + pub tags: Option>, + + /// pet status in the store + // Note: inline enums are not fully supported by swagger-codegen + #[serde(rename = "status")] + #[serde(skip_serializing_if="Option::is_none")] + pub status: Option, + +} + +impl Pet { + pub fn new(name: String, photo_urls: Vec, ) -> Pet { + Pet { + id: None, + category: None, + name: name, + photo_urls: photo_urls, + tags: None, + status: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ReadOnlyFirst { + #[serde(rename = "bar")] + #[serde(skip_serializing_if="Option::is_none")] + pub bar: Option, + + #[serde(rename = "baz")] + #[serde(skip_serializing_if="Option::is_none")] + pub baz: Option, + +} + +impl ReadOnlyFirst { + pub fn new() -> ReadOnlyFirst { + ReadOnlyFirst { + bar: None, + baz: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "$special[model.name]")] +pub struct SpecialModelName { + #[serde(rename = "$special[property.name]")] + #[serde(skip_serializing_if="Option::is_none")] + pub special_property_name: Option, + +} + +impl SpecialModelName { + pub fn new() -> SpecialModelName { + SpecialModelName { + special_property_name: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "Tag")] +pub struct Tag { + #[serde(rename = "id")] + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + + #[serde(rename = "name")] + #[serde(skip_serializing_if="Option::is_none")] + pub name: Option, + +} + +impl Tag { + pub fn new() -> Tag { + Tag { + id: None, + name: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "User")] +pub struct User { + #[serde(rename = "id")] + #[serde(skip_serializing_if="Option::is_none")] + pub id: Option, + + #[serde(rename = "username")] + #[serde(skip_serializing_if="Option::is_none")] + pub username: Option, + + #[serde(rename = "firstName")] + #[serde(skip_serializing_if="Option::is_none")] + pub first_name: Option, + + #[serde(rename = "lastName")] + #[serde(skip_serializing_if="Option::is_none")] + pub last_name: Option, + + #[serde(rename = "email")] + #[serde(skip_serializing_if="Option::is_none")] + pub email: Option, + + #[serde(rename = "password")] + #[serde(skip_serializing_if="Option::is_none")] + pub password: Option, + + #[serde(rename = "phone")] + #[serde(skip_serializing_if="Option::is_none")] + pub phone: Option, + + /// User Status + #[serde(rename = "userStatus")] + #[serde(skip_serializing_if="Option::is_none")] + pub user_status: Option, + +} + +impl User { + pub fn new() -> User { + User { + id: None, + username: None, + first_name: None, + last_name: None, + email: None, + password: None, + phone: None, + user_status: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename = "group")] +pub struct XmlObject { + #[serde(rename = "name")] + pub name: String, + + #[serde(rename = "itemList")] + #[serde(serialize_with = "wrap_in_item")] + pub item_list: models::ItemList, + +} + +impl XmlObject { + pub fn new(name: String, item_list: models::ItemList, ) -> XmlObject { + XmlObject { + name: name, + item_list: item_list, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Cat { + #[serde(rename = "className")] + pub class_name: String, + + #[serde(rename = "color")] + #[serde(skip_serializing_if="Option::is_none")] + pub color: Option, + + #[serde(rename = "declawed")] + #[serde(skip_serializing_if="Option::is_none")] + pub declawed: Option, + +} + +impl Cat { + pub fn new(class_name: String, ) -> Cat { + Cat { + class_name: class_name, + color: Some("red".to_string()), + declawed: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Dog { + #[serde(rename = "className")] + pub class_name: String, + + #[serde(rename = "color")] + #[serde(skip_serializing_if="Option::is_none")] + pub color: Option, + + #[serde(rename = "breed")] + #[serde(skip_serializing_if="Option::is_none")] + pub breed: Option, + +} + +impl Dog { + pub fn new(class_name: String, ) -> Dog { + Dog { + class_name: class_name, + color: Some("red".to_string()), + breed: None, + } + } +} + +//XML namespaces +pub mod namespaces { + lazy_static!{ + pub static ref XMLOBJECT: String = "http://example.com/schema.xsd".to_string(); + + } +} diff --git a/samples/client/petstore/rust2/src/server.rs b/samples/client/petstore/rust2/src/server.rs new file mode 100644 index 00000000000..a8d32981940 --- /dev/null +++ b/samples/client/petstore/rust2/src/server.rs @@ -0,0 +1,2518 @@ +#![allow(unused_extern_crates)] +extern crate serde_ignored; +extern crate iron; +extern crate router; +extern crate bodyparser; +extern crate urlencoded; +extern crate uuid; +extern crate chrono; +extern crate multipart; + +use futures::Future; +use futures::future; +use futures::{stream, Stream}; +use hyper; +use hyper::header::{Headers, ContentType}; +use self::iron::prelude::*; +use self::iron::{status, modifiers, BeforeMiddleware}; +use self::iron::url::percent_encoding::percent_decode; +use self::router::Router; +use self::urlencoded::UrlEncodedQuery; +use mimetypes; +use multipart::server::{Multipart, SaveResult}; + +use serde_json; +use serde_xml_rs; + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::BTreeSet; + +use swagger::auth::{Authorization, AuthData, Scopes}; +use swagger::{ApiError, Context, XSpanId}; + +use {Api, + TestSpecialTagsResponse, + GetXmlFeaturesResponse, + PostXmlFeaturesResponse, + FakeOuterBooleanSerializeResponse, + FakeOuterCompositeSerializeResponse, + FakeOuterNumberSerializeResponse, + FakeOuterStringSerializeResponse, + TestClientModelResponse, + TestEndpointParametersResponse, + TestEnumParametersResponse, + TestJsonFormDataResponse, + TestClassnameResponse, + AddPetResponse, + DeletePetResponse, + FindPetsByStatusResponse, + FindPetsByTagsResponse, + GetPetByIdResponse, + UpdatePetResponse, + UpdatePetWithFormResponse, + UploadFileResponse, + DeleteOrderResponse, + GetInventoryResponse, + GetOrderByIdResponse, + PlaceOrderResponse, + CreateUserResponse, + CreateUsersWithArrayInputResponse, + CreateUsersWithListInputResponse, + DeleteUserResponse, + GetUserByNameResponse, + LoginUserResponse, + LogoutUserResponse, + UpdateUserResponse + }; +#[allow(unused_imports)] +use models; + +header! { (Warning, "Warning") => [String] } + +/// Create a new router for `Api` +pub fn router(api: T) -> Router where T: Api + Send + Sync + Clone + 'static { + let mut router = Router::new(); + add_routes(&mut router, api); + router +} + +/// Add routes for `Api` to a provided router. +/// +/// Note that these routes are added straight onto the router. This means that if the router +/// already has a route for an endpoint which clashes with those provided by this API, then the +/// old route will be lost. +/// +/// It is generally a bad idea to add routes in this way to an existing router, which may have +/// routes on it for other APIs. Distinct APIs should be behind distinct paths to encourage +/// separation of interfaces, which this function does not enforce. APIs should not overlap. +/// +/// Alternative approaches include: +/// +/// - generate an `iron::middleware::Handler` (usually a `router::Router` or +/// `iron::middleware::chain`) for each interface, and add those handlers inside an existing +/// router, mounted at different paths - so the interfaces are separated by path +/// - use a different instance of `iron::Iron` for each interface - so the interfaces are +/// separated by the address/port they listen on +/// +/// This function exists to allow legacy code, which doesn't separate its APIs properly, to make +/// use of this crate. +#[deprecated(note="APIs should not overlap - only for use in legacy code.")] +pub fn route(router: &mut Router, api: T) where T: Api + Send + Sync + Clone + 'static { + add_routes(router, api) +} + +/// Add routes for `Api` to a provided router +fn add_routes(router: &mut Router, api: T) where T: Api + Send + Sync + Clone + 'static { + + let api_clone = api.clone(); + router.patch( + "/v2/another-fake/dummy", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.test_special_tags(param_body, context).wait() { + Ok(rsp) => match rsp { + TestSpecialTagsResponse::SuccessfulOperation(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::TEST_SPECIAL_TAGS_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestSpecialTags"); + + let api_clone = api.clone(); + router.get( + "/v2/fake/xmlFeatures", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + + match api.get_xml_features(context).wait() { + Ok(rsp) => match rsp { + GetXmlFeaturesResponse::Success(body) => { + + + let mut namespaces = BTreeMap::new(); + // An empty string is used to indicate a global namespace in xmltree. + namespaces.insert("".to_string(), models::namespaces::XMLOBJECT.clone()); + let body_string = serde_xml_rs::to_string_with_namespaces(&body, namespaces).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_XML_FEATURES_SUCCESS.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "GetXmlFeatures"); + + let api_clone = api.clone(); + router.post( + "/v2/fake/xmlFeatures", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_xml_object_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter xmlObject - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_xml_object = if let Some(param_xml_object_raw) = param_xml_object_raw { + let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(param_xml_object_raw.as_bytes()); + + let param_xml_object: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter xmlObject - doesn't match schema: {}", e))))?; + + param_xml_object + } else { + None + }; + let param_xml_object = param_xml_object.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter xmlObject".to_string())))?; + + + match api.post_xml_features(param_xml_object, context).wait() { + Ok(rsp) => match rsp { + PostXmlFeaturesResponse::Success => { + + + let mut response = Response::with((status::Status::from_u16(200))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "PostXmlFeatures"); + + let api_clone = api.clone(); + router.post( + "/v2/fake/outer/boolean", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().unwrap_or(None); + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).unwrap_or(None); + + param_body + } else { + None + };; + + + match api.fake_outer_boolean_serialize(param_body, context).wait() { + Ok(rsp) => match rsp { + FakeOuterBooleanSerializeResponse::OutputBoolean(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FakeOuterBooleanSerialize"); + + let api_clone = api.clone(); + router.post( + "/v2/fake/outer/composite", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().unwrap_or(None); + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).unwrap_or(None); + + param_body + } else { + None + };; + + + match api.fake_outer_composite_serialize(param_body, context).wait() { + Ok(rsp) => match rsp { + FakeOuterCompositeSerializeResponse::OutputComposite(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FakeOuterCompositeSerialize"); + + let api_clone = api.clone(); + router.post( + "/v2/fake/outer/number", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().unwrap_or(None); + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).unwrap_or(None); + + param_body + } else { + None + };; + + + match api.fake_outer_number_serialize(param_body, context).wait() { + Ok(rsp) => match rsp { + FakeOuterNumberSerializeResponse::OutputNumber(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FakeOuterNumberSerialize"); + + let api_clone = api.clone(); + router.post( + "/v2/fake/outer/string", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().unwrap_or(None); + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).unwrap_or(None); + + param_body + } else { + None + };; + + + match api.fake_outer_string_serialize(param_body, context).wait() { + Ok(rsp) => match rsp { + FakeOuterStringSerializeResponse::OutputString(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FakeOuterStringSerialize"); + + let api_clone = api.clone(); + router.patch( + "/v2/fake", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.test_client_model(param_body, context).wait() { + Ok(rsp) => match rsp { + TestClientModelResponse::SuccessfulOperation(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestClientModel"); + + let api_clone = api.clone(); + router.post( + "/v2/fake", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + + + + // Form parameters + let param_number = 3.4; + let param_double = 1.2; + let param_pattern_without_delimiter = "pattern_without_delimiter_example".to_string(); + let param_byte = swagger::ByteArray("byte_example".to_string().into_bytes()); + let param_integer = Some(56); + let param_int32 = Some(56); + let param_int64 = Some(789); + let param_float = Some(3.4); + let param_string = Some("string_example".to_string()); + let param_binary = Some(swagger::ByteArray(Vec::from("B"))); + let param_date = None; + let param_date_time = None; + let param_password = Some("password_example".to_string()); + let param_callback = Some("callback_example".to_string()); + + match api.test_endpoint_parameters(param_number, param_double, param_pattern_without_delimiter, param_byte, param_integer, param_int32, param_int64, param_float, param_string, param_binary, param_date, param_date_time, param_password, param_callback, context).wait() { + Ok(rsp) => match rsp { + TestEndpointParametersResponse::InvalidUsernameSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + TestEndpointParametersResponse::UserNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestEndpointParameters"); + + let api_clone = api.clone(); + router.get( + "/v2/fake", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Header parameters + header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } + let param_enum_header_string_array = req.headers.get::().map(|header| header.0.clone()); + header! { (RequestEnumHeaderString, "enum_header_string") => [String] } + let param_enum_header_string = req.headers.get::().map(|header| header.0.clone()); + + + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_enum_query_string_array = query_params.get("enum_query_string_array") + .map(|list| list.iter().flat_map(|x| x.parse::()).collect::>()); + let param_enum_query_string = query_params.get("enum_query_string") + .and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + let param_enum_query_integer = query_params.get("enum_query_integer") + .and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + + // Form parameters + let param_enum_form_string_array = None; + let param_enum_form_string = Some("enum_form_string_example".to_string()); + let param_enum_query_double = Some(1.2); + + match api.test_enum_parameters(param_enum_form_string_array.as_ref(), param_enum_form_string, param_enum_header_string_array.as_ref(), param_enum_header_string, param_enum_query_string_array.as_ref(), param_enum_query_string, param_enum_query_integer, param_enum_query_double, context).wait() { + Ok(rsp) => match rsp { + TestEnumParametersResponse::InvalidRequest => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + TestEnumParametersResponse::NotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestEnumParameters"); + + let api_clone = api.clone(); + router.get( + "/v2/fake/jsonFormData", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Form parameters + let param_param = "param_example".to_string(); + let param_param2 = "param2_example".to_string(); + + match api.test_json_form_data(param_param, param_param2, context).wait() { + Ok(rsp) => match rsp { + TestJsonFormDataResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(200))); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestJsonFormData"); + + let api_clone = api.clone(); + router.patch( + "/v2/fake_classname_test", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.test_classname(param_body, context).wait() { + Ok(rsp) => match rsp { + TestClassnameResponse::SuccessfulOperation(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::TEST_CLASSNAME_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestClassname"); + + let api_clone = api.clone(); + router.post( + "/v2/pet", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(param_body_raw.as_bytes()); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.add_pet(param_body, context).wait() { + Ok(rsp) => match rsp { + AddPetResponse::InvalidInput => { + + + let mut response = Response::with((status::Status::from_u16(405))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "AddPet"); + + let api_clone = api.clone(); + router.delete( + "/v2/pet/:petId", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + // Path parameters + let param_pet_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("petId").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter petId".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter petId: {}", e))))? + }; + + // Header parameters + header! { (RequestApiKey, "api_key") => [String] } + let param_api_key = req.headers.get::().map(|header| header.0.clone()); + + + + match api.delete_pet(param_pet_id, param_api_key, context).wait() { + Ok(rsp) => match rsp { + DeletePetResponse::InvalidPetValue => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "DeletePet"); + + let api_clone = api.clone(); + router.get( + "/v2/pet/findByStatus", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_status = query_params.get("status") + .ok_or_else(|| Response::with((status::BadRequest, "Missing required query parameter status".to_string())))? + .iter().flat_map(|x| x.parse::()).collect::>(); + + + match api.find_pets_by_status(param_status.as_ref(), context).wait() { + Ok(rsp) => match rsp { + FindPetsByStatusResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + FindPetsByStatusResponse::InvalidStatusValue => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FindPetsByStatus"); + + let api_clone = api.clone(); + router.get( + "/v2/pet/findByTags", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_tags = query_params.get("tags") + .ok_or_else(|| Response::with((status::BadRequest, "Missing required query parameter tags".to_string())))? + .iter().flat_map(|x| x.parse::()).collect::>(); + + + match api.find_pets_by_tags(param_tags.as_ref(), context).wait() { + Ok(rsp) => match rsp { + FindPetsByTagsResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + FindPetsByTagsResponse::InvalidTagValue => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "FindPetsByTags"); + + let api_clone = api.clone(); + router.get( + "/v2/pet/:petId", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + + + // Path parameters + let param_pet_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("petId").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter petId".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter petId: {}", e))))? + }; + + + + match api.get_pet_by_id(param_pet_id, context).wait() { + Ok(rsp) => match rsp { + GetPetByIdResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_PET_BY_ID_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetPetByIdResponse::InvalidIDSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetPetByIdResponse::PetNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "GetPetById"); + + let api_clone = api.clone(); + router.put( + "/v2/pet", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(param_body_raw.as_bytes()); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.update_pet(param_body, context).wait() { + Ok(rsp) => match rsp { + UpdatePetResponse::InvalidIDSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + UpdatePetResponse::PetNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + UpdatePetResponse::ValidationException => { + + + let mut response = Response::with((status::Status::from_u16(405))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "UpdatePet"); + + let api_clone = api.clone(); + router.post( + "/v2/pet/:petId", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + // Path parameters + let param_pet_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("petId").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter petId".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter petId: {}", e))))? + }; + + + // Form parameters + let param_name = Some("name_example".to_string()); + let param_status = Some("status_example".to_string()); + + match api.update_pet_with_form(param_pet_id, param_name, param_status, context).wait() { + Ok(rsp) => match rsp { + UpdatePetWithFormResponse::InvalidInput => { + + + let mut response = Response::with((status::Status::from_u16(405))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "UpdatePetWithForm"); + + let api_clone = api.clone(); + router.post( + "/v2/pet/:petId/uploadImage", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + // Authorization + if let Scopes::Some(ref scopes) = authorization.scopes { + let required_scopes: BTreeSet = vec![ + "write:pets".to_string(), // modify pets in your account + "read:pets".to_string(), // read your pets + ].into_iter().collect(); + + if !required_scopes.is_subset(scopes) { + let missing_scopes = required_scopes.difference(scopes); + return Err(Response::with(( + status::Forbidden, + missing_scopes.fold( + "Insufficient authorization, missing scopes".to_string(), + |s, scope| format!("{} {}", s, scope) + ) + ))); + } + } + + + // Path parameters + let param_pet_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("petId").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter petId".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter petId: {}", e))))? + }; + + + // Form parameters + + // Expecting a multipart form, extract and parse it now. + let mut entries = match Multipart::from_request(req) { + Ok(mut multipart) => { + + match multipart.save().temp() { + SaveResult::Full(entries) => { + Ok(entries) + }, + _ => { + Err(Response::with((status::InternalServerError, format!("Unable to process all message parts")))) + }, + } + }, + Err(e) => { + // Unable to parse as multipart + Err(Response::with((status::BadRequest, format!("Couldn't parse body as multipart")))) + } + }?; + + let param_additional_metadata = Some("additional_metadata_example".to_string()); + + + let param_file = entries.fields.remove("file"); + + let param_file = match param_file { + Some(body) => { + Ok({let bytes = body.as_bytes(); + Some( + Box::new(stream::once(Ok(bytes.to_vec()))) as Box, Error=Error> + Send> + )} + ) + } + None => {Err(Response::with((status::BadRequest, format!("Body part not found!"))))} + }?; + let param_file = Box::new(future::ok(param_file)); + + match api.upload_file(param_pet_id, param_additional_metadata, param_file, context).wait() { + Ok(rsp) => match rsp { + UploadFileResponse::SuccessfulOperation(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::UPLOAD_FILE_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "UploadFile"); + + let api_clone = api.clone(); + router.delete( + "/v2/store/order/:order_id", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Path parameters + let param_order_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("order_id").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter order_id".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter order_id: {}", e))))? + }; + + + + match api.delete_order(param_order_id, context).wait() { + Ok(rsp) => match rsp { + DeleteOrderResponse::InvalidIDSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + DeleteOrderResponse::OrderNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "DeleteOrder"); + + let api_clone = api.clone(); + router.get( + "/v2/store/inventory", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + let authorization = context.authorization.as_ref().ok_or_else(|| { + Response::with(( + status::Forbidden, + "Unauthenticated".to_string() + )) + })?; + + + + + + match api.get_inventory(context).wait() { + Ok(rsp) => match rsp { + GetInventoryResponse::SuccessfulOperation(body) => { + + let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_INVENTORY_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "GetInventory"); + + let api_clone = api.clone(); + router.get( + "/v2/store/order/:order_id", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Path parameters + let param_order_id = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("order_id").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter order_id".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter order_id: {}", e))))? + }; + + + + match api.get_order_by_id(param_order_id, context).wait() { + Ok(rsp) => match rsp { + GetOrderByIdResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_ORDER_BY_ID_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetOrderByIdResponse::InvalidIDSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetOrderByIdResponse::OrderNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "GetOrderById"); + + let api_clone = api.clone(); + router.post( + "/v2/store/order", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.place_order(param_body, context).wait() { + Ok(rsp) => match rsp { + PlaceOrderResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::PLACE_ORDER_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + PlaceOrderResponse::InvalidOrder => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "PlaceOrder"); + + let api_clone = api.clone(); + router.post( + "/v2/user", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.create_user(param_body, context).wait() { + Ok(rsp) => match rsp { + CreateUserResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(0))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "CreateUser"); + + let api_clone = api.clone(); + router.post( + "/v2/user/createWithArray", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option> = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.create_users_with_array_input(param_body.as_ref(), context).wait() { + Ok(rsp) => match rsp { + CreateUsersWithArrayInputResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(0))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "CreateUsersWithArrayInput"); + + let api_clone = api.clone(); + router.post( + "/v2/user/createWithList", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option> = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.create_users_with_list_input(param_body.as_ref(), context).wait() { + Ok(rsp) => match rsp { + CreateUsersWithListInputResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(0))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "CreateUsersWithListInput"); + + let api_clone = api.clone(); + router.delete( + "/v2/user/:username", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Path parameters + let param_username = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("username").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter username".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter username: {}", e))))? + }; + + + + match api.delete_user(param_username, context).wait() { + Ok(rsp) => match rsp { + DeleteUserResponse::InvalidUsernameSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + DeleteUserResponse::UserNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "DeleteUser"); + + let api_clone = api.clone(); + router.get( + "/v2/user/:username", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Path parameters + let param_username = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("username").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter username".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter username: {}", e))))? + }; + + + + match api.get_user_by_name(param_username, context).wait() { + Ok(rsp) => match rsp { + GetUserByNameResponse::SuccessfulOperation(body) => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); + response.headers.set(ContentType(mimetypes::responses::GET_USER_BY_NAME_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetUserByNameResponse::InvalidUsernameSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + GetUserByNameResponse::UserNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "GetUserByName"); + + let api_clone = api.clone(); + router.get( + "/v2/user/login", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_username = query_params.get("username") + .ok_or_else(|| Response::with((status::BadRequest, "Missing required query parameter username".to_string())))? + .first().ok_or_else(|| Response::with((status::BadRequest, "Required query parameter username was empty".to_string())))? + .parse::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse query parameter username - doesn't match schema: {}", e))))?; + let param_password = query_params.get("password") + .ok_or_else(|| Response::with((status::BadRequest, "Missing required query parameter password".to_string())))? + .first().ok_or_else(|| Response::with((status::BadRequest, "Required query parameter password was empty".to_string())))? + .parse::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse query parameter password - doesn't match schema: {}", e))))?; + + + match api.login_user(param_username, param_password, context).wait() { + Ok(rsp) => match rsp { + LoginUserResponse::SuccessfulOperation{ body, x_rate_limit, x_expires_after } => { + + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); + + let mut response = Response::with((status::Status::from_u16(200), body_string)); header! { (ResponseXRateLimit, "X-Rate-Limit") => [i32] } + response.headers.set(ResponseXRateLimit(x_rate_limit)); + header! { (ResponseXExpiresAfter, "X-Expires-After") => [chrono::DateTime] } + response.headers.set(ResponseXExpiresAfter(x_expires_after)); + + response.headers.set(ContentType(mimetypes::responses::LOGIN_USER_SUCCESSFUL_OPERATION.clone())); + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + LoginUserResponse::InvalidUsername => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "LoginUser"); + + let api_clone = api.clone(); + router.get( + "/v2/user/logout", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + + match api.logout_user(context).wait() { + Ok(rsp) => match rsp { + LogoutUserResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(0))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "LogoutUser"); + + let api_clone = api.clone(); + router.put( + "/v2/user/:username", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + // Path parameters + let param_username = { + let param = req.extensions.get::().ok_or_else(|| Response::with((status::InternalServerError, "An internal error occurred".to_string())))? + .find("username").ok_or_else(|| Response::with((status::BadRequest, "Missing path parameter username".to_string())))?; + percent_decode(param.as_bytes()).decode_utf8() + .map_err(|_| Response::with((status::BadRequest, format!("Couldn't percent-decode path parameter as UTF-8: {}", param))))? + .parse().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter username: {}", e))))? + }; + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_body_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_body = if let Some(param_body_raw) = param_body_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_body_raw); + + let param_body: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter body - doesn't match schema: {}", e))))?; + + param_body + } else { + None + }; + let param_body = param_body.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter body".to_string())))?; + + + match api.update_user(param_username, param_body, context).wait() { + Ok(rsp) => match rsp { + UpdateUserResponse::InvalidUserSupplied => { + + + let mut response = Response::with((status::Status::from_u16(400))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + UpdateUserResponse::UserNotFound => { + + + let mut response = Response::with((status::Status::from_u16(404))); + + + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "UpdateUser"); + +} + +/// Middleware to extract authentication data from request +pub struct ExtractAuthData; + +impl BeforeMiddleware for ExtractAuthData { + fn before(&self, req: &mut Request) -> IronResult<()> { + { + header! { (ApiKey1, "api_key") => [String] } + if let Some(header) = req.headers.get::() { + req.extensions.insert::(AuthData::ApiKey(header.0.clone())); + return Ok(()); + } + } + { + let header = match req.get_ref::() { + Ok(query) => query.get("api_key_query").map(|v| v[0].clone()), + _ => None + }; + if let Some(key) = header { + req.extensions.insert::(AuthData::ApiKey(key)); + return Ok(()); + } + } + { + use hyper::header::{Authorization, Basic, Bearer}; + use std::ops::Deref; + if let Some(basic) = req.headers.get::>() { + req.extensions.insert::(AuthData::Basic(basic.deref().clone())); + return Ok(()); + } + } + { + use hyper::header::{Authorization, Basic, Bearer}; + use std::ops::Deref; + if let Some(bearer) = req.headers.get::>() { + req.extensions.insert::(AuthData::Bearer(bearer.deref().clone())); + return Ok(()); + } + } + + Ok(()) + } +} From 3472c68e0bcd261fd526c9fe3c0de8d573c0611e Mon Sep 17 00:00:00 2001 From: Ramkumar Chandrasekaran Date: Thu, 19 Oct 2017 10:16:56 +0000 Subject: [PATCH 180/197] bug fixes (#6743) --- modules/swagger-codegen/src/main/resources/r/api.mustache | 2 +- modules/swagger-codegen/src/main/resources/r/model.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/r/api.mustache b/modules/swagger-codegen/src/main/resources/r/api.mustache index eb64e29cdb2..c2f9f75fbea 100644 --- a/modules/swagger-codegen/src/main/resources/r/api.mustache +++ b/modules/swagger-codegen/src/main/resources/r/api.mustache @@ -67,7 +67,7 @@ {{#hasBodyParam}} {{#bodyParams}} if (!missing(`{{paramName}}`)) { - body <- `{{paramName}}`$toJSON() + body <- `{{paramName}}`$toJSONString() } {{/bodyParams}} {{/hasBodyParam}} diff --git a/modules/swagger-codegen/src/main/resources/r/model.mustache b/modules/swagger-codegen/src/main/resources/r/model.mustache index 9181c8e51e2..94ae74085e2 100644 --- a/modules/swagger-codegen/src/main/resources/r/model.mustache +++ b/modules/swagger-codegen/src/main/resources/r/model.mustache @@ -98,7 +98,7 @@ sprintf( '{ {{#vars}} - "{{baseName}}": {{#isListContainer}}[{{/isListContainer}}{{#isPrimitiveType}}{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}"%s"{{/isNumeric}}{{/isPrimitiveType}}{{^isPrimitiveType}}%s{{/isPrimitiveType}}{{#isListContainer}}]{{/isListContainer}}{{#hasMore}},{{/hasMore}} + "{{baseName}}": {{#isListContainer}}[{{/isListContainer}}{{#isPrimitiveType}}{{#isNumeric}}%d{{/isNumeric}}{{^isNumeric}}%s{{/isNumeric}}{{/isPrimitiveType}}{{^isPrimitiveType}}%s{{/isPrimitiveType}}{{#isListContainer}}]{{/isListContainer}}{{#hasMore}},{{/hasMore}} {{/vars}} }', {{#vars}} From f0b7daeec691ea0fb0d48139cc4610b0a49d285b Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 19 Oct 2017 20:17:08 +0800 Subject: [PATCH 181/197] [Rust] rename rust2 to rust-server (#6747) * rename rust2 to rust-server * update rust-server batch file to use petstore test spec --- README.md | 2 +- ...t2-petstore.sh => rust-server-petstore.sh} | 2 +- bin/windows/rust-server-petstore.bat | 10 ++ ...st2Codegen.java => RustServerCodegen.java} | 16 +-- .../services/io.swagger.codegen.CodegenConfig | 2 +- .../{rust2 => rust-server}/Cargo.mustache | 0 .../{rust2 => rust-server}/README.mustache | 0 .../{rust2 => rust-server}/cargo-config | 0 .../{rust2 => rust-server}/client.mustache | 0 .../{rust2 => rust-server}/example-ca.pem | 0 .../example-client.mustache | 0 .../example-server-chain.pem | 0 .../example-server-key.pem | 0 .../example-server.mustache | 0 .../example-server_lib.mustache | 0 .../{rust2 => rust-server}/gitignore | 0 .../{rust2 => rust-server}/lib.mustache | 0 .../{rust2 => rust-server}/mimetypes.mustache | 0 .../{rust2 => rust-server}/models.mustache | 0 .../{rust2 => rust-server}/server.mustache | 0 .../{rust2 => rust-server}/swagger.mustache | 0 .../petstore/rust-server}/.cargo/config | 0 .../petstore/rust-server}/.gitignore | 0 .../rust-server}/.swagger-codegen-ignore | 0 .../rust-server}/.swagger-codegen/VERSION | 0 .../petstore/rust-server}/Cargo.toml | 0 .../petstore/rust-server}/README.md | 3 +- .../petstore/rust-server}/api/swagger.yaml | 111 ++++++++++-------- .../petstore/rust-server}/examples/ca.pem | 0 .../petstore/rust-server}/examples/client.rs | 7 ++ .../rust-server}/examples/server-chain.pem | 0 .../rust-server}/examples/server-key.pem | 0 .../petstore/rust-server}/examples/server.rs | 0 .../rust-server}/examples/server_lib/mod.rs | 8 ++ .../petstore/rust-server}/src/client.rs | 56 ++++++++- .../petstore/rust-server}/src/lib.rs | 16 +++ .../petstore/rust-server}/src/mimetypes.rs | 4 + .../petstore/rust-server}/src/models.rs | 99 ---------------- .../petstore/rust-server}/src/server.rs | 73 +++++++++++- 39 files changed, 237 insertions(+), 172 deletions(-) rename bin/{rust2-petstore.sh => rust-server-petstore.sh} (78%) create mode 100755 bin/windows/rust-server-petstore.bat rename modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/{Rust2Codegen.java => RustServerCodegen.java} (98%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/Cargo.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/README.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/cargo-config (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/client.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-ca.pem (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-client.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-server-chain.pem (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-server-key.pem (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-server.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/example-server_lib.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/gitignore (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/lib.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/mimetypes.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/models.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/server.mustache (100%) rename modules/swagger-codegen/src/main/resources/{rust2 => rust-server}/swagger.mustache (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/.cargo/config (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/.gitignore (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/.swagger-codegen-ignore (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/.swagger-codegen/VERSION (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/Cargo.toml (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/README.md (96%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/api/swagger.yaml (97%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/ca.pem (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/client.rs (97%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/server-chain.pem (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/server-key.pem (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/server.rs (100%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/examples/server_lib/mod.rs (96%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/src/client.rs (97%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/src/lib.rs (97%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/src/mimetypes.rs (96%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/src/models.rs (91%) rename samples/{client/petstore/rust2 => server/petstore/rust-server}/src/server.rs (97%) diff --git a/README.md b/README.md index ed4a2870fb7..8181f2eecde 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, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **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), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) +- **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), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust**, **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** diff --git a/bin/rust2-petstore.sh b/bin/rust-server-petstore.sh similarity index 78% rename from bin/rust2-petstore.sh rename to bin/rust-server-petstore.sh index 8428f974cdd..e7e655d4812 100755 --- a/bin/rust2-petstore.sh +++ b/bin/rust-server-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/rust2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l rust2 -o samples/client/petstore/rust2 -DpackageName=petstore_api" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/rust-server -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l rust-server -o samples/server/petstore/rust-server -DpackageName=petstore_api" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/rust-server-petstore.bat b/bin/windows/rust-server-petstore.bat new file mode 100755 index 00000000000..ff565aa1e04 --- /dev/null +++ b/bin/windows/rust-server-petstore.bat @@ -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 -DloggerPath=conf/log4j.properties +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -l rust-server -o samples\server\petstore\rust-server + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java similarity index 98% rename from modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java rename to modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java index 76f218aa50f..301e6532038 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Rust2Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java @@ -27,25 +27,25 @@ import java.util.Map.Entry; import org.apache.commons.lang3.StringUtils; -public class Rust2Codegen extends DefaultCodegen implements CodegenConfig { +public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { - private static final Logger LOGGER = LoggerFactory.getLogger(Rust2Codegen.class); + private static final Logger LOGGER = LoggerFactory.getLogger(RustServerCodegen.class); private HashMap modelXmlNames = new HashMap(); protected String apiVersion = "1.0.0"; protected int serverPort = 8080; protected String projectName = "swagger-server"; - protected String apiPath = "rust2"; + protected String apiPath = "rust-server"; protected String packageName; protected String packageVersion; protected String externCrateName; - public Rust2Codegen() { + public RustServerCodegen() { super(); // set the output folder here - outputFolder = "generated-code/rust2"; + outputFolder = "generated-code/rust-server"; /* * Models. You can write model files using the modelTemplateFiles map. @@ -66,7 +66,7 @@ public Rust2Codegen() { * 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. */ - embeddedTemplateDir = templateDir = "rust2"; + embeddedTemplateDir = templateDir = "rust-server"; /* * Reserved words. Override this with reserved words specific to your language @@ -232,7 +232,7 @@ public CodegenType getTag() { */ @Override public String getName() { - return "rust2"; + return "rust-server"; } /** @@ -243,7 +243,7 @@ public String getName() { */ @Override public String getHelp() { - return "Generates a Rust client/server library using the swagger-codegen project."; + return "Generates a Rust client/server library (beta) using the swagger-codegen project."; } @Override 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 c1cd7c72641..54e82bf7350 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 @@ -55,8 +55,8 @@ io.swagger.codegen.languages.RClientCodegen io.swagger.codegen.languages.Rails5ServerCodegen io.swagger.codegen.languages.RestbedCodegen io.swagger.codegen.languages.RubyClientCodegen -io.swagger.codegen.languages.Rust2Codegen io.swagger.codegen.languages.RustClientCodegen +io.swagger.codegen.languages.RustServerCodegen io.swagger.codegen.languages.ScalaClientCodegen io.swagger.codegen.languages.ScalatraServerCodegen io.swagger.codegen.languages.ScalazClientCodegen diff --git a/modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache b/modules/swagger-codegen/src/main/resources/rust-server/Cargo.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/Cargo.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/Cargo.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/README.mustache b/modules/swagger-codegen/src/main/resources/rust-server/README.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/README.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/README.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/cargo-config b/modules/swagger-codegen/src/main/resources/rust-server/cargo-config similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/cargo-config rename to modules/swagger-codegen/src/main/resources/rust-server/cargo-config diff --git a/modules/swagger-codegen/src/main/resources/rust2/client.mustache b/modules/swagger-codegen/src/main/resources/rust-server/client.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/client.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/client.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-ca.pem b/modules/swagger-codegen/src/main/resources/rust-server/example-ca.pem similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-ca.pem rename to modules/swagger-codegen/src/main/resources/rust-server/example-ca.pem diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-client.mustache b/modules/swagger-codegen/src/main/resources/rust-server/example-client.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-client.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/example-client.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem b/modules/swagger-codegen/src/main/resources/rust-server/example-server-chain.pem similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-server-chain.pem rename to modules/swagger-codegen/src/main/resources/rust-server/example-server-chain.pem diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem b/modules/swagger-codegen/src/main/resources/rust-server/example-server-key.pem similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-server-key.pem rename to modules/swagger-codegen/src/main/resources/rust-server/example-server-key.pem diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server.mustache b/modules/swagger-codegen/src/main/resources/rust-server/example-server.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-server.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/example-server.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache b/modules/swagger-codegen/src/main/resources/rust-server/example-server_lib.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/example-server_lib.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/example-server_lib.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/gitignore b/modules/swagger-codegen/src/main/resources/rust-server/gitignore similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/gitignore rename to modules/swagger-codegen/src/main/resources/rust-server/gitignore diff --git a/modules/swagger-codegen/src/main/resources/rust2/lib.mustache b/modules/swagger-codegen/src/main/resources/rust-server/lib.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/lib.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/lib.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache b/modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/mimetypes.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/models.mustache b/modules/swagger-codegen/src/main/resources/rust-server/models.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/models.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/models.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/server.mustache b/modules/swagger-codegen/src/main/resources/rust-server/server.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/server.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/server.mustache diff --git a/modules/swagger-codegen/src/main/resources/rust2/swagger.mustache b/modules/swagger-codegen/src/main/resources/rust-server/swagger.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/rust2/swagger.mustache rename to modules/swagger-codegen/src/main/resources/rust-server/swagger.mustache diff --git a/samples/client/petstore/rust2/.cargo/config b/samples/server/petstore/rust-server/.cargo/config similarity index 100% rename from samples/client/petstore/rust2/.cargo/config rename to samples/server/petstore/rust-server/.cargo/config diff --git a/samples/client/petstore/rust2/.gitignore b/samples/server/petstore/rust-server/.gitignore similarity index 100% rename from samples/client/petstore/rust2/.gitignore rename to samples/server/petstore/rust-server/.gitignore diff --git a/samples/client/petstore/rust2/.swagger-codegen-ignore b/samples/server/petstore/rust-server/.swagger-codegen-ignore similarity index 100% rename from samples/client/petstore/rust2/.swagger-codegen-ignore rename to samples/server/petstore/rust-server/.swagger-codegen-ignore diff --git a/samples/client/petstore/rust2/.swagger-codegen/VERSION b/samples/server/petstore/rust-server/.swagger-codegen/VERSION similarity index 100% rename from samples/client/petstore/rust2/.swagger-codegen/VERSION rename to samples/server/petstore/rust-server/.swagger-codegen/VERSION diff --git a/samples/client/petstore/rust2/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml similarity index 100% rename from samples/client/petstore/rust2/Cargo.toml rename to samples/server/petstore/rust-server/Cargo.toml diff --git a/samples/client/petstore/rust2/README.md b/samples/server/petstore/rust-server/README.md similarity index 96% rename from samples/client/petstore/rust2/README.md rename to samples/server/petstore/rust-server/README.md index 1e98c25281c..987a3df7c98 100644 --- a/samples/client/petstore/rust2/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-09-26T16:36:55.563+01:00 +- Build date: 2017-10-19T17:45:37.995+08:00 ## Examples @@ -50,6 +50,7 @@ cargo run --example client FakeOuterStringSerialize cargo run --example client TestClientModel cargo run --example client TestEndpointParameters cargo run --example client TestEnumParameters +cargo run --example client TestInlineAdditionalProperties cargo run --example client TestJsonFormData cargo run --example client TestClassname cargo run --example client AddPet diff --git a/samples/client/petstore/rust2/api/swagger.yaml b/samples/server/petstore/rust-server/api/swagger.yaml similarity index 97% rename from samples/client/petstore/rust2/api/swagger.yaml rename to samples/server/petstore/rust-server/api/swagger.yaml index 1dc845be640..3d1431f92e2 100644 --- a/samples/client/petstore/rust2/api/swagger.yaml +++ b/samples/server/petstore/rust-server/api/swagger.yaml @@ -10,7 +10,7 @@ info: contact: email: "apiteam@swagger.io" license: - name: "Apache 2.0" + name: "Apache-2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "petstore.swagger.io:80" basePath: "/v2" @@ -54,7 +54,7 @@ paths: refName: "Pet" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "ADD_PET" consumesXml: true responses: @@ -95,7 +95,7 @@ paths: refName: "Pet" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "UPDATE_PET" consumesXml: true responses: @@ -450,7 +450,7 @@ paths: refName: "Order" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "PLACE_ORDER" responses: 200: @@ -568,7 +568,7 @@ paths: refName: "User" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "CREATE_USER" responses: default: @@ -602,7 +602,7 @@ paths: $ref: "#/definitions/User" formatString: "{:?}" example: "&Vec::new()" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "CREATE_USERS_WITH_ARRAY_INPUT" responses: default: @@ -635,7 +635,7 @@ paths: $ref: "#/definitions/User" formatString: "{:?}" example: "&Vec::new()" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "CREATE_USERS_WITH_LIST_INPUT" responses: default: @@ -787,7 +787,7 @@ paths: refName: "User" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "UPDATE_USER" responses: 400: @@ -856,7 +856,7 @@ paths: refName: "Client" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "TEST_CLASSNAME" responses: 200: @@ -1169,7 +1169,7 @@ paths: refName: "Client" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "TEST_CLIENT_MODEL" responses: 200: @@ -1202,7 +1202,7 @@ paths: refName: "OuterNumber" formatString: "{:?}" example: "None" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "FAKE_OUTER_NUMBER_SERIALIZE" responses: 200: @@ -1234,7 +1234,7 @@ paths: refName: "OuterString" formatString: "{:?}" example: "None" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "FAKE_OUTER_STRING_SERIALIZE" responses: 200: @@ -1266,7 +1266,7 @@ paths: refName: "OuterBoolean" formatString: "{:?}" example: "None" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "FAKE_OUTER_BOOLEAN_SERIALIZE" responses: 200: @@ -1298,7 +1298,7 @@ paths: refName: "OuterComposite" formatString: "{:?}" example: "None" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "FAKE_OUTER_COMPOSITE_SERIALIZE" responses: 200: @@ -1365,7 +1365,6 @@ paths: uppercase_message: "SUCCESS" uppercase_data_type: "XMLOBJECT" producesXml: true - has_namespace: "true" operation_id: "get_xml_features" uppercase_operation_id: "GET_XML_FEATURES" path: "/fake/xmlFeatures" @@ -1388,8 +1387,7 @@ paths: refName: "xmlObject" formatString: "{:?}" example: "???" - has_namespace: "true" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "POST_XML_FEATURES" consumesXml: true responses: @@ -1403,6 +1401,41 @@ paths: HttpMethod: "Post" httpmethod: "post" noClientExample: true + /fake/inline-additionalProperties: + post: + tags: + - "fake" + summary: "test inline additionalProperties" + description: "" + operationId: "testInlineAdditionalProperties" + consumes: + - "application/json" + parameters: + - in: "body" + name: "param" + description: "request body" + required: true + schema: + type: "object" + additionalProperties: + type: "string" + upperCaseName: "PARAM" + refName: null + formatString: "{:?}" + example: "???" + model_key: "OuterBoolean" + uppercase_operation_id: "TEST_INLINE_ADDITIONAL_PROPERTIES" + responses: + 200: + description: "successful operation" + uppercase_operation_id: "TEST_INLINE_ADDITIONAL_PROPERTIES" + uppercase_message: "SUCCESSFUL_OPERATION" + operation_id: "test_inline_additional_properties" + uppercase_operation_id: "TEST_INLINE_ADDITIONAL_PROPERTIES" + path: "/fake/inline-additionalProperties" + HttpMethod: "Post" + httpmethod: "post" + noClientExample: true /another-fake/dummy: patch: tags: @@ -1425,7 +1458,7 @@ paths: refName: "Client" formatString: "{:?}" example: "???" - model_key: "itemList" + model_key: "OuterBoolean" uppercase_operation_id: "TEST_SPECIAL_TAGS" responses: 200: @@ -1968,15 +2001,6 @@ definitions: - "approved" - "delivered" upperCaseName: "OUTERENUM" - OuterNumber: - type: "number" - upperCaseName: "OUTERNUMBER" - OuterString: - type: "string" - upperCaseName: "OUTERSTRING" - OuterBoolean: - type: "boolean" - upperCaseName: "OUTERBOOLEAN" OuterComposite: type: "object" properties: @@ -1991,30 +2015,15 @@ definitions: my_number: {} my_boolean: {} upperCaseName: "OUTERCOMPOSITE" - xmlObject: - required: - - "itemList" - - "name" - properties: - name: - type: "string" - example: "myXmlObject" - itemList: - $ref: "#/definitions/itemList" - itemXmlName: "item" - xml: - name: "group" - namespace: "http://example.com/schema.xsd" - upperCaseName: "XMLOBJECT" - itemList: - type: "array" - items: - type: "string" - example: "my item" - xml: - name: "item" - upperCaseName: "ITEMLIST" - itemXmlName: "item" + OuterNumber: + type: "number" + upperCaseName: "OUTERNUMBER" + OuterString: + type: "string" + upperCaseName: "OUTERSTRING" + OuterBoolean: + type: "boolean" + upperCaseName: "OUTERBOOLEAN" externalDocs: description: "Find out more about Swagger" url: "http://swagger.io" diff --git a/samples/client/petstore/rust2/examples/ca.pem b/samples/server/petstore/rust-server/examples/ca.pem similarity index 100% rename from samples/client/petstore/rust2/examples/ca.pem rename to samples/server/petstore/rust-server/examples/ca.pem diff --git a/samples/client/petstore/rust2/examples/client.rs b/samples/server/petstore/rust-server/examples/client.rs similarity index 97% rename from samples/client/petstore/rust2/examples/client.rs rename to samples/server/petstore/rust-server/examples/client.rs index 6fd88afc5b6..28ec7fa7268 100644 --- a/samples/client/petstore/rust2/examples/client.rs +++ b/samples/server/petstore/rust-server/examples/client.rs @@ -24,6 +24,7 @@ use petstore_api::{ApiNoContext, ContextWrapperExt, TestClientModelResponse, TestEndpointParametersResponse, TestEnumParametersResponse, + TestInlineAdditionalPropertiesResponse, TestJsonFormDataResponse, TestClassnameResponse, AddPetResponse, @@ -151,6 +152,12 @@ fn main() { println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); }, + // Disabled because there's no example. + // Some("TestInlineAdditionalProperties") => { + // let result = client.test_inline_additional_properties(???).wait(); + // println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); + // }, + Some("TestJsonFormData") => { let result = client.test_json_form_data("param_example".to_string(), "param2_example".to_string()).wait(); println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from(""))); diff --git a/samples/client/petstore/rust2/examples/server-chain.pem b/samples/server/petstore/rust-server/examples/server-chain.pem similarity index 100% rename from samples/client/petstore/rust2/examples/server-chain.pem rename to samples/server/petstore/rust-server/examples/server-chain.pem diff --git a/samples/client/petstore/rust2/examples/server-key.pem b/samples/server/petstore/rust-server/examples/server-key.pem similarity index 100% rename from samples/client/petstore/rust2/examples/server-key.pem rename to samples/server/petstore/rust-server/examples/server-key.pem diff --git a/samples/client/petstore/rust2/examples/server.rs b/samples/server/petstore/rust-server/examples/server.rs similarity index 100% rename from samples/client/petstore/rust2/examples/server.rs rename to samples/server/petstore/rust-server/examples/server.rs diff --git a/samples/client/petstore/rust2/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/examples/server_lib/mod.rs similarity index 96% rename from samples/client/petstore/rust2/examples/server_lib/mod.rs rename to samples/server/petstore/rust-server/examples/server_lib/mod.rs index 598d4a0e946..ad6fed845a9 100644 --- a/samples/client/petstore/rust2/examples/server_lib/mod.rs +++ b/samples/server/petstore/rust-server/examples/server_lib/mod.rs @@ -20,6 +20,7 @@ use petstore_api::{Api, ApiError, Context, TestClientModelResponse, TestEndpointParametersResponse, TestEnumParametersResponse, + TestInlineAdditionalPropertiesResponse, TestJsonFormDataResponse, TestClassnameResponse, AddPetResponse, @@ -121,6 +122,13 @@ impl Api for Server { Box::new(futures::failed("Generic failure".into())) } + /// test inline additionalProperties + fn test_inline_additional_properties(&self, param: object, context: &Context) -> Box + Send> { + let context = context.clone(); + println!("test_inline_additional_properties({:?}) - X-Span-ID: {:?}", param, context.x_span_id.unwrap_or(String::from("")).clone()); + Box::new(futures::failed("Generic failure".into())) + } + /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String, context: &Context) -> Box + Send> { let context = context.clone(); diff --git a/samples/client/petstore/rust2/src/client.rs b/samples/server/petstore/rust-server/src/client.rs similarity index 97% rename from samples/client/petstore/rust2/src/client.rs rename to samples/server/petstore/rust-server/src/client.rs index b5a5e27bf6b..d98fe03ca2c 100644 --- a/samples/client/petstore/rust2/src/client.rs +++ b/samples/server/petstore/rust-server/src/client.rs @@ -45,6 +45,7 @@ use {Api, TestClientModelResponse, TestEndpointParametersResponse, TestEnumParametersResponse, + TestInlineAdditionalPropertiesResponse, TestJsonFormDataResponse, TestClassnameResponse, AddPetResponse, @@ -307,11 +308,7 @@ impl Api for Client { let url = format!("{}/v2/fake/xmlFeatures?", self.base_path); - - let mut namespaces = BTreeMap::new(); - // An empty string is used to indicate a global namespace in xmltree. - namespaces.insert("".to_string(), models::namespaces::XMLOBJECT.clone()); - let body = serde_xml_rs::to_string_with_namespaces(¶m_xml_object, namespaces).expect("impossible to fail to serialize"); + let body = serde_xml_rs::to_string(¶m_xml_object).expect("impossible to fail to serialize"); let hyper_client = (self.hyper_client)(); let request = hyper_client.request(hyper::method::Method::Post, &url); @@ -744,6 +741,55 @@ impl Api for Client { Box::new(futures::done(result)) } + fn test_inline_additional_properties(&self, param_param: object, context: &Context) -> Box + Send> { + + + let url = format!("{}/v2/fake/inline-additionalProperties?", self.base_path); + + + let body = serde_json::to_string(¶m_param).expect("impossible to fail to serialize"); + + let hyper_client = (self.hyper_client)(); + let request = hyper_client.request(hyper::method::Method::Post, &url); + let mut custom_headers = hyper::header::Headers::new(); + + let request = request.body(&body); + + custom_headers.set(ContentType(mimetypes::requests::TEST_INLINE_ADDITIONAL_PROPERTIES.clone())); + context.x_span_id.as_ref().map(|header| custom_headers.set(XSpanId(header.clone()))); + + + let request = request.headers(custom_headers); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn parse_response(mut response: hyper::client::response::Response) -> Result { + match response.status.to_u16() { + 200 => { + + + Ok(TestInlineAdditionalPropertiesResponse::SuccessfulOperation) + }, + code => { + let mut buf = [0; 100]; + let debug_body = match response.read(&mut buf) { + Ok(len) => match str::from_utf8(&buf[..len]) { + Ok(body) => Cow::from(body), + Err(_) => Cow::from(format!("", &buf[..len].to_vec())), + }, + Err(e) => Cow::from(format!("", e)), + }; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + response.headers, + debug_body))) + } + } + } + + let result = request.send().map_err(|e| ApiError(format!("No response received: {}", e))).and_then(parse_response); + Box::new(futures::done(result)) + } + fn test_json_form_data(&self, param_param: String, param_param2: String, context: &Context) -> Box + Send> { diff --git a/samples/client/petstore/rust2/src/lib.rs b/samples/server/petstore/rust-server/src/lib.rs similarity index 97% rename from samples/client/petstore/rust2/src/lib.rs rename to samples/server/petstore/rust-server/src/lib.rs index a923266374c..f5a047e710b 100644 --- a/samples/client/petstore/rust2/src/lib.rs +++ b/samples/server/petstore/rust-server/src/lib.rs @@ -85,6 +85,11 @@ pub enum TestEnumParametersResponse { NotFound , } +#[derive(Debug, PartialEq)] +pub enum TestInlineAdditionalPropertiesResponse { + SuccessfulOperation , +} + #[derive(Debug, PartialEq)] pub enum TestJsonFormDataResponse { SuccessfulOperation , @@ -244,6 +249,9 @@ pub trait Api { /// To test enum parameters fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option, context: &Context) -> Box + Send>; + /// test inline additionalProperties + fn test_inline_additional_properties(&self, param: object, context: &Context) -> Box + Send>; + /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String, context: &Context) -> Box + Send>; @@ -345,6 +353,9 @@ pub trait ApiNoContext { /// To test enum parameters fn test_enum_parameters(&self, enum_form_string_array: Option<&Vec>, enum_form_string: Option, enum_header_string_array: Option<&Vec>, enum_header_string: Option, enum_query_string_array: Option<&Vec>, enum_query_string: Option, enum_query_integer: Option, enum_query_double: Option) -> Box + Send>; + /// test inline additionalProperties + fn test_inline_additional_properties(&self, param: object) -> Box + Send>; + /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String) -> Box + Send>; @@ -477,6 +488,11 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().test_enum_parameters(enum_form_string_array, enum_form_string, enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, &self.context()) } + /// test inline additionalProperties + fn test_inline_additional_properties(&self, param: object) -> Box + Send> { + self.api().test_inline_additional_properties(param, &self.context()) + } + /// test json serialization of form data fn test_json_form_data(&self, param: String, param2: String) -> Box + Send> { self.api().test_json_form_data(param, param2, &self.context()) diff --git a/samples/client/petstore/rust2/src/mimetypes.rs b/samples/server/petstore/rust-server/src/mimetypes.rs similarity index 96% rename from samples/client/petstore/rust2/src/mimetypes.rs rename to samples/server/petstore/rust-server/src/mimetypes.rs index 1f9be4ef9c5..11bcff7abd1 100644 --- a/samples/client/petstore/rust2/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/src/mimetypes.rs @@ -89,6 +89,10 @@ pub mod requests { lazy_static! { pub static ref TEST_CLIENT_MODEL: Mime = mime!(Application/Json); } + /// Create Mime objects for the request content types for TestInlineAdditionalProperties + lazy_static! { + pub static ref TEST_INLINE_ADDITIONAL_PROPERTIES: Mime = mime!(Application/Json); + } /// Create Mime objects for the request content types for TestClassname lazy_static! { pub static ref TEST_CLASSNAME: Mime = mime!(Application/Json); diff --git a/samples/client/petstore/rust2/src/models.rs b/samples/server/petstore/rust-server/src/models.rs similarity index 91% rename from samples/client/petstore/rust2/src/models.rs rename to samples/server/petstore/rust-server/src/models.rs index 8b5a3251c8b..e956aae2bb9 100644 --- a/samples/client/petstore/rust2/src/models.rs +++ b/samples/server/petstore/rust-server/src/models.rs @@ -481,76 +481,6 @@ impl HasOnlyReadOnly { } } -// Utility function for wrapping list elements when serializing xml -fn wrap_in_item(item: &Vec, serializer: S) -> Result -where - S: Serializer, -{ - serde_xml_rs::wrap_primitives(item, serializer, "item") -} - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct ItemList(Vec); - -impl ::std::convert::From> for ItemList { - fn from(x: Vec) -> Self { - ItemList(x) - } -} - -impl ::std::convert::From for Vec { - fn from(x: ItemList) -> Self { - x.0 - } -} - -impl ::std::iter::FromIterator for ItemList { - fn from_iter>(u: U) -> Self { - ItemList(Vec::::from_iter(u)) - } -} - -impl ::std::iter::IntoIterator for ItemList { - type Item = String; - type IntoIter = ::std::vec::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_iter() - } -} - -impl<'a> ::std::iter::IntoIterator for &'a ItemList { - type Item = &'a String; - type IntoIter = ::std::slice::Iter<'a, String>; - - fn into_iter(self) -> Self::IntoIter { - (&self.0).into_iter() - } -} - -impl<'a> ::std::iter::IntoIterator for &'a mut ItemList { - type Item = &'a mut String; - type IntoIter = ::std::slice::IterMut<'a, String>; - - fn into_iter(self) -> Self::IntoIter { - (&mut self.0).into_iter() - } -} - -impl ::std::ops::Deref for ItemList { - type Target = Vec; - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl ::std::ops::DerefMut for ItemList { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct List { #[serde(rename = "123-list")] @@ -1056,27 +986,6 @@ impl User { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(rename = "group")] -pub struct XmlObject { - #[serde(rename = "name")] - pub name: String, - - #[serde(rename = "itemList")] - #[serde(serialize_with = "wrap_in_item")] - pub item_list: models::ItemList, - -} - -impl XmlObject { - pub fn new(name: String, item_list: models::ItemList, ) -> XmlObject { - XmlObject { - name: name, - item_list: item_list, - } - } -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Cat { #[serde(rename = "className")] @@ -1126,11 +1035,3 @@ impl Dog { } } } - -//XML namespaces -pub mod namespaces { - lazy_static!{ - pub static ref XMLOBJECT: String = "http://example.com/schema.xsd".to_string(); - - } -} diff --git a/samples/client/petstore/rust2/src/server.rs b/samples/server/petstore/rust-server/src/server.rs similarity index 97% rename from samples/client/petstore/rust2/src/server.rs rename to samples/server/petstore/rust-server/src/server.rs index a8d32981940..22e52fe4706 100644 --- a/samples/client/petstore/rust2/src/server.rs +++ b/samples/server/petstore/rust-server/src/server.rs @@ -47,6 +47,7 @@ use {Api, TestClientModelResponse, TestEndpointParametersResponse, TestEnumParametersResponse, + TestInlineAdditionalPropertiesResponse, TestJsonFormDataResponse, TestClassnameResponse, AddPetResponse, @@ -200,11 +201,7 @@ fn add_routes(router: &mut Router, api: T) where T: Api + Send + Sync + Clone Ok(rsp) => match rsp { GetXmlFeaturesResponse::Success(body) => { - - let mut namespaces = BTreeMap::new(); - // An empty string is used to indicate a global namespace in xmltree. - namespaces.insert("".to_string(), models::namespaces::XMLOBJECT.clone()); - let body_string = serde_xml_rs::to_string_with_namespaces(&body, namespaces).expect("impossible to fail to serialize"); + let body_string = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); let mut response = Response::with((status::Status::from_u16(200), body_string)); response.headers.set(ContentType(mimetypes::responses::GET_XML_FEATURES_SUCCESS.clone())); @@ -781,6 +778,72 @@ fn add_routes(router: &mut Router, api: T) where T: Api + Send + Sync + Clone }, "TestEnumParameters"); + let api_clone = api.clone(); + router.post( + "/v2/fake/inline-additionalProperties", + move |req: &mut Request| { + let mut context = Context::default(); + + // Helper function to provide a code block to use `?` in (to be replaced by the `catch` block when it exists). + fn handle_request(req: &mut Request, api: &T, context: &mut Context) -> Result where T: Api { + + context.x_span_id = Some(req.headers.get::().map(XSpanId::to_string).unwrap_or_else(|| self::uuid::Uuid::new_v4().to_string())); + context.auth_data = req.extensions.remove::(); + context.authorization = req.extensions.remove::(); + + + + + // Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + + let param_param_raw = req.get::().map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter param - not valid UTF-8: {}", e))))?; + let mut unused_elements = Vec::new(); + + let param_param = if let Some(param_param_raw) = param_param_raw { + let deserializer = &mut serde_json::Deserializer::from_str(¶m_param_raw); + + let param_param: Option = serde_ignored::deserialize(deserializer, |path| { + warn!("Ignoring unknown field in body: {}", path); + unused_elements.push(path.to_string()); + }).map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse body parameter param - doesn't match schema: {}", e))))?; + + param_param + } else { + None + }; + let param_param = param_param.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter param".to_string())))?; + + + match api.test_inline_additional_properties(param_param, context).wait() { + Ok(rsp) => match rsp { + TestInlineAdditionalPropertiesResponse::SuccessfulOperation => { + + + let mut response = Response::with((status::Status::from_u16(200))); + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + if !unused_elements.is_empty() { + response.headers.set(Warning(format!("Ignoring unknown fields in body: {:?}", unused_elements))); + } + Ok(response) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + Err(Response::with((status::InternalServerError, "An internal error occurred".to_string()))) + } + } + } + + handle_request(req, &api_clone, &mut context).or_else(|mut response| { + context.x_span_id.as_ref().map(|header| response.headers.set(XSpanId(header.clone()))); + Ok(response) + }) + }, + "TestInlineAdditionalProperties"); + let api_clone = api.clone(); router.get( "/v2/fake/jsonFormData", From 8a5c361c1a599dff786d05f198cfb5c617ee0063 Mon Sep 17 00:00:00 2001 From: Peter Grman Date: Fri, 20 Oct 2017 05:04:16 +0200 Subject: [PATCH 182/197] Bugfix/6750 name clash between npm request and parameter called request (#6753) * rename request to $request * update examples files * rename $request to localVarRequest * rename oder variables to localVar... --- .../resources/typescript-node/api.mustache | 50 +- .../petstore/typescript-node/default/api.ts | 570 +++++++++--------- .../petstore/typescript-node/npm/api.ts | 570 +++++++++--------- 3 files changed, 595 insertions(+), 595 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache index bbcc9cce84c..81661719588 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/api.mustache @@ -1,5 +1,5 @@ {{>licenseInfo}} -import request = require('request'); +import localVarRequest = require('request'); import http = require('http'); {{^supportsES6}} import Promise = require('bluebird'); @@ -216,13 +216,13 @@ export interface Authentication { /** * Apply authentication settings to header and query params. */ - applyToRequest(requestOptions: request.Options): void; + applyToRequest(requestOptions: localVarRequest.Options): void; } export class HttpBasicAuth implements Authentication { public username: string; public password: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { requestOptions.auth = { username: this.username, password: this.password } @@ -235,7 +235,7 @@ export class ApiKeyAuth implements Authentication { constructor(private location: string, private paramName: string) { } - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (this.location == "query") { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { @@ -247,7 +247,7 @@ export class ApiKeyAuth implements Authentication { export class OAuth implements Authentication { public accessToken: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } @@ -257,7 +257,7 @@ export class OAuth implements Authentication { export class VoidAuth implements Authentication { public username: string; public password: string; - applyToRequest(_: request.Options): void { + applyToRequest(_: localVarRequest.Options): void { // Do nothing } } @@ -371,9 +371,9 @@ export class {{classname}} { public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; {{#allParams}} {{#required}} @@ -386,34 +386,34 @@ export class {{classname}} { {{/allParams}} {{#queryParams}} if ({{paramName}} !== undefined) { - queryParameters['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); + localVarQueryParameters['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); } {{/queryParams}} {{#headerParams}} - headerParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); + localVarHeaderParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); {{/headerParams}} - let useFormData = false; + let localVarUseFormData = false; {{#formParams}} if ({{paramName}} !== undefined) { {{#isFile}} - formParams['{{baseName}}'] = {{paramName}}; + localVarFormParams['{{baseName}}'] = {{paramName}}; {{/isFile}} {{^isFile}} - formParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); + localVarFormParams['{{baseName}}'] = ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}"); {{/isFile}} } {{#isFile}} - useFormData = true; + localVarUseFormData = true; {{/isFile}} {{/formParams}} - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: '{{httpMethod}}', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, {{^isResponseFile}} @@ -428,20 +428,20 @@ export class {{classname}} { }; {{#authMethods}} - this.authentications.{{name}}.applyToRequest(requestOptions); + this.authentications.{{name}}.applyToRequest(localVarRequestOptions); {{/authMethods}} - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { diff --git a/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index 45fabd8e1d5..2f5dd35c4f1 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import request = require('request'); +import localVarRequest = require('request'); import http = require('http'); import Promise = require('bluebird'); @@ -424,13 +424,13 @@ export interface Authentication { /** * Apply authentication settings to header and query params. */ - applyToRequest(requestOptions: request.Options): void; + applyToRequest(requestOptions: localVarRequest.Options): void; } export class HttpBasicAuth implements Authentication { public username: string; public password: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { requestOptions.auth = { username: this.username, password: this.password } @@ -443,7 +443,7 @@ export class ApiKeyAuth implements Authentication { constructor(private location: string, private paramName: string) { } - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (this.location == "query") { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { @@ -455,7 +455,7 @@ export class ApiKeyAuth implements Authentication { export class OAuth implements Authentication { public accessToken: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } @@ -465,7 +465,7 @@ export class OAuth implements Authentication { export class VoidAuth implements Authentication { public username: string; public password: string; - applyToRequest(_: request.Options): void { + applyToRequest(_: localVarRequest.Options): void { // Do nothing } } @@ -528,9 +528,9 @@ export class PetApi { */ public addPet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -538,31 +538,31 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Pet") }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -584,41 +584,41 @@ export class PetApi { public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - headerParams['api_key'] = ObjectSerializer.serialize(apiKey, "string"); + localVarHeaderParams['api_key'] = ObjectSerializer.serialize(apiKey, "string"); - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -638,9 +638,9 @@ export class PetApi { */ public findPetsByStatus (status: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByStatus'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -648,34 +648,34 @@ export class PetApi { } if (status !== undefined) { - queryParameters['status'] = ObjectSerializer.serialize(status, "Array"); + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "Array"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -696,9 +696,9 @@ export class PetApi { */ public findPetsByTags (tags: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByTags'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -706,34 +706,34 @@ export class PetApi { } if (tags !== undefined) { - queryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); + localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -755,9 +755,9 @@ export class PetApi { public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -765,30 +765,30 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -809,9 +809,9 @@ export class PetApi { */ public updatePet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -819,31 +819,31 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Pet") }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -866,9 +866,9 @@ export class PetApi { public updatePetWithForm (petId: number, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -876,38 +876,38 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; if (name !== undefined) { - formParams['name'] = ObjectSerializer.serialize(name, "string"); + localVarFormParams['name'] = ObjectSerializer.serialize(name, "string"); } if (status !== undefined) { - formParams['status'] = ObjectSerializer.serialize(status, "string"); + localVarFormParams['status'] = ObjectSerializer.serialize(status, "string"); } - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -930,9 +930,9 @@ export class PetApi { public uploadFile (petId: number, additionalMetadata?: string, file?: Buffer) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -940,39 +940,39 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; if (additionalMetadata !== undefined) { - formParams['additionalMetadata'] = ObjectSerializer.serialize(additionalMetadata, "string"); + localVarFormParams['additionalMetadata'] = ObjectSerializer.serialize(additionalMetadata, "string"); } if (file !== undefined) { - formParams['file'] = file; + localVarFormParams['file'] = file; } - useFormData = true; + localVarUseFormData = true; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ApiResponse; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1046,9 +1046,9 @@ export class StoreApi { public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -1056,28 +1056,28 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1096,35 +1096,35 @@ export class StoreApi { */ public getInventory () : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> { const localVarPath = this.basePath + '/store/inventory'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1146,9 +1146,9 @@ export class StoreApi { public getOrderById (orderId: number) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -1156,28 +1156,28 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1198,9 +1198,9 @@ export class StoreApi { */ public placeOrder (body: Order) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1208,29 +1208,29 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Order") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1303,9 +1303,9 @@ export class UserApi { */ public createUser (body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1313,29 +1313,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "User") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1355,9 +1355,9 @@ export class UserApi { */ public createUsersWithArrayInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithArray'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1365,29 +1365,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Array") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1407,9 +1407,9 @@ export class UserApi { */ public createUsersWithListInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithList'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1417,29 +1417,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Array") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1460,9 +1460,9 @@ export class UserApi { public deleteUser (username: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1470,28 +1470,28 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1512,9 +1512,9 @@ export class UserApi { public getUserByName (username: string) : Promise<{ response: http.ClientResponse; body: User; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1522,28 +1522,28 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: User; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1565,9 +1565,9 @@ export class UserApi { */ public loginUser (username: string, password: string) : Promise<{ response: http.ClientResponse; body: string; }> { const localVarPath = this.basePath + '/user/login'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1580,36 +1580,36 @@ export class UserApi { } if (username !== undefined) { - queryParameters['username'] = ObjectSerializer.serialize(username, "string"); + localVarQueryParameters['username'] = ObjectSerializer.serialize(username, "string"); } if (password !== undefined) { - queryParameters['password'] = ObjectSerializer.serialize(password, "string"); + localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: string; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1629,33 +1629,33 @@ export class UserApi { */ public logoutUser () : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/logout'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1677,9 +1677,9 @@ export class UserApi { public updateUser (username: string, body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1692,29 +1692,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "User") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index 45fabd8e1d5..2f5dd35c4f1 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -import request = require('request'); +import localVarRequest = require('request'); import http = require('http'); import Promise = require('bluebird'); @@ -424,13 +424,13 @@ export interface Authentication { /** * Apply authentication settings to header and query params. */ - applyToRequest(requestOptions: request.Options): void; + applyToRequest(requestOptions: localVarRequest.Options): void; } export class HttpBasicAuth implements Authentication { public username: string; public password: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { requestOptions.auth = { username: this.username, password: this.password } @@ -443,7 +443,7 @@ export class ApiKeyAuth implements Authentication { constructor(private location: string, private paramName: string) { } - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (this.location == "query") { (requestOptions.qs)[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { @@ -455,7 +455,7 @@ export class ApiKeyAuth implements Authentication { export class OAuth implements Authentication { public accessToken: string; - applyToRequest(requestOptions: request.Options): void { + applyToRequest(requestOptions: localVarRequest.Options): void { if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } @@ -465,7 +465,7 @@ export class OAuth implements Authentication { export class VoidAuth implements Authentication { public username: string; public password: string; - applyToRequest(_: request.Options): void { + applyToRequest(_: localVarRequest.Options): void { // Do nothing } } @@ -528,9 +528,9 @@ export class PetApi { */ public addPet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -538,31 +538,31 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Pet") }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -584,41 +584,41 @@ export class PetApi { public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - headerParams['api_key'] = ObjectSerializer.serialize(apiKey, "string"); + localVarHeaderParams['api_key'] = ObjectSerializer.serialize(apiKey, "string"); - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -638,9 +638,9 @@ export class PetApi { */ public findPetsByStatus (status: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByStatus'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -648,34 +648,34 @@ export class PetApi { } if (status !== undefined) { - queryParameters['status'] = ObjectSerializer.serialize(status, "Array"); + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "Array"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -696,9 +696,9 @@ export class PetApi { */ public findPetsByTags (tags: Array) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/pet/findByTags'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -706,34 +706,34 @@ export class PetApi { } if (tags !== undefined) { - queryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); + localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -755,9 +755,9 @@ export class PetApi { public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -765,30 +765,30 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -809,9 +809,9 @@ export class PetApi { */ public updatePet (body: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -819,31 +819,31 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Pet") }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -866,9 +866,9 @@ export class PetApi { public updatePetWithForm (petId: number, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -876,38 +876,38 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; if (name !== undefined) { - formParams['name'] = ObjectSerializer.serialize(name, "string"); + localVarFormParams['name'] = ObjectSerializer.serialize(name, "string"); } if (status !== undefined) { - formParams['status'] = ObjectSerializer.serialize(status, "string"); + localVarFormParams['status'] = ObjectSerializer.serialize(status, "string"); } - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -930,9 +930,9 @@ export class PetApi { public uploadFile (petId: number, additionalMetadata?: string, file?: Buffer) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -940,39 +940,39 @@ export class PetApi { } - let useFormData = false; + let localVarUseFormData = false; if (additionalMetadata !== undefined) { - formParams['additionalMetadata'] = ObjectSerializer.serialize(additionalMetadata, "string"); + localVarFormParams['additionalMetadata'] = ObjectSerializer.serialize(additionalMetadata, "string"); } if (file !== undefined) { - formParams['file'] = file; + localVarFormParams['file'] = file; } - useFormData = true; + localVarUseFormData = true; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ApiResponse; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1046,9 +1046,9 @@ export class StoreApi { public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -1056,28 +1056,28 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1096,35 +1096,35 @@ export class StoreApi { */ public getInventory () : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> { const localVarPath = this.basePath + '/store/inventory'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.api_key.applyToRequest(localVarRequestOptions); - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1146,9 +1146,9 @@ export class StoreApi { public getOrderById (orderId: number) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -1156,28 +1156,28 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1198,9 +1198,9 @@ export class StoreApi { */ public placeOrder (body: Order) : Promise<{ response: http.ClientResponse; body: Order; }> { const localVarPath = this.basePath + '/store/order'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1208,29 +1208,29 @@ export class StoreApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Order") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1303,9 +1303,9 @@ export class UserApi { */ public createUser (body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1313,29 +1313,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "User") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1355,9 +1355,9 @@ export class UserApi { */ public createUsersWithArrayInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithArray'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1365,29 +1365,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Array") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1407,9 +1407,9 @@ export class UserApi { */ public createUsersWithListInput (body: Array) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/createWithList'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -1417,29 +1417,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'POST', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "Array") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1460,9 +1460,9 @@ export class UserApi { public deleteUser (username: string) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1470,28 +1470,28 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1512,9 +1512,9 @@ export class UserApi { public getUserByName (username: string) : Promise<{ response: http.ClientResponse; body: User; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1522,28 +1522,28 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: User; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1565,9 +1565,9 @@ export class UserApi { */ public loginUser (username: string, password: string) : Promise<{ response: http.ClientResponse; body: string; }> { const localVarPath = this.basePath + '/user/login'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1580,36 +1580,36 @@ export class UserApi { } if (username !== undefined) { - queryParameters['username'] = ObjectSerializer.serialize(username, "string"); + localVarQueryParameters['username'] = ObjectSerializer.serialize(username, "string"); } if (password !== undefined) { - queryParameters['password'] = ObjectSerializer.serialize(password, "string"); + localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string"); } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: string; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1629,33 +1629,33 @@ export class UserApi { */ public logoutUser () : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/logout'; - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'GET', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { @@ -1677,9 +1677,9 @@ export class UserApi { public updateUser (username: string, body: User) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); - let queryParameters: any = {}; - let headerParams: any = (Object).assign({}, this.defaultHeaders); - let formParams: any = {}; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -1692,29 +1692,29 @@ export class UserApi { } - let useFormData = false; + let localVarUseFormData = false; - let requestOptions: request.Options = { + let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', - qs: queryParameters, - headers: headerParams, + qs: localVarQueryParameters, + headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(body, "User") }; - this.authentications.default.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(localVarRequestOptions); - if (Object.keys(formParams).length) { - if (useFormData) { - (requestOptions).formData = formParams; + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - requestOptions.form = formParams; + localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { - request(requestOptions, (error, response, body) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { From d0ec683a86ac9d16ace2d6fd9fffc853e381ae9a Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Thu, 19 Oct 2017 22:06:28 -0500 Subject: [PATCH 183/197] revert changes to fakes yaml (#6758) * revert changes to fakes yaml the yaml currently includes invalid definitions that do not exist: ('#/definitions/xmlObject'). revert to known good yaml state. * update template creators --- README.md | 1 + ...ith-fake-endpoints-models-for-testing.yaml | 34 ++----------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 8181f2eecde..8f432b095f4 100644 --- a/README.md +++ b/README.md @@ -970,6 +970,7 @@ Here is a list of template creators: * Groovy: @victorgit * Go: @wing328 * Go (rewritten in 2.3.0): @antihax + * Haskell (http-client): @jonschoning * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofit2): @emilianobonassi diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index d7ba1c46589..c947e95d926 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -898,35 +898,6 @@ paths: responses: '200': description: successful operation - /fake/xmlFeatures: - get: - summary: Get some XML - operationId: getXmlFeatures - produces: - - application/xml - consumes: - - application/xml - responses: - 200: - description: Success - schema: - $ref: '#/definitions/xmlObject' - post: - parameters: - - name: xmlObject - in: body - required: true - schema: - $ref: '#/definitions/xmlObject' - summary: Post some xml - operationId: postXmlFeatures - produces: - - application/xml - consumes: - - application/xml - responses: - 200: - description: Success /fake/inline-additionalProperties: post: tags: @@ -971,7 +942,6 @@ paths: description: successful operation schema: $ref: '#/definitions/Client' - securityDefinitions: petstore_auth: type: oauth2 @@ -987,7 +957,7 @@ securityDefinitions: api_key_query: type: apiKey name: api_key_query - in: query + in: query http_basic_test: type: basic definitions: @@ -1010,7 +980,7 @@ definitions: type: string description: Order Status enum: - - placedtest + - placed - approved - delivered complete: From 649811d54240af89b239e032b75f94ddb8da797b Mon Sep 17 00:00:00 2001 From: kinok Date: Fri, 20 Oct 2017 09:00:27 +0200 Subject: [PATCH 184/197] [JavaScript] Handle custom request.agent (#6737) * Handle custom request.agent * better semantic --- .../src/main/resources/Javascript/ApiClient.mustache | 10 ++++++++++ .../main/resources/Javascript/es6/ApiClient.mustache | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index aa7fdc70c71..4c5a5d60e7f 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -91,6 +91,10 @@ this.agent = new superagent.agent(); } + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; }; {{#emitJSDoc}} /** @@ -408,6 +412,12 @@ // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); diff --git a/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache index 17e9000179d..0e2a92da149 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/es6/ApiClient.mustache @@ -78,6 +78,12 @@ export default class ApiClient { if (typeof window === 'undefined') { this.agent = new superagent.agent(); } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; + } {{#emitJSDoc}}/** @@ -396,6 +402,11 @@ export default class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); From 36f14ab757883bf1566ac1814804f131e4f59f71 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 20 Oct 2017 22:16:41 +0800 Subject: [PATCH 185/197] update JS petstore samples --- .../client/petstore/javascript-es6/README.md | 1 + .../petstore/javascript-es6/docs/FakeApi.md | 46 ++++++++++++++++ .../petstore/javascript-es6/src/ApiClient.js | 11 ++++ .../javascript-es6/src/api/FakeApi.js | 44 ++++++++++++++++ .../petstore/javascript-promise-es6/README.md | 1 + .../javascript-promise-es6/docs/FakeApi.md | 44 ++++++++++++++++ .../javascript-promise-es6/src/ApiClient.js | 11 ++++ .../javascript-promise-es6/src/api/FakeApi.js | 50 ++++++++++++++++++ .../petstore/javascript-promise/README.md | 1 + .../javascript-promise/docs/FakeApi.md | 44 ++++++++++++++++ .../javascript-promise/src/ApiClient.js | 10 ++++ .../javascript-promise/src/api/FakeApi.js | 52 +++++++++++++++++++ samples/client/petstore/javascript/README.md | 1 + .../petstore/javascript/docs/FakeApi.md | 47 +++++++++++++++++ .../petstore/javascript/src/ApiClient.js | 10 ++++ .../petstore/javascript/src/api/FakeApi.js | 46 ++++++++++++++++ 16 files changed, 419 insertions(+) diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 7d74305e7ce..bbf7a369ff4 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -100,6 +100,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 037f5a2a9b0..cafe836d687 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/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 @@ -385,6 +386,51 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(param) + +test inline additionalProperties + + + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.FakeApi(); + +let param = null; // Object | request body + + +apiInstance.testInlineAdditionalProperties(param, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index a2556b62caa..11497febbe9 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -83,6 +83,12 @@ export default class ApiClient { if (typeof window === 'undefined') { this.agent = new superagent.agent(); } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; + } /** @@ -398,6 +404,11 @@ export default class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 99741813c03..1a5f16e94bc 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -391,6 +391,50 @@ export default class FakeApi { ); } + /** + * Callback function to receive the result of the testInlineAdditionalProperties operation. + * @callback module:api/FakeApi~testInlineAdditionalPropertiesCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @param {module:api/FakeApi~testInlineAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response + */ + testInlineAdditionalProperties(param, callback) { + let postBody = param; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + + return this.apiClient.callApi( + '/fake/inline-additionalProperties', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** * Callback function to receive the result of the testJsonFormData operation. * @callback module:api/FakeApi~testJsonFormDataCallback diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index c668dfd721f..67af003b88d 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 41d3591a9bb..366f5ff7bed 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/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 @@ -371,6 +372,49 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(param) + +test inline additionalProperties + + + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.FakeApi(); + +let param = null; // Object | request body + +apiInstance.testInlineAdditionalProperties(param).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index b68c9055546..a6a1dddd8ef 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -83,6 +83,12 @@ export default class ApiClient { if (typeof window === 'undefined') { this.agent = new superagent.agent(); } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; + } /** @@ -391,6 +397,11 @@ export default class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 9bcf6796fa3..0b0b8a1a816 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -451,6 +451,56 @@ export default class FakeApi { } + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + testInlineAdditionalPropertiesWithHttpInfo(param) { + let postBody = param; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + + return this.apiClient.callApi( + '/fake/inline-additionalProperties', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + testInlineAdditionalProperties(param) { + return this.testInlineAdditionalPropertiesWithHttpInfo(param) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + /** * test json serialization of form data * diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 35942f17ef6..3dbc2e674d8 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -122,6 +122,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index 52969139d4b..8fd0dc0a6d9 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/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 @@ -371,6 +372,49 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(param) + +test inline additionalProperties + + + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var param = null; // Object | request body + +apiInstance.testInlineAdditionalProperties(param).then(function() { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 0d8ec3e5007..691f409db9e 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -98,6 +98,10 @@ this.agent = new superagent.agent(); } + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; }; /** @@ -406,6 +410,12 @@ // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 0b3b9c24e2f..0f06c046e0e 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -478,6 +478,58 @@ } + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response + */ + this.testInlineAdditionalPropertiesWithHttpInfo = function(param) { + var postBody = param; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = []; + var returnType = null; + + return this.apiClient.callApi( + '/fake/inline-additionalProperties', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @return {Promise} a {@link https://www.promisejs.org/|Promise} + */ + this.testInlineAdditionalProperties = function(param) { + return this.testInlineAdditionalPropertiesWithHttpInfo(param) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + /** * test json serialization of form data * diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 402689f894a..556caa6e87b 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -125,6 +125,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*SwaggerPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data *SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index a4e995f4333..f9b086c52d5 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/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 @@ -392,6 +393,52 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(param) + +test inline additionalProperties + + + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var param = null; // Object | request body + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +apiInstance.testInlineAdditionalProperties(param, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** > testJsonFormData(param, param2) diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 5ea52184385..246500eb3e4 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -98,6 +98,10 @@ this.agent = new superagent.agent(); } + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; }; /** @@ -415,6 +419,12 @@ // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout request.timeout(this.timeout); diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index f7621dc00c9..81ac51959d8 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -418,6 +418,52 @@ ); } + /** + * Callback function to receive the result of the testInlineAdditionalProperties operation. + * @callback module:api/FakeApi~testInlineAdditionalPropertiesCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * test inline additionalProperties + * + * @param {Object} param request body + * @param {module:api/FakeApi~testInlineAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response + */ + this.testInlineAdditionalProperties = function(param, callback) { + var postBody = param; + + // verify the required parameter 'param' is set + if (param === undefined || param === null) { + throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = []; + var returnType = null; + + return this.apiClient.callApi( + '/fake/inline-additionalProperties', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** * Callback function to receive the result of the testJsonFormData operation. * @callback module:api/FakeApi~testJsonFormDataCallback From 4d994a2045a0b596b6b5e5d110fcb2f308d66db9 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 20 Oct 2017 22:17:09 +0800 Subject: [PATCH 186/197] update ruby petstore samples --- samples/client/petstore/ruby/README.md | 14 +- .../petstore/ruby/docs/AnotherFakeApi.md | 56 ++++++++ .../client/petstore/ruby/docs/DefaultApi.md | 93 +++++++++++++ samples/client/petstore/ruby/docs/FakeApi.md | 47 +++++++ samples/client/petstore/ruby/lib/petstore.rb | 1 + .../ruby/lib/petstore/api/another_fake_api.rb | 78 +++++++++++ .../ruby/lib/petstore/api/default_api.rb | 126 ++++++++++++++++++ .../ruby/lib/petstore/api/fake_api.rb | 52 ++++++++ .../ruby/spec/api/another_fake_api_spec.rb | 47 +++++++ .../ruby/spec/api/default_api_spec.rb | 58 ++++++++ 10 files changed, 566 insertions(+), 6 deletions(-) create mode 100644 samples/client/petstore/ruby/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/ruby/docs/DefaultApi.md create mode 100644 samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb create mode 100644 samples/client/petstore/ruby/lib/petstore/api/default_api.rb create mode 100644 samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb create mode 100644 samples/client/petstore/ruby/spec/api/default_api_spec.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 4903f762470..84d01e186c4 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -54,17 +54,17 @@ Please follow the [installation](#installation) procedure and then run the follo # Load the gem require 'petstore' -api_instance = Petstore::FakeApi.new +api_instance = Petstore::AnotherFakeApi.new + +body = Petstore::Client.new # Client | client model -opts = { - body: Petstore::OuterBoolean.new # OuterBoolean | Input boolean as post body -} begin - result = api_instance.fake_outer_boolean_serialize(opts) + #To test special tags + result = api_instance.test_special_tags(body) p result rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" + puts "Exception when calling AnotherFakeApi->test_special_tags: #{e}" end ``` @@ -75,6 +75,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*Petstore::AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -82,6 +83,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..a198df230eb --- /dev/null +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# Petstore::AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **test_special_tags** +> Client test_special_tags(body) + +To test special tags + +To test special tags + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::AnotherFakeApi.new + +body = Petstore::Client.new # Client | client model + + +begin + #To test special tags + result = api_instance.test_special_tags(body) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->test_special_tags: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md new file mode 100644 index 00000000000..0790d1278a1 --- /dev/null +++ b/samples/client/petstore/ruby/docs/DefaultApi.md @@ -0,0 +1,93 @@ +# Petstore::DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_xml_features**](DefaultApi.md#get_xml_features) | **GET** /fake/xmlFeatures | Get some XML +[**post_xml_features**](DefaultApi.md#post_xml_features) | **POST** /fake/xmlFeatures | Post some xml + + +# **get_xml_features** +> XmlObject get_xml_features + +Get some XML + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::DefaultApi.new + +begin + #Get some XML + result = api_instance.get_xml_features + p result +rescue Petstore::ApiError => e + puts "Exception when calling DefaultApi->get_xml_features: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**XmlObject**](XmlObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml + - **Accept**: application/xml + + + +# **post_xml_features** +> post_xml_features(xml_object) + +Post some xml + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::DefaultApi.new + +xml_object = Petstore::XmlObject.new # XmlObject | + + +begin + #Post some xml + api_instance.post_xml_features(xml_object) +rescue Petstore::ApiError => e + puts "Exception when calling DefaultApi->post_xml_features: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_object** | [**XmlObject**](XmlObject.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml + - **Accept**: application/xml + + + diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 97c2efb11c2..72aaf8460e4 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data @@ -393,6 +394,52 @@ No authorization required +# **test_inline_additional_properties** +> test_inline_additional_properties(param) + +test inline additionalProperties + + + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +param = nil # Object | request body + + +begin + #test inline additionalProperties + api_instance.test_inline_additional_properties(param) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + + # **test_json_form_data** > test_json_form_data(param, param2) diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 605e44333dd..e2cafdbe706 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -55,6 +55,7 @@ require 'petstore/models/dog' # APIs +require 'petstore/api/another_fake_api' require 'petstore/api/fake_api' require 'petstore/api/fake_classname_tags123_api' require 'petstore/api/pet_api' diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb new file mode 100644 index 00000000000..5c93e4521c8 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -0,0 +1,78 @@ +=begin +#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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require "uri" + +module Petstore + class AnotherFakeApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # To test special tags + # To test special tags + # @param body client model + # @param [Hash] opts the optional parameters + # @return [Client] + def test_special_tags(body, opts = {}) + data, _status_code, _headers = test_special_tags_with_http_info(body, opts) + return data + end + + # To test special tags + # To test special tags + # @param body client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers + def test_special_tags_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: AnotherFakeApi.test_special_tags ..." + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AnotherFakeApi.test_special_tags" + end + # resource path + local_var_path = "/another-fake/dummy" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Client') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnotherFakeApi#test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb new file mode 100644 index 00000000000..1d542fe7548 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -0,0 +1,126 @@ +=begin +#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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require "uri" + +module Petstore + class DefaultApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Get some XML + # + # @param [Hash] opts the optional parameters + # @return [XmlObject] + def get_xml_features(opts = {}) + data, _status_code, _headers = get_xml_features_with_http_info(opts) + return data + end + + # Get some XML + # + # @param [Hash] opts the optional parameters + # @return [Array<(XmlObject, Fixnum, Hash)>] XmlObject data, response status code and response headers + def get_xml_features_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.get_xml_features ..." + end + # resource path + local_var_path = "/fake/xmlFeatures" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'XmlObject') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_xml_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Post some xml + # + # @param xml_object + # @param [Hash] opts the optional parameters + # @return [nil] + def post_xml_features(xml_object, opts = {}) + post_xml_features_with_http_info(xml_object, opts) + return nil + end + + # Post some xml + # + # @param xml_object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def post_xml_features_with_http_info(xml_object, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.post_xml_features ..." + end + # verify the required parameter 'xml_object' is set + if @api_client.config.client_side_validation && xml_object.nil? + fail ArgumentError, "Missing the required parameter 'xml_object' when calling DefaultApi.post_xml_features" + end + # resource path + local_var_path = "/fake/xmlFeatures" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(xml_object) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#post_xml_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 7951ac39df8..56e68e4422b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -517,6 +517,58 @@ def test_enum_parameters_with_http_info(opts = {}) return data, status_code, headers end + # test inline additionalProperties + # + # @param param request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_additional_properties(param, opts = {}) + test_inline_additional_properties_with_http_info(param, opts) + return nil + end + + # test inline additionalProperties + # + # @param param request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_inline_additional_properties_with_http_info(param, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.test_inline_additional_properties ..." + end + # verify the required parameter 'param' is set + if @api_client.config.client_side_validation && param.nil? + fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_inline_additional_properties" + end + # resource path + local_var_path = "/fake/inline-additionalProperties" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(param) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # test json serialization of form data # # @param param field1 diff --git a/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb new file mode 100644 index 00000000000..26935923316 --- /dev/null +++ b/samples/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -0,0 +1,47 @@ +=begin +#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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::AnotherFakeApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'AnotherFakeApi' do + before do + # run before each test + @instance = Petstore::AnotherFakeApi.new + end + + after do + # run after each test + end + + describe 'test an instance of AnotherFakeApi' do + it 'should create an instance of AnotherFakeApi' do + expect(@instance).to be_instance_of(Petstore::AnotherFakeApi) + end + end + + # unit tests for test_special_tags + # To test special tags + # To test special tags + # @param body client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'test_special_tags test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/client/petstore/ruby/spec/api/default_api_spec.rb new file mode 100644 index 00000000000..714609b9900 --- /dev/null +++ b/samples/client/petstore/ruby/spec/api/default_api_spec.rb @@ -0,0 +1,58 @@ +=begin +#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: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.3.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::DefaultApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'DefaultApi' do + before do + # run before each test + @instance = Petstore::DefaultApi.new + end + + after do + # run after each test + end + + describe 'test an instance of DefaultApi' do + it 'should create an instance of DefaultApi' do + expect(@instance).to be_instance_of(Petstore::DefaultApi) + end + end + + # unit tests for get_xml_features + # Get some XML + # + # @param [Hash] opts the optional parameters + # @return [XmlObject] + describe 'get_xml_features test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for post_xml_features + # Post some xml + # + # @param xml_object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'post_xml_features test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end From af2089777d9cea7525a26e8b0ccd7a1ec4f7925c Mon Sep 17 00:00:00 2001 From: Giulio Pulina Date: Sat, 21 Oct 2017 17:57:43 +0200 Subject: [PATCH 187/197] Fixed link to open issues (correct label is 'help wanted') (#6779) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f432b095f4..a727baf5872 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) -:star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star: +:star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: @@ -1032,7 +1032,7 @@ Here is a list of template creators: Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22) + - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc From d2eb7cb35bb273880aa562f12b94dcec5b24d420 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 22 Oct 2017 22:09:50 +0800 Subject: [PATCH 188/197] remove unused files from Ruby petstore client --- .../client/petstore/ruby/docs/DefaultApi.md | 93 ------------- .../ruby/lib/petstore/api/default_api.rb | 126 ------------------ .../ruby/spec/api/default_api_spec.rb | 58 -------- 3 files changed, 277 deletions(-) delete mode 100644 samples/client/petstore/ruby/docs/DefaultApi.md delete mode 100644 samples/client/petstore/ruby/lib/petstore/api/default_api.rb delete mode 100644 samples/client/petstore/ruby/spec/api/default_api_spec.rb diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md deleted file mode 100644 index 0790d1278a1..00000000000 --- a/samples/client/petstore/ruby/docs/DefaultApi.md +++ /dev/null @@ -1,93 +0,0 @@ -# Petstore::DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_xml_features**](DefaultApi.md#get_xml_features) | **GET** /fake/xmlFeatures | Get some XML -[**post_xml_features**](DefaultApi.md#post_xml_features) | **POST** /fake/xmlFeatures | Post some xml - - -# **get_xml_features** -> XmlObject get_xml_features - -Get some XML - -### Example -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::DefaultApi.new - -begin - #Get some XML - result = api_instance.get_xml_features - p result -rescue Petstore::ApiError => e - puts "Exception when calling DefaultApi->get_xml_features: #{e}" -end -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**XmlObject**](XmlObject.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml - - **Accept**: application/xml - - - -# **post_xml_features** -> post_xml_features(xml_object) - -Post some xml - -### Example -```ruby -# load the gem -require 'petstore' - -api_instance = Petstore::DefaultApi.new - -xml_object = Petstore::XmlObject.new # XmlObject | - - -begin - #Post some xml - api_instance.post_xml_features(xml_object) -rescue Petstore::ApiError => e - puts "Exception when calling DefaultApi->post_xml_features: #{e}" -end -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_object** | [**XmlObject**](XmlObject.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml - - **Accept**: application/xml - - - diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb deleted file mode 100644 index 1d542fe7548..00000000000 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ /dev/null @@ -1,126 +0,0 @@ -=begin -#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: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end - -require "uri" - -module Petstore - class DefaultApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - - # Get some XML - # - # @param [Hash] opts the optional parameters - # @return [XmlObject] - def get_xml_features(opts = {}) - data, _status_code, _headers = get_xml_features_with_http_info(opts) - return data - end - - # Get some XML - # - # @param [Hash] opts the optional parameters - # @return [Array<(XmlObject, Fixnum, Hash)>] XmlObject data, response status code and response headers - def get_xml_features_with_http_info(opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DefaultApi.get_xml_features ..." - end - # resource path - local_var_path = "/fake/xmlFeatures" - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml']) - - # form parameters - form_params = {} - - # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => 'XmlObject') - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_xml_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Post some xml - # - # @param xml_object - # @param [Hash] opts the optional parameters - # @return [nil] - def post_xml_features(xml_object, opts = {}) - post_xml_features_with_http_info(xml_object, opts) - return nil - end - - # Post some xml - # - # @param xml_object - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def post_xml_features_with_http_info(xml_object, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug "Calling API: DefaultApi.post_xml_features ..." - end - # verify the required parameter 'xml_object' is set - if @api_client.config.client_side_validation && xml_object.nil? - fail ArgumentError, "Missing the required parameter 'xml_object' when calling DefaultApi.post_xml_features" - end - # resource path - local_var_path = "/fake/xmlFeatures" - - # query parameters - query_params = {} - - # header parameters - header_params = {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/xml']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml']) - - # form parameters - form_params = {} - - # http body (model) - post_body = @api_client.object_to_http_body(xml_object) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#post_xml_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/samples/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/client/petstore/ruby/spec/api/default_api_spec.rb deleted file mode 100644 index 714609b9900..00000000000 --- a/samples/client/petstore/ruby/spec/api/default_api_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#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: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.3.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for Petstore::DefaultApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'DefaultApi' do - before do - # run before each test - @instance = Petstore::DefaultApi.new - end - - after do - # run after each test - end - - describe 'test an instance of DefaultApi' do - it 'should create an instance of DefaultApi' do - expect(@instance).to be_instance_of(Petstore::DefaultApi) - end - end - - # unit tests for get_xml_features - # Get some XML - # - # @param [Hash] opts the optional parameters - # @return [XmlObject] - describe 'get_xml_features test' do - it "should work" do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - # unit tests for post_xml_features - # Post some xml - # - # @param xml_object - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'post_xml_features test' do - it "should work" do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end From 7cbd36e75be360da1dd44a6a8c9db48ba802916c Mon Sep 17 00:00:00 2001 From: Gustavo Paz <32820138+gustavoapaz@users.noreply.github.com> Date: Sun, 22 Oct 2017 10:00:48 -0500 Subject: [PATCH 189/197] [Java][JAXRS-CXF] Improve API documentation in the CXF Server stub and Client generation (#6708) * Inclusion of API documentation in CXF Server stub generation * Inclusion of API documentation in CXF client generation * Update of the Petstore CXF server sample * Update of the Petstore CXF client sample * Update of the Petstore CXF server annotated base path sample * Update of the Petstore CXF server non spring application sample * Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328 * Update of the Petstore CXF samples --- .../main/resources/JavaJaxRS/cxf/api.mustache | 20 +++++++ .../JavaJaxRS/cxf/apiServiceImpl.mustache | 20 +++++++ .../resources/JavaJaxRS/cxf/api_test.mustache | 14 ++++- .../resources/JavaJaxRS/cxf/pojo.mustache | 8 +++ .../main/resources/JavaJaxRS/cxf/pom.mustache | 3 ++ .../JavaJaxRS/cxf/server/pom.mustache | 3 ++ .../client/petstore/jaxrs-cxf-client/pom.xml | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 54 +++++++++++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 30 +++++++++++ .../src/gen/java/io/swagger/api/UserApi.java | 54 +++++++++++++++++++ .../gen/java/io/swagger/model/Category.java | 3 ++ .../io/swagger/model/ModelApiResponse.java | 3 ++ .../src/gen/java/io/swagger/model/Order.java | 6 +++ .../src/gen/java/io/swagger/model/Pet.java | 6 +++ .../src/gen/java/io/swagger/model/Tag.java | 3 ++ .../src/gen/java/io/swagger/model/User.java | 6 +++ .../jaxrs-cxf-annotated-base-path/pom.xml | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 54 +++++++++++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 30 +++++++++++ .../src/gen/java/io/swagger/api/UserApi.java | 54 +++++++++++++++++++ .../gen/java/io/swagger/model/Category.java | 3 ++ .../io/swagger/model/ModelApiResponse.java | 3 ++ .../src/gen/java/io/swagger/model/Order.java | 6 +++ .../src/gen/java/io/swagger/model/Pet.java | 6 +++ .../src/gen/java/io/swagger/model/Tag.java | 3 ++ .../src/gen/java/io/swagger/model/User.java | 6 +++ .../swagger/api/impl/PetApiServiceImpl.java | 54 +++++++++++++++++++ .../swagger/api/impl/StoreApiServiceImpl.java | 30 +++++++++++ .../swagger/api/impl/UserApiServiceImpl.java | 54 +++++++++++++++++++ .../petstore/jaxrs-cxf-non-spring-app/pom.xml | 1 + .../src/gen/java/io/swagger/api/PetApi.java | 54 +++++++++++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 30 +++++++++++ .../src/gen/java/io/swagger/api/UserApi.java | 54 +++++++++++++++++++ .../gen/java/io/swagger/model/Category.java | 3 ++ .../io/swagger/model/ModelApiResponse.java | 3 ++ .../src/gen/java/io/swagger/model/Order.java | 6 +++ .../src/gen/java/io/swagger/model/Pet.java | 6 +++ .../src/gen/java/io/swagger/model/Tag.java | 3 ++ .../src/gen/java/io/swagger/model/User.java | 6 +++ .../swagger/api/impl/PetApiServiceImpl.java | 54 +++++++++++++++++++ .../swagger/api/impl/StoreApiServiceImpl.java | 30 +++++++++++ .../swagger/api/impl/UserApiServiceImpl.java | 54 +++++++++++++++++++ samples/server/petstore/jaxrs-cxf/pom.xml | 3 +- .../java/io/swagger/api/AnotherFakeApi.java | 12 +++++ .../src/gen/java/io/swagger/api/FakeApi.java | 30 +++++++++++ .../swagger/api/FakeClassnameTags123Api.java | 10 ++++ .../src/gen/java/io/swagger/api/PetApi.java | 54 +++++++++++++++++++ .../src/gen/java/io/swagger/api/StoreApi.java | 30 +++++++++++ .../src/gen/java/io/swagger/api/UserApi.java | 54 +++++++++++++++++++ .../java/io/swagger/model/Capitalization.java | 3 ++ .../gen/java/io/swagger/model/ClassModel.java | 3 ++ .../io/swagger/model/Model200Response.java | 3 ++ .../java/io/swagger/model/ModelReturn.java | 3 ++ .../src/gen/java/io/swagger/model/Name.java | 3 ++ .../src/gen/java/io/swagger/model/Order.java | 3 ++ .../src/gen/java/io/swagger/model/Pet.java | 3 ++ .../src/gen/java/io/swagger/model/User.java | 3 ++ .../api/impl/AnotherFakeApiServiceImpl.java | 12 +++++ .../swagger/api/impl/FakeApiServiceImpl.java | 30 +++++++++++ .../FakeClassnameTags123ApiServiceImpl.java | 10 ++++ .../swagger/api/impl/PetApiServiceImpl.java | 54 +++++++++++++++++++ .../swagger/api/impl/StoreApiServiceImpl.java | 30 +++++++++++ .../swagger/api/impl/UserApiServiceImpl.java | 54 +++++++++++++++++++ 63 files changed, 1247 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache index 5e33aefc1d3..8bc7a22fd76 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -22,6 +22,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; {{/useBeanValidation}} +{{#appName}} +/** + * {{{appName}}} + * + {{#appDescription}} + *

{{{appDescription}}} + * + {{/appDescription}} + */ +{{/appName}} @Path("{{^useAnnotatedBasePath}}/{{/useAnnotatedBasePath}}{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}") @Api(value = "/", description = "{{description}}") {{#addConsumesProducesJson}} @@ -32,6 +42,16 @@ public interface {{classname}} { {{#operations}} {{#operation}} + {{#summary}} + /** + * {{summary}} + * + {{#notes}} + * {{notes}} + * + {{/notes}} + */ + {{/summary}} @{{httpMethod}} {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index d216ed02538..f677e3a835e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -25,9 +25,29 @@ import org.springframework.stereotype.Service; {{/useSpringAnnotationConfig}} {{#description}} {{/description}} +{{#appName}} +/** + * {{{appName}}} + * + {{#appDescription}} + *

{{{appDescription}}} + {{/appDescription}} + * + */ +{{/appName}} public class {{classname}}ServiceImpl implements {{classname}} { {{#operations}} {{#operation}} + {{#summary}} + /** + * {{summary}} + * + {{#notes}} + * {{notes}} + * + {{/notes}} + */ + {{/summary}} public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { // TODO: Implement... diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache index d32c2e3a964..67a7db05386 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/api_test.mustache @@ -42,7 +42,15 @@ import org.springframework.test.context.web.WebAppConfiguration; /** - * API tests for {{classname}} + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + *

{{{appDescription}}} + * + {{/appDescription}} + * API tests for {{classname}} */ {{#generateSpringBootApplication}} @RunWith(SpringJUnit4ClassRunner.class) @@ -91,10 +99,14 @@ public class {{classname}}Test { {{#operations}}{{#operation}} /** + {{#summary}} * {{summary}} * + {{#notes}} * {{notes}} * + {{/notes}} + {{/summary}} * @throws ApiException * if the Api call fails */ diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 0412381d534..eb53f2248cf 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -17,6 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; {{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} {{/withXml}} {{#description}} +/** + * {{{description}}} + **/ @ApiModel(description="{{{description}}}") {{/description}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { @@ -29,6 +32,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) {{/withXml}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#description}} + /** + * {{{description}}} + **/ +{{/description}} private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}} {{#vars}} 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 df7a5a3bcb4..02c853a7559 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -4,6 +4,9 @@ {{artifactId}} jar {{artifactId}} + {{#appDescription}} + {{appDescription}} + {{/appDescription}} {{artifactVersion}} src/main/java 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 2bc2739b1fe..c7be1d0b172 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 @@ -4,6 +4,9 @@ {{artifactId}} war {{artifactId}} + {{#appDescription}} + {{appDescription}} + {{/appDescription}} {{artifactVersion}} src/main/java diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index 0c5cec23101..e2be3c4f26b 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -4,6 +4,7 @@ jaxrs-cxf-petstore-client war jaxrs-cxf-petstore-client + 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. 1.0.0 src/main/java diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/PetApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/PetApi.java index 93a82ed4f6c..f8b8a10d288 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/PetApi.java @@ -21,10 +21,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface PetApi { + /** + * Add a new pet to the store + * + * + * + */ @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -34,6 +46,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); + /** + * Deletes a pet + * + * + * + */ @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -42,6 +60,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @@ -60,6 +90,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + /** + * Find pet by ID + * + * Returns a single pet + * + */ @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -70,6 +106,12 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); + /** + * Update an existing pet + * + * + * + */ @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -81,6 +123,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(@Valid Pet body); + /** + * Updates a pet in the store with form data + * + * + * + */ @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -90,6 +138,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + /** + * uploads an image + * + * + * + */ @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java index 8ddeb8f3dea..72508ea286a 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ @DELETE @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -33,6 +45,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ @GET @Path("/store/inventory") @Produces({ "application/json" }) @@ -41,6 +59,12 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + /** + * Place an order for a pet + * + * + * + */ @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/UserApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/UserApi.java index 5588dddf74f..7aba6911b46 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/UserApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @@ -32,6 +44,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUser(@Valid User body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @@ -40,6 +58,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @@ -48,6 +72,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -57,6 +87,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + /** + * Get user by user name + * + * + * + */ @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -67,6 +103,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + /** + * Logs user into the system + * + * + * + */ @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @@ -76,6 +118,12 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + /** + * Logs out current logged in user session + * + * + * + */ @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @@ -84,6 +132,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java index 2e1f5c0c2a8..9a1956aae8c 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A category for a pet + **/ @ApiModel(description="A category for a pet") public class Category { diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java index c6dc9cbecf6..51ffbeff6da 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Describes the result of uploading an image resource + **/ @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java index f3083f27494..4b438955a29 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java @@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * An order for a pets from the pet store + **/ @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -59,6 +62,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "Order Status") + /** + * Order Status + **/ private StatusEnum status = null; @ApiModelProperty(value = "") private Boolean complete = false; diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java index 0776e03a908..826a0b31bca 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java @@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A pet for sale in the pet store + **/ @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -64,6 +67,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "pet status in the store") + /** + * pet status in the store + **/ private StatusEnum status = null; /** diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java index 1e80911874f..24fd1d55d2a 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A tag for a pet + **/ @ApiModel(description="A tag for a pet") public class Tag { diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java index a0f42ad1ce7..858e8e14268 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A User who is purchasing from the pet store + **/ @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -31,6 +34,9 @@ public class User { @ApiModelProperty(value = "") private String phone = null; @ApiModelProperty(value = "User Status") + /** + * User Status + **/ private Integer userStatus = null; /** 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 edaf8d0eeb7..0136d8f0a76 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -4,6 +4,7 @@ swagger-cxf-annotated-basepath war swagger-cxf-annotated-basepath + 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. 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java index f6551d8cc37..c576178bcc0 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/PetApi.java @@ -21,10 +21,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/v2") @Api(value = "/", description = "") public interface PetApi { + /** + * Add a new pet to the store + * + * + * + */ @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -34,6 +46,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); + /** + * Deletes a pet + * + * + * + */ @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -42,6 +60,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @@ -60,6 +90,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + /** + * Find pet by ID + * + * Returns a single pet + * + */ @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -70,6 +106,12 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); + /** + * Update an existing pet + * + * + * + */ @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -81,6 +123,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(@Valid Pet body); + /** + * Updates a pet in the store with form data + * + * + * + */ @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -90,6 +138,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + /** + * uploads an image + * + * + * + */ @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java index 0b00a353bc1..5e18529e1b5 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/StoreApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/v2") @Api(value = "/", description = "") public interface StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ @DELETE @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -33,6 +45,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ @GET @Path("/store/inventory") @Produces({ "application/json" }) @@ -41,6 +59,12 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + /** + * Place an order for a pet + * + * + * + */ @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java index 36a62cf2a0a..a5fd5adf01c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/api/UserApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/v2") @Api(value = "/", description = "") public interface UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @@ -32,6 +44,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUser(@Valid User body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @@ -40,6 +58,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @@ -48,6 +72,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -57,6 +87,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + /** + * Get user by user name + * + * + * + */ @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -67,6 +103,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + /** + * Logs user into the system + * + * + * + */ @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @@ -76,6 +118,12 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + /** + * Logs out current logged in user session + * + * + * + */ @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @@ -84,6 +132,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java index 2e1f5c0c2a8..9a1956aae8c 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Category.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A category for a pet + **/ @ApiModel(description="A category for a pet") public class Category { diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java index c6dc9cbecf6..51ffbeff6da 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Describes the result of uploading an image resource + **/ @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java index f3083f27494..4b438955a29 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Order.java @@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * An order for a pets from the pet store + **/ @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -59,6 +62,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "Order Status") + /** + * Order Status + **/ private StatusEnum status = null; @ApiModelProperty(value = "") private Boolean complete = false; diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java index 0776e03a908..826a0b31bca 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Pet.java @@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A pet for sale in the pet store + **/ @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -64,6 +67,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "pet status in the store") + /** + * pet status in the store + **/ private StatusEnum status = null; /** diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java index 1e80911874f..24fd1d55d2a 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/Tag.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A tag for a pet + **/ @ApiModel(description="A tag for a pet") public class Tag { diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java index a0f42ad1ce7..858e8e14268 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/io/swagger/model/User.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A User who is purchasing from the pet store + **/ @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -31,6 +34,9 @@ public class User { @ApiModelProperty(value = "") private String phone = null; @ApiModelProperty(value = "User Status") + /** + * User Status + **/ private Integer userStatus = null; /** diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index d9b9345d339..0f19eb3098d 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -18,49 +18,103 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class PetApiServiceImpl implements PetApi { + /** + * Add a new pet to the store + * + * + * + */ public void addPet(Pet body) { // TODO: Implement... } + /** + * Deletes a pet + * + * + * + */ public void deletePet(Long petId, String apiKey) { // TODO: Implement... } + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ public List findPetsByStatus(List status) { // TODO: Implement... return null; } + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ public List findPetsByTags(List tags) { // TODO: Implement... return null; } + /** + * Find pet by ID + * + * Returns a single pet + * + */ public Pet getPetById(Long petId) { // TODO: Implement... return null; } + /** + * Update an existing pet + * + * + * + */ public void updatePet(Pet body) { // TODO: Implement... } + /** + * Updates a pet in the store with form data + * + * + * + */ public void updatePetWithForm(Long petId, String name, String status) { // TODO: Implement... } + /** + * uploads an image + * + * + * + */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 3f791097b6b..9d3f93f8c3d 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -17,25 +17,55 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class StoreApiServiceImpl implements StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ public void deleteOrder(String orderId) { // TODO: Implement... } + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ public Map getInventory() { // TODO: Implement... return null; } + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ public Order getOrderById(Long orderId) { // TODO: Implement... return null; } + /** + * Place an order for a pet + * + * + * + */ public Order placeOrder(Order body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 861273cfb7b..c569dbf5c15 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -17,49 +17,103 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class UserApiServiceImpl implements UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ public void createUser(User body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithArrayInput(List body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithListInput(List body) { // TODO: Implement... } + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ public void deleteUser(String username) { // TODO: Implement... } + /** + * Get user by user name + * + * + * + */ public User getUserByName(String username) { // TODO: Implement... return null; } + /** + * Logs user into the system + * + * + * + */ public String loginUser(String username, String password) { // TODO: Implement... return null; } + /** + * Logs out current logged in user session + * + * + * + */ public void logoutUser() { // TODO: Implement... } + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ public void updateUser(String username, User body) { // TODO: Implement... 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 df55fcf5667..1c116b94ad1 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -4,6 +4,7 @@ swagger-cxf-server-non-spring war swagger-cxf-server-non-spring + 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. 1.0.0 src/main/java diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java index 93a82ed4f6c..f8b8a10d288 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/PetApi.java @@ -21,10 +21,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface PetApi { + /** + * Add a new pet to the store + * + * + * + */ @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -34,6 +46,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); + /** + * Deletes a pet + * + * + * + */ @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -42,6 +60,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @@ -60,6 +90,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + /** + * Find pet by ID + * + * Returns a single pet + * + */ @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -70,6 +106,12 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); + /** + * Update an existing pet + * + * + * + */ @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -81,6 +123,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(@Valid Pet body); + /** + * Updates a pet in the store with form data + * + * + * + */ @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -90,6 +138,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + /** + * uploads an image + * + * + * + */ @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java index 8ddeb8f3dea..72508ea286a 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/StoreApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ @DELETE @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -33,6 +45,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("orderId") String orderId); + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ @GET @Path("/store/inventory") @Produces({ "application/json" }) @@ -41,6 +59,12 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ @GET @Path("/store/order/{orderId}") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId); + /** + * Place an order for a pet + * + * + * + */ @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java index 5588dddf74f..7aba6911b46 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/api/UserApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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. + * + */ @Path("/") @Api(value = "/", description = "") public interface UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @@ -32,6 +44,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUser(@Valid User body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @@ -40,6 +58,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @@ -48,6 +72,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -57,6 +87,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + /** + * Get user by user name + * + * + * + */ @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -67,6 +103,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + /** + * Logs user into the system + * + * + * + */ @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @@ -76,6 +118,12 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + /** + * Logs out current logged in user session + * + * + * + */ @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @@ -84,6 +132,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java index 2e1f5c0c2a8..9a1956aae8c 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Category.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A category for a pet + **/ @ApiModel(description="A category for a pet") public class Category { diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java index c6dc9cbecf6..51ffbeff6da 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Describes the result of uploading an image resource + **/ @ApiModel(description="Describes the result of uploading an image resource") public class ModelApiResponse { diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java index f3083f27494..4b438955a29 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Order.java @@ -14,6 +14,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * An order for a pets from the pet store + **/ @ApiModel(description="An order for a pets from the pet store") public class Order { @@ -59,6 +62,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "Order Status") + /** + * Order Status + **/ private StatusEnum status = null; @ApiModelProperty(value = "") private Boolean complete = false; diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java index 0776e03a908..826a0b31bca 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Pet.java @@ -17,6 +17,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A pet for sale in the pet store + **/ @ApiModel(description="A pet for sale in the pet store") public class Pet { @@ -64,6 +67,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "pet status in the store") + /** + * pet status in the store + **/ private StatusEnum status = null; /** diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java index 1e80911874f..24fd1d55d2a 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/Tag.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A tag for a pet + **/ @ApiModel(description="A tag for a pet") public class Tag { diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java index a0f42ad1ce7..858e8e14268 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/io/swagger/model/User.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * A User who is purchasing from the pet store + **/ @ApiModel(description="A User who is purchasing from the pet store") public class User { @@ -31,6 +34,9 @@ public class User { @ApiModelProperty(value = "") private String phone = null; @ApiModelProperty(value = "User Status") + /** + * User Status + **/ private Integer userStatus = null; /** diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index d9b9345d339..0f19eb3098d 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -18,49 +18,103 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class PetApiServiceImpl implements PetApi { + /** + * Add a new pet to the store + * + * + * + */ public void addPet(Pet body) { // TODO: Implement... } + /** + * Deletes a pet + * + * + * + */ public void deletePet(Long petId, String apiKey) { // TODO: Implement... } + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ public List findPetsByStatus(List status) { // TODO: Implement... return null; } + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ public List findPetsByTags(List tags) { // TODO: Implement... return null; } + /** + * Find pet by ID + * + * Returns a single pet + * + */ public Pet getPetById(Long petId) { // TODO: Implement... return null; } + /** + * Update an existing pet + * + * + * + */ public void updatePet(Pet body) { // TODO: Implement... } + /** + * Updates a pet in the store with form data + * + * + * + */ public void updatePetWithForm(Long petId, String name, String status) { // TODO: Implement... } + /** + * uploads an image + * + * + * + */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 3f791097b6b..9d3f93f8c3d 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -17,25 +17,55 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class StoreApiServiceImpl implements StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ public void deleteOrder(String orderId) { // TODO: Implement... } + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ public Map getInventory() { // TODO: Implement... return null; } + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ public Order getOrderById(Long orderId) { // TODO: Implement... return null; } + /** + * Place an order for a pet + * + * + * + */ public Order placeOrder(Order body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 861273cfb7b..c569dbf5c15 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -17,49 +17,103 @@ import io.swagger.annotations.Api; +/** + * 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. + * + */ public class UserApiServiceImpl implements UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ public void createUser(User body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithArrayInput(List body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithListInput(List body) { // TODO: Implement... } + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ public void deleteUser(String username) { // TODO: Implement... } + /** + * Get user by user name + * + * + * + */ public User getUserByName(String username) { // TODO: Implement... return null; } + /** + * Logs user into the system + * + * + * + */ public String loginUser(String username, String password) { // TODO: Implement... return null; } + /** + * Logs out current logged in user session + * + * + * + */ public void logoutUser() { // TODO: Implement... } + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ public void updateUser(String username, User body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 3d7d56c8519..1ab75579100 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -4,6 +4,7 @@ swagger-cxf-server war swagger-cxf-server + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ 1.0.0 src/main/java @@ -32,7 +33,7 @@ 8079 stopit - 8080 + 80 60000 diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java index 3accd4f023e..c05c51bee51 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/AnotherFakeApi.java @@ -19,10 +19,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface AnotherFakeApi { + /** + * To test special tags + * + * To test special tags + * + */ @PATCH @Path("/another-fake/dummy") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java index 1e201b5f14d..190aceb4a5e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java @@ -23,6 +23,12 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface FakeApi { @@ -55,6 +61,12 @@ public interface FakeApi { @ApiResponse(code = 200, message = "Output string", response = String.class) }) public String fakeOuterStringSerialize(@Valid String body); + /** + * To test \"client\" model + * + * To test \"client\" model + * + */ @PATCH @Path("/fake") @Consumes({ "application/json" }) @@ -64,6 +76,12 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) public Client testClientModel(@Valid Client body); + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + */ @POST @Path("/fake") @Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" }) @@ -74,6 +92,12 @@ public interface FakeApi { @ApiResponse(code = 404, message = "User not found") }) public void testEndpointParameters(@Multipart(value = "number") BigDecimal number, @Multipart(value = "double") Double _double, @Multipart(value = "pattern_without_delimiter") String patternWithoutDelimiter, @Multipart(value = "byte") byte[] _byte, @Multipart(value = "integer", required = false) Integer integer, @Multipart(value = "int32", required = false) Integer int32, @Multipart(value = "int64", required = false) Long int64, @Multipart(value = "float", required = false) Float _float, @Multipart(value = "string", required = false) String string, @Multipart(value = "binary", required = false) byte[] binary, @Multipart(value = "date", required = false) LocalDate date, @Multipart(value = "dateTime", required = false) Date dateTime, @Multipart(value = "password", required = false) String password, @Multipart(value = "callback", required = false) String paramCallback); + /** + * To test enum parameters + * + * To test enum parameters + * + */ @GET @Path("/fake") @Consumes({ "*/*" }) @@ -84,6 +108,12 @@ public interface FakeApi { @ApiResponse(code = 404, message = "Not found") }) public void testEnumParameters(@Multipart(value = "enum_form_string_array", required = false) List enumFormStringArray, @Multipart(value = "enum_form_string", required = false) String enumFormString, @HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @Multipart(value = "enum_query_double", required = false) Double enumQueryDouble); + /** + * test json serialization of form data + * + * + * + */ @GET @Path("/fake/jsonFormData") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java index 021e7eeb91f..63de6839dc1 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeClassnameTags123Api.java @@ -19,10 +19,20 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface FakeClassnameTags123Api { + /** + * To test class name in snake case + * + */ @PATCH @Path("/fake_classname_test") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java index 93a82ed4f6c..20fab16db0c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java @@ -21,10 +21,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface PetApi { + /** + * Add a new pet to the store + * + * + * + */ @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -34,6 +46,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); + /** + * Deletes a pet + * + * + * + */ @DELETE @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -42,6 +60,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid status value") }) public List findPetsByStatus(@QueryParam("status") @NotNull List status); + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) @@ -60,6 +90,12 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid tag value") }) public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + /** + * Find pet by ID + * + * Returns a single pet + * + */ @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) @@ -70,6 +106,12 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found") }) public Pet getPetById(@PathParam("petId") Long petId); + /** + * Update an existing pet + * + * + * + */ @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) @@ -81,6 +123,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Validation exception") }) public void updatePet(@Valid Pet body); + /** + * Updates a pet in the store with form data + * + * + * + */ @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) @@ -90,6 +138,12 @@ public interface PetApi { @ApiResponse(code = 405, message = "Invalid input") }) public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status); + /** + * uploads an image + * + * + * + */ @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java index 2698ca445e6..065420cf357 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ @DELETE @Path("/store/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -33,6 +45,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public void deleteOrder(@PathParam("order_id") String orderId); + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ @GET @Path("/store/inventory") @Produces({ "application/json" }) @@ -41,6 +59,12 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) public Map getInventory(); + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ @GET @Path("/store/order/{order_id}") @Produces({ "application/xml", "application/json" }) @@ -51,6 +75,12 @@ public interface StoreApi { @ApiResponse(code = 404, message = "Order not found") }) public Order getOrderById(@PathParam("order_id") @Min(1) @Max(5) Long orderId); + /** + * Place an order for a pet + * + * + * + */ @POST @Path("/store/order") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java index 5588dddf74f..3e0d6350623 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java @@ -20,10 +20,22 @@ import javax.validation.constraints.*; import javax.validation.Valid; +/** + * 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: \" \\ + * + */ @Path("/") @Api(value = "/", description = "") public interface UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ @POST @Path("/user") @Produces({ "application/xml", "application/json" }) @@ -32,6 +44,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUser(@Valid User body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithArray") @Produces({ "application/xml", "application/json" }) @@ -40,6 +58,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithArrayInput(@Valid List body); + /** + * Creates list of users with given input array + * + * + * + */ @POST @Path("/user/createWithList") @Produces({ "application/xml", "application/json" }) @@ -48,6 +72,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void createUsersWithListInput(@Valid List body); + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ @DELETE @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -57,6 +87,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void deleteUser(@PathParam("username") String username); + /** + * Get user by user name + * + * + * + */ @GET @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) @@ -67,6 +103,12 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public User getUserByName(@PathParam("username") String username); + /** + * Logs user into the system + * + * + * + */ @GET @Path("/user/login") @Produces({ "application/xml", "application/json" }) @@ -76,6 +118,12 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username/password supplied") }) public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + /** + * Logs out current logged in user session + * + * + * + */ @GET @Path("/user/logout") @Produces({ "application/xml", "application/json" }) @@ -84,6 +132,12 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation") }) public void logoutUser(); + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ @PUT @Path("/user/{username}") @Produces({ "application/xml", "application/json" }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java index ce100b22300..89278c7c298 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Capitalization.java @@ -25,6 +25,9 @@ public class Capitalization { @ApiModelProperty(value = "") private String scAETHFlowPoints = null; @ApiModelProperty(value = "Name of the pet ") + /** + * Name of the pet + **/ private String ATT_NAME = null; /** diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java index 6cc8af52fc6..fcdc0f57054 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ClassModel.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Model for testing model with \"_class\" property + **/ @ApiModel(description="Model for testing model with \"_class\" property") public class ClassModel { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java index 8fe54f0a258..4a5621e30be 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Model200Response.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Model for testing model name starting with number + **/ @ApiModel(description="Model for testing model name starting with number") public class Model200Response { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java index df4149c5d4d..0c514b23b5c 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelReturn.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Model for testing reserved words + **/ @ApiModel(description="Model for testing reserved words") public class ModelReturn { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java index 47a8c83f2fb..8743ac35dbb 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Name.java @@ -13,6 +13,9 @@ import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Model for testing model name same as property name + **/ @ApiModel(description="Model for testing model name same as property name") public class Name { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java index faf95343915..985634c955d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Order.java @@ -57,6 +57,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "Order Status") + /** + * Order Status + **/ private StatusEnum status = null; @ApiModelProperty(value = "") private Boolean complete = false; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java index 5db1a052b8f..28db37fa0b9 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Pet.java @@ -62,6 +62,9 @@ public static StatusEnum fromValue(String v) { } @ApiModelProperty(value = "pet status in the store") + /** + * pet status in the store + **/ private StatusEnum status = null; /** diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java index 54f54896d13..44509b594be 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/User.java @@ -29,6 +29,9 @@ public class User { @ApiModelProperty(value = "") private String phone = null; @ApiModelProperty(value = "User Status") + /** + * User Status + **/ private Integer userStatus = null; /** diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java index 5de97453193..a162ec64ee7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/AnotherFakeApiServiceImpl.java @@ -16,7 +16,19 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { + /** + * To test special tags + * + * To test special tags + * + */ public Client testSpecialTags(Client body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java index b170bddee2d..5e47422edf4 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeApiServiceImpl.java @@ -20,6 +20,12 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class FakeApiServiceImpl implements FakeApi { public Boolean fakeOuterBooleanSerialize(Boolean body) { // TODO: Implement... @@ -45,24 +51,48 @@ public String fakeOuterStringSerialize(String body) { return null; } + /** + * To test \"client\" model + * + * To test \"client\" model + * + */ public Client testClientModel(Client body) { // TODO: Implement... return null; } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, Date dateTime, String password, String paramCallback) { // TODO: Implement... } + /** + * To test enum parameters + * + * To test enum parameters + * + */ public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) { // TODO: Implement... } + /** + * test json serialization of form data + * + * + * + */ public void testJsonFormData(String param, String param2) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java index 539edc610d9..ad3f555af97 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -16,7 +16,17 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123Api { + /** + * To test class name in snake case + * + */ public Client testClassname(Client body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index d9b9345d339..439daacb1b2 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -18,49 +18,103 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class PetApiServiceImpl implements PetApi { + /** + * Add a new pet to the store + * + * + * + */ public void addPet(Pet body) { // TODO: Implement... } + /** + * Deletes a pet + * + * + * + */ public void deletePet(Long petId, String apiKey) { // TODO: Implement... } + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ public List findPetsByStatus(List status) { // TODO: Implement... return null; } + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + */ public List findPetsByTags(List tags) { // TODO: Implement... return null; } + /** + * Find pet by ID + * + * Returns a single pet + * + */ public Pet getPetById(Long petId) { // TODO: Implement... return null; } + /** + * Update an existing pet + * + * + * + */ public void updatePet(Pet body) { // TODO: Implement... } + /** + * Updates a pet in the store with form data + * + * + * + */ public void updatePetWithForm(Long petId, String name, String status) { // TODO: Implement... } + /** + * uploads an image + * + * + * + */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 3f791097b6b..546d096399b 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -17,25 +17,55 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class StoreApiServiceImpl implements StoreApi { + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ public void deleteOrder(String orderId) { // TODO: Implement... } + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ public Map getInventory() { // TODO: Implement... return null; } + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + */ public Order getOrderById(Long orderId) { // TODO: Implement... return null; } + /** + * Place an order for a pet + * + * + * + */ public Order placeOrder(Order body) { // TODO: Implement... diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index 861273cfb7b..363a42dad0e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -17,49 +17,103 @@ import io.swagger.annotations.Api; +/** + * 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: \" \\ + * + */ public class UserApiServiceImpl implements UserApi { + /** + * Create user + * + * This can only be done by the logged in user. + * + */ public void createUser(User body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithArrayInput(List body) { // TODO: Implement... } + /** + * Creates list of users with given input array + * + * + * + */ public void createUsersWithListInput(List body) { // TODO: Implement... } + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ public void deleteUser(String username) { // TODO: Implement... } + /** + * Get user by user name + * + * + * + */ public User getUserByName(String username) { // TODO: Implement... return null; } + /** + * Logs user into the system + * + * + * + */ public String loginUser(String username, String password) { // TODO: Implement... return null; } + /** + * Logs out current logged in user session + * + * + * + */ public void logoutUser() { // TODO: Implement... } + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ public void updateUser(String username, User body) { // TODO: Implement... From c71aa9da496d2fcb056fa175d600fcea4f4d262a Mon Sep 17 00:00:00 2001 From: Benjamin Gill Date: Sun, 22 Oct 2017 17:39:33 +0100 Subject: [PATCH 190/197] Add Metaswitch to list of companies (#6773) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a727baf5872..d5181363311 100644 --- a/README.md +++ b/README.md @@ -793,6 +793,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [LXL Tech](http://lxltech.com) - [Lyft](https://www.lyft.com/developers) - [MailMojo](https://mailmojo.no/) +- [Metaswitch](https://www.metaswitch.com/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) From 18b16c7fe699da5561b5e7208e8c5ce1372fc3f8 Mon Sep 17 00:00:00 2001 From: kinok Date: Mon, 23 Oct 2017 11:46:12 +0200 Subject: [PATCH 191/197] Update README.md (#6783) Add my company to `Companies/Projects using Swagger Codegen` --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d5181363311..cbef495af55 100644 --- a/README.md +++ b/README.md @@ -730,6 +730,7 @@ Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/ Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. +- [Accengage](https://www.accengage.com/) - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) From c6b6249f1c792be804b2fb991cd0e104ce169536 Mon Sep 17 00:00:00 2001 From: Edward Wells Date: Mon, 23 Oct 2017 06:44:37 -0400 Subject: [PATCH 192/197] Fixed Python client docstrings (#6780) * Updated api_client and configuration docstrings ApiClient: Removed host param, added configuration and cookie param Configuration: Docstrings are only read from the @property decorated function, not the setter, moved the more descriptive docstrings from the setters to property functions * Ran bin/python-petstore.sh --- .../main/resources/python/api_client.mustache | 14 ++- .../resources/python/configuration.mustache | 44 +++++---- samples/client/petstore/python/README.md | 1 + .../client/petstore/python/docs/FakeApi.md | 48 ++++++++++ .../python/petstore_api/api_client.py | 14 ++- .../python/petstore_api/apis/fake_api.py | 94 +++++++++++++++++++ .../python/petstore_api/configuration.py | 44 +++++---- 7 files changed, 203 insertions(+), 56 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 5372dea0592..576ff74c146 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -36,9 +36,12 @@ class ApiClient(object): Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. - :param host: The base path for the server to call. + :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API """ PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types @@ -73,16 +76,11 @@ class ApiClient(object): @property def user_agent(self): - """ - Gets user agent. - """ + """User agent for this API client""" return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - """ - Sets user agent. - """ self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index 744b277455a..076f7401b57 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -100,15 +100,19 @@ class Configuration(with_metaclass(TypeWithDefault, object)): @property def logger_file(self): - """ - Gets the logger_file. + """The logger file. + + If the logger_file is None, then add stream handler and remove file handler. + Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str """ return self.__logger_file @logger_file.setter def logger_file(self, value): - """ - Sets the logger_file. + """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. @@ -138,15 +142,16 @@ class Configuration(with_metaclass(TypeWithDefault, object)): @property def debug(self): - """ - Gets the debug status. + """Debug status + + :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter def debug(self, value): - """ - Sets the debug status. + """Debug status :param value: The debug status, True or False. :type: bool @@ -168,15 +173,18 @@ class Configuration(with_metaclass(TypeWithDefault, object)): @property def logger_format(self): - """ - Gets the logger_format. + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str """ return self.__logger_format @logger_format.setter def logger_format(self, value): - """ - Sets the logger_format. + """The logger format. The logger_formatter will be updated when sets logger_format. @@ -187,8 +195,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): self.logger_formatter = logging.Formatter(self.__logger_format) def get_api_key_with_prefix(self, identifier): - """ - Gets API key (with prefix if set). + """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. :return: The token for api key authentication. @@ -199,8 +206,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): return self.api_key[identifier] def get_basic_auth_token(self): - """ - Gets HTTP basic authentication header (string). + """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. """ @@ -208,8 +214,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): .get('authorization') def auth_settings(self): - """ - Gets Auth Settings dict for api client. + """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ @@ -244,8 +249,7 @@ class Configuration(with_metaclass(TypeWithDefault, object)): } def to_debug_report(self): - """ - Gets the essential information for debugging. + """Gets the essential information for debugging. :return: The report for debugging. """ diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 87f80990fc5..a49d99c556c 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -77,6 +77,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index eb669540e53..eb651a109a7 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data @@ -389,6 +390,53 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_inline_additional_properties** +> test_inline_additional_properties(param) + +test inline additionalProperties + + + +### Example +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +param = NULL # object | request body + +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) +except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **object**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_json_form_data** > test_json_form_data(param, param2) diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index ff29a063d8c..00347369b7c 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -42,9 +42,12 @@ class ApiClient(object): Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. - :param host: The base path for the server to call. + :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API """ PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types @@ -79,16 +82,11 @@ def __del__(self): @property def user_agent(self): - """ - Gets user agent. - """ + """User agent for this API client""" return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - """ - Sets user agent. - """ self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): diff --git a/samples/client/petstore/python/petstore_api/apis/fake_api.py b/samples/client/petstore/python/petstore_api/apis/fake_api.py index 46fb22f7290..cadbc20004c 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python/petstore_api/apis/fake_api.py @@ -784,6 +784,100 @@ def test_enum_parameters_with_http_info(self, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def test_inline_additional_properties(self, param, **kwargs): + """ + test inline additionalProperties + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.test_inline_additional_properties_with_http_info(param, **kwargs) + else: + (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) + return data + + def test_inline_additional_properties_with_http_info(self, param, **kwargs): + """ + test inline additionalProperties + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.test_inline_additional_properties_with_http_info(param, async=True) + >>> result = thread.get() + + :param async bool + :param object param: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['param'] + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_additional_properties" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'param' is set + if ('param' not in params) or (params['param'] is None): + raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") + + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'param' in params: + body_params = params['param'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def test_json_form_data(self, param, param2, **kwargs): """ test json serialization of form data diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 29bf22034aa..8410a94f57b 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -109,15 +109,19 @@ def __init__(self): @property def logger_file(self): - """ - Gets the logger_file. + """The logger file. + + If the logger_file is None, then add stream handler and remove file handler. + Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str """ return self.__logger_file @logger_file.setter def logger_file(self, value): - """ - Sets the logger_file. + """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. @@ -147,15 +151,16 @@ def logger_file(self, value): @property def debug(self): - """ - Gets the debug status. + """Debug status + + :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter def debug(self, value): - """ - Sets the debug status. + """Debug status :param value: The debug status, True or False. :type: bool @@ -177,15 +182,18 @@ def debug(self, value): @property def logger_format(self): - """ - Gets the logger_format. + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str """ return self.__logger_format @logger_format.setter def logger_format(self, value): - """ - Sets the logger_format. + """The logger format. The logger_formatter will be updated when sets logger_format. @@ -196,8 +204,7 @@ def logger_format(self, value): self.logger_formatter = logging.Formatter(self.__logger_format) def get_api_key_with_prefix(self, identifier): - """ - Gets API key (with prefix if set). + """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. :return: The token for api key authentication. @@ -208,8 +215,7 @@ def get_api_key_with_prefix(self, identifier): return self.api_key[identifier] def get_basic_auth_token(self): - """ - Gets HTTP basic authentication header (string). + """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. """ @@ -217,8 +223,7 @@ def get_basic_auth_token(self): .get('authorization') def auth_settings(self): - """ - Gets Auth Settings dict for api client. + """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ @@ -256,8 +261,7 @@ def auth_settings(self): } def to_debug_report(self): - """ - Gets the essential information for debugging. + """Gets the essential information for debugging. :return: The report for debugging. """ From a63e3f14f58cdce57be0f1091905d8653eb26626 Mon Sep 17 00:00:00 2001 From: Steve Harrigan Date: Mon, 23 Oct 2017 09:40:50 -0400 Subject: [PATCH 193/197] [TypeScript-Angular] Path URI Encoding Update (#6769) * Replaced the method for updating path to prep for URL encoding. The new method will switch TypeScript-Angular variables from snake_case to camelCase in the URL generation. Imported StringBuffer, Matcher, and Pattern, since the new solution needs them. Some extra whitespace on blank lines was removed. * Since these were not up to date with the current master, I ran them and am commiting them here. This way, the changes are shown here instead of after future commits. * Simplified the code for the path conversion A LOT. New version is much simpler to follow, and very efficient - only one iteration through the length of the string. Removed regex Matcher and Pattern classes, since they weren't needed anymore. --- .../TypeScriptAngularClientCodegen.java | 57 +++++++++++++++++-- .../npm/model/apiResponse.ts | 2 + .../npm/model/category.ts | 2 + .../npm/model/order.ts | 8 +-- .../typescript-angular-v4.3/npm/model/pet.ts | 8 +-- .../typescript-angular-v4.3/npm/model/tag.ts | 2 + .../typescript-angular-v4.3/npm/model/user.ts | 2 + 7 files changed, 66 insertions(+), 15 deletions(-) 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 cab99599846..fefbf143b0c 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 @@ -1,6 +1,7 @@ package io.swagger.codegen.languages; import java.io.File; +import java.lang.StringBuffer; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -82,7 +83,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("apis.mustache", apiPackage().replace('.', File.separatorChar), "api.ts")); supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts")); supportingFiles.add(new SupportingFile("api.module.mustache", getIndexDirectory(), "api.module.ts")); - supportingFiles.add(new SupportingFile("rxjs-operators.mustache", getIndexDirectory(), "rxjs-operators.ts")); + supportingFiles.add(new SupportingFile("rxjs-operators.mustache", getIndexDirectory(), "rxjs-operators.ts")); supportingFiles.add(new SupportingFile("configuration.mustache", getIndexDirectory(), "configuration.ts")); supportingFiles.add(new SupportingFile("variables.mustache", getIndexDirectory(), "variables.ts")); supportingFiles.add(new SupportingFile("encoder.mustache", getIndexDirectory(), "encoder.ts")); @@ -149,7 +150,7 @@ private String getIndexDirectory() { public boolean isDataTypeFile(final String dataType) { return dataType != null && dataType.equals("Blob"); } - + @Override public String getTypeDeclaration(Property p) { Property inner; @@ -247,8 +248,54 @@ public Map postProcessOperations(Map operations) } } - // Convert path to TypeScript template string, applying URI encoding - op.path = op.path.replaceAll("\\{(.*?)\\}", "\\$\\{encodeURIComponent(String($1))\\}"); + // Prep a string buffer where we're going to set up our new version of the string. + StringBuffer pathBuffer = new StringBuffer(); + + // Set up other variables for tracking the current state of the string. + int insideCurly = 0; + boolean foundUnderscore = false; + + // Iterate through existing string, one character at a time. + for(int i = 0; i < op.path.length(); i++) { + switch(op.path.charAt(i)) { + case '{': + // We entered curly braces, so track that. + insideCurly++; + + // Add the more complicated component instead of just the brace. + pathBuffer.append("${encodeURIComponent(String("); + break; + case '}': + // We exited curly braces, so track that. + insideCurly--; + + // Add the more complicated component instead of just the brace. + pathBuffer.append("))}"); + break; + case '_': + // If we're inside the curly brace, the following character will need to be uppercase. + // Otherwise, just add the character. + if (insideCurly > 0) { + foundUnderscore = true; + } else { + pathBuffer.append(op.path.charAt(i)); + } + break; + default: + // If we previously found an underscore, we need an uppercase letter. + // Otherwise, just add the character. + if (foundUnderscore) { + pathBuffer.append(Character.toUpperCase(op.path.charAt(i))); + foundUnderscore = false; + } else { + pathBuffer.append(op.path.charAt(i)); + } + break; + } + } + + // Overwrite path to TypeScript template string, after applying everything we just did. + op.path = pathBuffer.toString(); } // Add additional filename information for model imports in the services @@ -272,7 +319,7 @@ public Map postProcessModels(Map objs) { CodegenModel cm = (CodegenModel) mo.get("model"); mo.put("tsImports", toTsImports(cm,cm.imports)); } - + return result; } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts index 3af781cf580..e79fabe8c8c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts @@ -23,3 +23,5 @@ export interface ApiResponse { message?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts index d09f8d7b265..56608731f95 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts @@ -21,3 +21,5 @@ export interface Category { name?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts index 402a86689c8..84b59f1b09a 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts @@ -33,9 +33,7 @@ export interface Order { } export namespace Order { - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } + export type StatusEnum = 'placed' | 'approved' | 'delivered'; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts index 0d6137d02cf..c0fc942934c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts @@ -35,9 +35,7 @@ export interface Pet { } export namespace Pet { - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } + export type StatusEnum = 'available' | 'pending' | 'sold'; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts index 3ed1eeff8f3..dbfa473f538 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts @@ -21,3 +21,5 @@ export interface Tag { name?: string; } + + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts index f4914ae2608..4dfad607c51 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts @@ -36,3 +36,5 @@ export interface User { userStatus?: number; } + + From b034e4446abc458357b3e59551174351a53d18a1 Mon Sep 17 00:00:00 2001 From: naelrashdeen Date: Mon, 23 Oct 2017 16:50:56 +0200 Subject: [PATCH 194/197] [PHP][Symfony] Enhancements (#6615) * Removed commented code * Input validation is now supported as strict JSON validation * [PHP][Symfony] Improve the implementation Closes #6614 * Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer * Updated shell script because shippable tests were failing --- .gitignore | 5 + bin/php-symfony-petstore.sh | 41 + .../languages/SymfonyServerCodegen.java | 82 +- .../resources/php-symfony/Controller.mustache | 346 +++----- .../php-symfony/ModelInterface.mustache | 55 -- .../php-symfony/ModelSerializer.mustache | 174 ---- .../resources/php-symfony/README.mustache | 26 +- .../main/resources/php-symfony/api.mustache | 16 +- .../php-symfony/api_controller.mustache | 166 ++-- .../php-symfony/api_input_validation.mustache | 88 ++ .../resources/php-symfony/api_test.mustache | 77 -- .../resources/php-symfony/composer.mustache | 6 +- .../main/resources/php-symfony/model.mustache | 9 +- .../php-symfony/model_generic.mustache | 327 +------ .../php-symfony/model_variables.mustache | 91 ++ .../resources/php-symfony/routing.mustache | 24 +- .../serialization/JmsSerializer.mustache | 91 ++ .../SerializerInterface.mustache | 27 + .../StrictJsonDeserializationVisitor.mustache | 72 ++ .../TypeMismatchException.mustache | 52 ++ .../resources/php-symfony/services.mustache | 24 + .../php-symfony/testing/AppKernel.php | 21 + .../php-symfony/testing/api_test.mustache | 116 +++ .../{ => testing}/model_test.mustache | 3 +- .../{ => testing}/phpunit.xml.mustache | 4 + .../resources/php-symfony/testing/pom.xml | 57 ++ .../php-symfony/testing/test_config.yml | 8 + .../validation/SymfonyValidator.mustache | 20 + .../validation/ValidatorInterface.mustache | 25 + .../php-symfony/.swagger-codegen-ignore | 23 + .../php-symfony/.swagger-codegen/VERSION | 1 + .../php-symfony/SymfonyBundle-php/.php_cs | 18 + .../php-symfony/SymfonyBundle-php/.travis.yml | 10 + .../SymfonyBundle-php/Api/ApiServer.php | 80 ++ .../SymfonyBundle-php/Api/PetApiInterface.php | 172 ++++ .../Api/StoreApiInterface.php | 106 +++ .../Api/UserApiInterface.php | 145 ++++ .../Controller/Controller.php | 182 ++++ .../Controller/PetController.php | 799 ++++++++++++++++++ .../Controller/StoreController.php | 368 ++++++++ .../Controller/UserController.php | 720 ++++++++++++++++ .../Compiler/SwaggerServerApiPass.php | 70 ++ .../SwaggerServerExtension.php | 57 ++ .../SymfonyBundle-php/Model/ApiResponse.php | 154 ++++ .../SymfonyBundle-php/Model/Category.php | 121 +++ .../SymfonyBundle-php/Model/Order.php | 256 ++++++ .../SymfonyBundle-php/Model/Pet.php | 262 ++++++ .../SymfonyBundle-php/Model/Tag.php | 121 +++ .../SymfonyBundle-php/Model/User.php | 321 +++++++ .../php-symfony/SymfonyBundle-php/README.md | 182 ++++ .../Resources/config/routing.yml | 145 ++++ .../Resources/config/services.yml | 42 + .../Resources/docs/Api/PetApiInterface.md | 529 ++++++++++++ .../Resources/docs/Api/StoreApiInterface.md | 245 ++++++ .../Resources/docs/Api/UserApiInterface.md | 459 ++++++++++ .../Resources/docs/Model/ApiResponse.md | 12 + .../Resources/docs/Model/Category.md | 11 + .../Resources/docs/Model/Order.md | 15 + .../Resources/docs/Model/Pet.md | 15 + .../Resources/docs/Model/Tag.md | 11 + .../Resources/docs/Model/User.md | 17 + .../Service/JmsSerializer.php | 91 ++ .../Service/SerializerInterface.php | 27 + .../StrictJsonDeserializationVisitor.php | 72 ++ .../Service/SymfonyValidator.php | 20 + .../Service/TypeMismatchException.php | 52 ++ .../Service/ValidatorInterface.php | 25 + .../SymfonyBundle-php/SwaggerServerBundle.php | 50 ++ .../Tests/Api/PetApiInterfaceTest.php | 217 +++++ .../Tests/Api/StoreApiInterfaceTest.php | 151 ++++ .../Tests/Api/UserApiInterfaceTest.php | 214 +++++ .../SymfonyBundle-php/Tests/AppKernel.php | 21 + .../Tests/Model/ApiResponseTest.php | 101 +++ .../Tests/Model/CategoryTest.php | 94 +++ .../Tests/Model/OrderTest.php | 122 +++ .../SymfonyBundle-php/Tests/Model/PetTest.php | 122 +++ .../SymfonyBundle-php/Tests/Model/TagTest.php | 94 +++ .../Tests/Model/UserTest.php | 136 +++ .../SymfonyBundle-php/Tests/test_config.yml | 8 + .../SymfonyBundle-php/autoload.php | 54 ++ .../SymfonyBundle-php/composer.json | 38 + .../php-symfony/SymfonyBundle-php/git_push.sh | 52 ++ .../SymfonyBundle-php/phpunit.xml.dist | 25 + .../php-symfony/SymfonyBundle-php/pom.xml | 57 ++ 84 files changed, 8592 insertions(+), 973 deletions(-) create mode 100755 bin/php-symfony-petstore.sh delete mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/ModelInterface.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/ModelSerializer.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/api_input_validation.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/api_test.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/model_variables.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/serialization/JmsSerializer.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/serialization/SerializerInterface.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/serialization/StrictJsonDeserializationVisitor.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/serialization/TypeMismatchException.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/testing/AppKernel.php create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/testing/api_test.mustache rename modules/swagger-codegen/src/main/resources/php-symfony/{ => testing}/model_test.mustache (95%) rename modules/swagger-codegen/src/main/resources/php-symfony/{ => testing}/phpunit.xml.mustache (90%) create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/testing/pom.xml create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/testing/test_config.yml create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/validation/SymfonyValidator.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php-symfony/validation/ValidatorInterface.mustache create mode 100644 samples/server/petstore/php-symfony/.swagger-codegen-ignore create mode 100644 samples/server/petstore/php-symfony/.swagger-codegen/VERSION create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/.php_cs create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/SwaggerServerApiPass.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/SwaggerServerExtension.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/README.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/config/routing.yml create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/config/services.yml create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/ApiResponse.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Category.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Order.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Pet.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Tag.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/User.md create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/StrictJsonDeserializationVisitor.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/SymfonyValidator.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/SwaggerServerBundle.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/CategoryTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/OrderTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/PetTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/TagTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/UserTest.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/test_config.yml create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/autoload.php create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/pom.xml diff --git a/.gitignore b/.gitignore index cce9df3dcfd..c31b8389c19 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,11 @@ samples/client/petstore/silex/SwaggerServer/venodr/ **/vendor/ **/composer.lock +#PHP-Symfony +samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/cache/ +samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/logs/ + + # Perl samples/client/petstore/perl/deep_module_test/ diff --git a/bin/php-symfony-petstore.sh b/bin/php-symfony-petstore.sh new file mode 100755 index 00000000000..17d9418b386 --- /dev/null +++ b/bin/php-symfony-petstore.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +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 + +# Make sure that the working directory is the root dir +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "${SCRIPT_DIR}/../" + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +# Make sure that we are regenerating the sample by removing any existing target directory +TARGET_DIR="$SCRIPT_DIR/../samples/server/petstore/php-symfony" +if [ -d "$TARGET_DIR" ]; then + rm -rf $TARGET_DIR +fi + +executable="$SCRIPT_DIR/../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 $SCRIPT_DIR/../modules/swagger-codegen/src/main/resources/php-symfony -i $SCRIPT_DIR/../modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l php-symfony -o $TARGET_DIR $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java index 87ce66f16a7..ae9cbd81fdf 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SymfonyServerCodegen.java @@ -32,7 +32,9 @@ public class SymfonyServerCodegen extends AbstractPhpCodegen implements CodegenC protected String bundleExtensionName; protected String bundleAlias; protected String controllerDirName = "Controller"; + protected String serviceDirName = "Service"; protected String controllerPackage; + protected String servicePackage; protected Boolean phpLegacySupport = Boolean.TRUE; protected HashSet typeHintable; @@ -74,7 +76,9 @@ public SymfonyServerCodegen() { modelDocPath = docsBasePath + File.separator + modelDirName; outputFolder = "generated-code" + File.separator + "php"; apiTemplateFiles.put("api_controller.mustache", ".php"); - modelTestTemplateFiles.put("model_test.mustache", ".php"); + modelTestTemplateFiles.put("testing/model_test.mustache", ".php"); + apiTestTemplateFiles = new HashMap(); + apiTestTemplateFiles.put("testing/api_test.mustache", ".php"); embeddedTemplateDir = templateDir = "php-symfony"; setReservedWordsLowerCase( @@ -105,13 +109,10 @@ public SymfonyServerCodegen() { ) ); - //instantiationTypes.put("array", "array"); - //instantiationTypes.put("map", "map"); - defaultIncludes = new HashSet( Arrays.asList( "\\DateTime", - "\\SplFileObject" + "UploadedFile" ) ); @@ -135,7 +136,7 @@ public SymfonyServerCodegen() { typeMapping.put("boolean", "bool"); typeMapping.put("Date", "\\DateTime"); typeMapping.put("DateTime", "\\DateTime"); - typeMapping.put("file", "\\SplFileObject"); + typeMapping.put("file", "UploadedFile"); typeMapping.put("map", "array"); typeMapping.put("array", "array"); typeMapping.put("list", "array"); @@ -242,6 +243,7 @@ public void processOpts() { additionalProperties.put("escapedInvokerPackage", invokerPackage.replace("\\", "\\\\")); additionalProperties.put("controllerPackage", controllerPackage); + additionalProperties.put("servicePackage", servicePackage); additionalProperties.put("apiTestsPackage", apiTestsPackage); additionalProperties.put("modelTestsPackage", modelTestsPackage); @@ -275,14 +277,28 @@ public void processOpts() { supportingFiles.add(new SupportingFile("Extension.mustache", dependencyInjectionDir, bundleExtensionName + ".php")); supportingFiles.add(new SupportingFile("ApiPass.mustache", dependencyInjectionDir + File.separator + "Compiler", bundleName + "ApiPass.php")); supportingFiles.add(new SupportingFile("ApiServer.mustache", toPackagePath(apiPackage, srcBasePath), "ApiServer.php")); - supportingFiles.add(new SupportingFile("ModelSerializer.mustache", toPackagePath(modelPackage, srcBasePath), "ModelSerializer.php")); - supportingFiles.add(new SupportingFile("ModelInterface.mustache", toPackagePath(modelPackage, srcBasePath), "ModelInterface.php")); + + // Serialization components + supportingFiles.add(new SupportingFile("serialization/SerializerInterface.mustache", toPackagePath(servicePackage, srcBasePath), "SerializerInterface.php")); + supportingFiles.add(new SupportingFile("serialization/JmsSerializer.mustache", toPackagePath(servicePackage, srcBasePath), "JmsSerializer.php")); + supportingFiles.add(new SupportingFile("serialization/StrictJsonDeserializationVisitor.mustache", toPackagePath(servicePackage, srcBasePath), "StrictJsonDeserializationVisitor.php")); + supportingFiles.add(new SupportingFile("serialization/TypeMismatchException.mustache", toPackagePath(servicePackage, srcBasePath), "TypeMismatchException.php")); + // Validation components + supportingFiles.add(new SupportingFile("validation/ValidatorInterface.mustache", toPackagePath(servicePackage, srcBasePath), "ValidatorInterface.php")); + supportingFiles.add(new SupportingFile("validation/SymfonyValidator.mustache", toPackagePath(servicePackage, srcBasePath), "SymfonyValidator.php")); + + // Testing components + supportingFiles.add(new SupportingFile("testing/phpunit.xml.mustache", getPackagePath(), "phpunit.xml.dist")); + supportingFiles.add(new SupportingFile("testing/pom.xml", getPackagePath(), "pom.xml")); + supportingFiles.add(new SupportingFile("testing/AppKernel.php", toPackagePath(testsPackage, srcBasePath), "AppKernel.php")); + supportingFiles.add(new SupportingFile("testing/test_config.yml", toPackagePath(testsPackage, srcBasePath), "test_config.yml")); + supportingFiles.add(new SupportingFile("routing.mustache", configDir, "routing.yml")); supportingFiles.add(new SupportingFile("services.mustache", configDir, "services.yml")); supportingFiles.add(new SupportingFile("composer.mustache", getPackagePath(), "composer.json")); supportingFiles.add(new SupportingFile("autoload.mustache", getPackagePath(), "autoload.php")); supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md")); - supportingFiles.add(new SupportingFile("phpunit.xml.mustache", getPackagePath(), "phpunit.xml.dist")); + supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml")); supportingFiles.add(new SupportingFile(".php_cs", getPackagePath(), ".php_cs")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", getPackagePath(), "git_push.sh")); @@ -329,6 +345,14 @@ public Map postProcessOperations(Map objs) { if (!typeHint.isEmpty()) { param.vendorExtensions.put("x-parameterType", typeHint); } + + // Quote default values for strings + // @todo: The default values for headers, forms and query params are handled + // in DefaultCodegen fromParameter with no real possibility to override + // the functionality. Thus we are handling quoting of string values here + if (param.dataType.equals("string") && param.defaultValue != null && !param.defaultValue.isEmpty()) { + param.defaultValue = "'"+param.defaultValue+"'"; + } } for (CodegenResponse response : op.responses) { @@ -340,9 +364,6 @@ public Map postProcessOperations(Map objs) { if (response.dataType != null) { final String dataType = extractSimpleName(response.dataType); response.vendorExtensions.put("x-simpleName", dataType); - // if (!typeMapping.containsValue(dataType)) { - // imports.add(response.dataType.replaceFirst("\\[\\]$", "")); - // } } } @@ -364,19 +385,15 @@ public Map postProcessModels(Map objs) { ArrayList modelsArray = (ArrayList) objs.get("models"); Map models = (Map) modelsArray.get(0); CodegenModel model = (CodegenModel) models.get("model"); - HashSet imports = new HashSet<>(); // Simplify model var type for (CodegenProperty var : model.vars) { if (var.datatype != null) { - final String importType = var.datatype.replaceFirst("\\[\\]$", ""); - final String dataType = extractSimpleName(var.datatype); - final boolean isScalarType = typeMapping.containsValue(importType); - var.vendorExtensions.put("x-fullType", var.datatype); - if (!isScalarType) { - var.vendorExtensions.put("x-typeAnnotation", dataType.endsWith("[]") ? "array" : dataType); - imports.add(importType); - var.datatype = dataType; + // Determine if the paramter type is supported as a type hint and make it available + // to the templating engine + String typeHint = getTypeHint(var.datatype); + if (!typeHint.isEmpty()) { + var.vendorExtensions.put("x-parameterType", typeHint); } if (var.isBoolean) { @@ -385,8 +402,6 @@ public Map postProcessModels(Map objs) { } } - objs.put("useStatements", new ArrayList<>(imports)); - return objs; } @@ -425,6 +440,7 @@ public void setInvokerPackage(String invokerPackage) { apiTestsPackage = testsPackage + "\\" + apiDirName; modelTestsPackage = testsPackage + "\\" + modelDirName; controllerPackage = invokerPackage + "\\" + controllerDirName; + servicePackage = invokerPackage + "\\" + serviceDirName; } @Override @@ -485,6 +501,26 @@ public String toModelImport(String name) { } } + @Override + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + return value; + } else { + return "\"" + escapeText(value) + "\""; + } + } + + /** + * Return the regular expression/JSON schema pattern (http://json-schema.org/latest/json-schema-validation.html#anchor33) + * + * @param pattern the pattern (regular expression) + * @return properly-escaped pattern + */ + @Override + public String toRegularExpression(String pattern) { + return escapeText(pattern); + } + public String toApiName(String name) { if (name.isEmpty()) { return "DefaultApiInterface"; diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache index af937c7d99f..c1adc2f64a4 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache @@ -19,9 +19,10 @@ namespace {{controllerPackage}}; -use Symfony\Bundle\FrameworkBundle\Controller\Controller as BaseController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; +use {{servicePackage}}\SerializerInterface; +use {{servicePackage}}\ValidatorInterface; /** * Controller Class Doc Comment @@ -31,212 +32,141 @@ use Symfony\Component\HttpKernel\Exception\HttpException; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class Controller extends BaseController +class Controller { - - /** - * This will return a response with code 400. Usage example: - * return $this->createBadRequestResponse('Unable to access this page!'); - * - * @param string $message A message - * - * @return Response - */ - public function createBadRequestResponse($message = 'Bad Request.') - { - return new Response($message, 400); - } - - /** - * This will return an error response. Usage example: - * return $this->createErrorResponse(new UnauthorizedHttpException()); - * - * @param HttpException $exception An HTTP exception - * - * @return Response - */ - public function createErrorResponse(HttpException $exception) - { - $statusCode = $exception->getStatusCode(); - $headers = array_merge($exception->getHeaders(), ['Content-Type' => 'application/json']); - - $json = $this->exceptionToArray($exception); - $json['statusCode'] = $statusCode; - - return new Response(json_encode($json, 15, 512), $statusCode, $headers); - } - - /** - * Serializes data to a given type format. - * - * @param mixed $data The data to serialize. - * @param string $class The source data class. - * @param string $format The target serialization format. - * - * @return string A serialized data string. - */ - public function serialize($data, $format) - { - return $this->get('{{bundleAlias}}.model.model_serializer')->serialize($data, $format); - } - - /** - * Deserializes data from a given type format. - * - * @param string $data The data to deserialize. - * @param string $class The target data class. - * @param string $format The source serialization format. - * - * @return mixed A deserialized data. - */ - public function deserialize($data, $class, $format) - { - return $this->get('{{bundleAlias}}.model.model_serializer')->deserialize($data, $class, $format); - } - - /** - * Decodes a string value. - * - * @param string $string The string value to decode. - * @param string $dataType The data type of the parameter. - * - * @return mixed The decoded value. - */ - public function fromString($string, $dataType) - { - if ($dataType === 'integer' || $dataType === 'number') { - return $this->toNumber($string); - } - if ($dataType === 'bool') { - return $this->toBoolean($string); - } - if ($dataType === '\DateTime') { - return $this->toDateTime($string); - } - - return $string; - } - - /** - * Decodes a header value. - * - * @param string $header The header value to decode. - * @param string $dataType The data type of the parameter. - * - * @return mixed The decoded value. - */ - public function fromHeader($header, $dataType) - { - return $this->fromString($header, $dataType); - } - - /** - * Decodes a query value. - * - * @param string $query The query value to decode. - * @param string $dataType The data type of the parameter. - * - * @return mixed The decoded value. - */ - public function fromQuery($query, $dataType) - { - return $this->fromString($query, $dataType); - } - - /** - * Decodes a path value. - * - * @param string $path The path value to decode. - * @param string $dataType The data type of the parameter. - * - * @return mixed The decoded value. - */ - public function fromPath($path, $dataType) - { - return $this->fromString($path, $dataType); - } - - /** - * Decodes a form value. - * - * @param string $form The form value to decode. - * @param string $dataType The data type of the parameter. - * - * @return mixed The decoded value. - */ - public function fromForm($form, $dataType) - { - return $this->fromString($form, $dataType); - } - - /** - * Decoded a string to a number. - * - * @param string $string The string to decode. - * - * @return number|null A decoded number, or null, if not a valid string. - */ - private function toNumber($string) - { - if (is_numeric($string)) { - return $string + 0; - } - - return null; - } - - /** - * Decoded a string to a boolean. - * - * @param string $string The string to decode. - * - * @return boolean|null A decoded boolean, or null, if not a valid string. - */ - private function toBoolean($string) - { - if ($string === 'true') { - return true; - } - if ($string === 'false') { - return false; - } - - return null; - } - - /** - * Decoded a string to a date time. - * - * @param string $string The string to decode. - * - * @return \DateTime|null A decoded date time, or null, if not a valid string. - */ - private function toDateTime($string) - { - if ($dateTime = date_create($string)) { - return $dateTime; - } - - return null; - } - - /** - * Converts an exception to a serializable array. - * - * @param \Exception|null $exception - * - * @return array - */ - private function exceptionToArray(\Exception $exception = null) - { - if (null === $exception) { - return null; - } - - return [ - 'message' => $exception->getMessage(), - 'type' => get_class($exception), - 'previous' => $this->exceptionToArray($exception->getPrevious()), - ]; - } + protected $validator; + protected $serializer; + protected $apiServer; + + public function setValidator(ValidatorInterface $validator) + { + $this->validator = $validator; + } + + public function setSerializer(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function setApiServer($server) + { + $this->apiServer = $server; + } + + /** + * This will return a response with code 400. Usage example: + * return $this->createBadRequestResponse('Unable to access this page!'); + * + * @param string $message A message + * + * @return Response + */ + public function createBadRequestResponse($message = 'Bad Request.') + { + return new Response($message, 400); + } + + /** + * This will return an error response. Usage example: + * return $this->createErrorResponse(new UnauthorizedHttpException()); + * + * @param HttpException $exception An HTTP exception + * + * @return Response + */ + public function createErrorResponse(HttpException $exception) + { + $statusCode = $exception->getStatusCode(); + $headers = array_merge($exception->getHeaders(), ['Content-Type' => 'application/json']); + + $json = $this->exceptionToArray($exception); + $json['statusCode'] = $statusCode; + + return new Response(json_encode($json, 15, 512), $statusCode, $headers); + } + + /** + * Serializes data to a given type format. + * + * @param mixed $data The data to serialize. + * @param string $class The source data class. + * @param string $format The target serialization format. + * + * @return string A serialized data string. + */ + protected function serialize($data, $format) + { + return $this->serializer->serialize($data, $format); + } + + /** + * Deserializes data from a given type format. + * + * @param string $data The data to deserialize. + * @param string $class The target data class. + * @param string $format The source serialization format. + * + * @return mixed A deserialized data. + */ + protected function deserialize($data, $class, $format) + { + return $this->serializer->deserialize($data, $class, $format); + } + + protected function validate($data, $asserts = null) + { + $errors = $this->validator->validate($data, $asserts); + + if (count($errors) > 0) { + $errorsString = (string)$errors; + return $this->createBadRequestResponse($errorsString); + } + } + + /** + * Converts an exception to a serializable array. + * + * @param \Exception|null $exception + * + * @return array + */ + private function exceptionToArray(\Exception $exception = null) + { + if (null === $exception) { + return null; + } + + return [ + 'message' => $exception->getMessage(), + 'type' => get_class($exception), + 'previous' => $this->exceptionToArray($exception->getPrevious()), + ]; + } + + protected function getOutputFormat($accept, array $produced) + { + // Figure out what the client accepts + $accept = preg_split("/[\s,]+/", $accept); + + if (in_array('*/*', $accept) || in_array('application/*', $accept)) { + // Prefer JSON if the client has no preference + if (in_array('application/json', $produced)) { + return 'application/json'; + } + if (in_array('application/xml', $produced)) { + return 'application/xml'; + } + } + + if (in_array('application/json', $accept) && in_array('application/json', $produced)) { + return 'application/json'; + } + + if (in_array('application/xml', $accept) && in_array('application/xml', $produced)) { + return 'application/xml'; + } + + // If we reach this point, we don't have a common ground between server and client + return null; + } } diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/ModelInterface.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/ModelInterface.mustache deleted file mode 100644 index a568374d6d3..00000000000 --- a/modules/swagger-codegen/src/main/resources/php-symfony/ModelInterface.mustache +++ /dev/null @@ -1,55 +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 {{modelPackage}}; - -/** - * Interface abstracting model access. - * - * @package {{modelPackage}} - * @author Swagger Codegen team - */ -interface ModelInterface -{ - - /** - * The original name of the model. - * - * @return string - */ - public function modelName(); - - /** - * Array of property to mappings. - * - * @return array[] - */ - public function modelAttributes(); - - /** - * Validate all the properties in the model - * - * Return true if all passed. - * - * @return bool True if all properties are valid - */ - public function isValid(); -} - - diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/ModelSerializer.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/ModelSerializer.mustache deleted file mode 100644 index c2064b60a8d..00000000000 --- a/modules/swagger-codegen/src/main/resources/php-symfony/ModelSerializer.mustache +++ /dev/null @@ -1,174 +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 {{modelPackage}}; - -/** - * ModelSerializer Class Doc Comment - * - * @category Class - * @package {{modelPackage}} - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen - */ -class ModelSerializer -{ - - /** - * Serializes data to a given type format. - * - * @param mixed $data The data to serialize. - * @param string $format The target serialization format. - * - * @return string A serialized data string. - * @throws \InvalidArgumentException When invalid serialization format was used. - */ - public function serialize($data, $format) - { - $normalized = $this->normalize($data); - if ($format === 'json') { - return json_encode($normalized, 15, 512); - } - - throw new \InvalidArgumentException('Unsupported serialization format: '.$format); - } - - /** - * Deserializes data from a given type format. - * - * @param string $data The data to deserialize. - * @param string $class The target class to deserialize to. - * @param string $format The source serialization format. - * - * @return mixed A deserialized value. - * @throws \InvalidArgumentException When invalid serialization format was used. - */ - public function deserialize($data, $class, $format) - { - switch ($format) { - case 'json': - $normalized = json_decode($data, true, 512, 15); - break; - default: - throw new \InvalidArgumentException('Unsupported serialization format: '.$format); - } - - return $this->denormalize($normalized, $class); - } - - public function normalize($data, $format = null) - { - if (is_scalar($data) || null === $data) { - return $data; - } - - if (is_array($data)) { - return array_map(function ($value) use ($format) { - return $this->normalize($value, $format); - }, $data); - } - - if ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); - } - - if ($data instanceof ModelInterface) { - $values = []; - foreach ($data->modelAttributes() as $name => $attribute) { - list($baseName, , $format, , $getter) = $attribute; - $value = $this->normalize($data->$getter(), $format); - if ($value !== null && method_exists($data, 'getAllowableEnumValues') - && !in_array($value, $data::getAllowableEnumValues())) { - $imploded = implode("', '", $data::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$data', must be one of: '$imploded'"); - } - - if ($value !== null) { - $values[$baseName] = $value; - } - } - - return $values; - } - - return (string) $data; - } - - public function denormalize($data, $class, $format = null) - { - if ($data === null) { - return null; - } - - if (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } - - // Denormalize array - if (substr($class, -2) === '[]') { - $innerClass = substr($class, 0, -2); - return array_map(function ($value) use ($format, $innerClass) { - return $this->denormalize($value, $innerClass, $format); - }, $data); - } - - if (!class_exists($class)) { - return $data; - } - - // Denormalize enum - if (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { - $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - - return $data; - } - - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data[$discriminator]) && is_string($data[$discriminator])) { - $subclass = '{{modelPackage}}\\'.$data[$discriminator]; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - - // Denormalize another model - $values = new $class(); - if ($values instanceof ModelInterface) { - foreach ($values->modelAttributes() as $name => $attribute) { - list($baseName, $innerClass, $format, $setter) = $attribute; - - if (!isset($data[$baseName])) { - continue; - } - - $value = $this->denormalize($data[$baseName], $innerClass, $format); - $values->$setter($value); - } - - return $values; - } - - return $data; - } -} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/README.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/README.mustache index d61acfa1c84..0b72cf635fa 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/README.mustache @@ -23,28 +23,28 @@ PHP 5.4.0 and later ## Installation & Usage -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: +To install the dependencies via [Composer](http://getcomposer.org/), add the following repository to `composer.json` of your Symfony project: -``` +```json { - "repositories": [ - { - "type": "git", - "url": "https://github.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git" - } - ], - "require": { - "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}": "*@dev" - } + "repositories": [{ + "type": "path", + "url": "//Path to your generated swagger bundle" + }], } ``` -Then run `composer install` +Then run: + +``` +composer require {{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}:dev-master +``` +to add the generated swagger bundle as a dependency. ## Tests -To run the unit tests: +To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands: ``` composer install diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache index b3985a9489a..0e581a1b84d 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/api.mustache @@ -18,6 +18,7 @@ namespace {{apiPackage}}; +use Symfony\Component\HttpFoundation\File\UploadedFile; {{#operations}}{{#imports}}use {{import}}; {{/imports}} @@ -58,18 +59,15 @@ interface {{classname}} {{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} + * @param integer $responseCode The HTTP response code to return + * @param array $responseHeaders Additional HTTP headers to return with the response () * - {{#responses}} - {{#vendorExtensions.x-symfonyExceptionSimple}} - * @throws {{vendorExtensions.x-symfonyExceptionSimple}} {{message}} - {{/vendorExtensions.x-symfonyExceptionSimple}} - {{^vendorExtensions.x-symfonyExceptionSimple}} - * @return {{^dataType}}void{{/dataType}}{{#dataType}}{{dataType}}{{/dataType}} {{message}} + {{#returnType}} + * @return {{{returnType}}} * - {{/vendorExtensions.x-symfonyExceptionSimple}} - {{/responses}} + {{/returnType}} */ - public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameterType}}{{vendorExtensions.x-parameterType}} {{/vendorExtensions.x-parameterType}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + public function {{operationId}}({{#allParams}}{{#vendorExtensions.x-parameterType}}{{vendorExtensions.x-parameterType}} {{/vendorExtensions.x-parameterType}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}&$responseCode, array &$responseHeaders); {{/operation}} } {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache index 8fb9efb5ed7..6f21a082eb5 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/api_controller.mustache @@ -23,6 +23,7 @@ use \Exception; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; +use Symfony\Component\Validator\Constraints as Assert; use {{apiPackage}}\{{classname}}; {{#imports}}use {{import}}; {{/imports}} @@ -53,8 +54,28 @@ class {{controllerName}} extends Controller * @param Request $request The Symfony request to handle. * @return Response The Symfony response. */ - public function {{operationId}}Action(Request $request) + public function {{operationId}}Action(Request $request{{#hasPathParams}}{{#pathParams}}, ${{paramName}}{{/pathParams}}{{/hasPathParams}}) { + {{#bodyParams}} + // Make sure that the client is providing something that we can consume + $consumes = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + {{/bodyParams}} + // Figure out what data format to return to the client + $produces = [{{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication {{#authMethods}} // Authentication '{{name}}' required {{#isApiKey}} @@ -76,81 +97,58 @@ class {{controllerName}} extends Controller $security{{name}} = $request->headers->get('authorization'); {{/isOAuth}} {{/authMethods}} + + // Read out all input parameter values into variables + {{#allParams}} {{#queryParams}} - // Handle query params - ${{paramName}} = $this->fromQuery($request->query->get('{{paramName}}'), '{{dataType}}'); + ${{paramName}} = $request->query->get('{{paramName}}'); {{/queryParams}} {{#headerParams}} - // Handle header params - ${{paramName}} = $this->fromHeader($request->headers->get('{{paramName}}'), '{{dataType}}'); + ${{paramName}} = $request->headers->get('{{paramName}}'); {{/headerParams}} - {{#pathParams}} - // Handle path params - ${{paramName}} = $this->fromPath($request->attributes->get('{{paramName}}'), '{{dataType}}'); - {{/pathParams}} {{#formParams}} {{#isFile}} - // Handle file params ${{paramName}} = $request->files->get('{{paramName}}'); {{/isFile}} {{^isFile}} - // Handle form params - ${{paramName}} = $this->fromForm($request->request->get('{{paramName}}'), '{{dataType}}'); + ${{paramName}} = $request->request->get('{{paramName}}'); {{/isFile}} {{/formParams}} {{#bodyParams}} - // Handle body params - ${{paramName}} = $this->deserialize($request->getContent(), '{{{dataType}}}', 'json'); + ${{paramName}} = $request->getContent(); {{/bodyParams}} - // Parse incoming parameters - {{#allParams}} - {{#required}} - // Verify the required parameter '{{paramName}}' is set - if (${{paramName}} === null) { - return $this->createBadRequestResponse('Missing the required parameter ${{paramName}} when calling {{operationId}}'); - } + // Use the default value if no value was provided + {{^required}} + {{#isContainer}} + {{#items}} + {{#defaultValue}} + ${{paramName}} = ${{paramName}}?:[{{{defaultValue}}}]; + {{/defaultValue}} + {{/items}} + {{/isContainer}} + {{^isContainer}} + {{#defaultValue}} + ${{paramName}} = ${{paramName}}?:{{{defaultValue}}}; + {{/defaultValue}} + {{/isContainer}} {{/required}} - {{#hasValidation}} - {{#maxLength}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(strlen(${{paramName}}) > {{maxLength}})) { - return $this->createBadRequestResponse('Invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); - } - {{/maxLength}} - {{#minLength}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(strlen(${{paramName}}) < {{minLength}})) { - return $this->createBadRequestResponse('Invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); - } - {{/minLength}} - {{#maximum}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(${{paramName}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { - return $this->createBadRequestResponse('Invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); - } - {{/maximum}} - {{#minimum}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(${{paramName}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { - return $this->createBadRequestResponse('Invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); - } - {{/minimum}} - {{#pattern}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}!preg_match("{{{pattern}}}", ${{paramName}})) { - return $this->createBadRequestResponse("Invalid value for \"{{paramName}}\" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); - } - {{/pattern}} - {{#maxItems}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(count(${{paramName}}) > {{maxItems}})) { - return $this->createBadRequestResponse('Invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); - } - {{/maxItems}} - {{#minItems}} - if ({{^required}}!is_null(${{paramName}}) && {{/required}}(count(${{paramName}}) < {{minItems}})) { - return $this->createBadRequestResponse('Invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); - } - {{/minItems}} - {{/hasValidation}} + + // Deserialize the input values that needs it + {{^isFile}} + {{#bodyParams}} + + ${{paramName}} = $this->deserialize(${{paramName}}, '{{{dataType}}}', $inputFormat); + {{/bodyParams}} + {{^bodyParams}} + ${{paramName}} = $this->deserialize(${{paramName}}, '{{#isContainer}}array<{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}{{^collectionFormat}}csv{{/collectionFormat}}>{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}', 'string'); + {{/bodyParams}} + {{/isFile}} {{/allParams}} - // Call the API interface + // Validate the input values +{{>api_input_validation}} + try { $handler = $this->getApiHandler(); @@ -158,31 +156,35 @@ class {{controllerName}} extends Controller // Set authentication method '{{name}}' $handler->set{{name}}($security{{name}}); {{/authMethods}} - {{#returnType}} - // Expecting a return value (exception otherwise) - $result = $handler->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + + // Make the call to the business logic + $responseCode = {{#returnType}}200{{/returnType}}{{^returnType}}204{{/returnType}}; + $responseHeaders = []; + $result = $handler->{{operationId}}({{#allParams}}${{paramName}}, {{/allParams}}$responseCode, $responseHeaders); + + // Find default response message + $message = '{{#responses}}{{#isDefault}}{{message}}{{/isDefault}}{{/responses}}'; + // Find a more specific message, if available + switch ($responseCode) { {{#responses}} - {{^vendorExtensions.x-symfonyExceptionSimple}} - // Handle {{code}} response: {{message}} - $content = $this->serialize($result, 'json'); - return new Response($content, {{code}}, [ - 'Content-Type' => 'application/json', - 'X-Swagger-Message' => '{{message}}', - ]); - {{/vendorExtensions.x-symfonyExceptionSimple}} + case {{code}}: + $message = '{{message}}'; + break; {{/responses}} - {{/returnType}} - {{^returnType}} - // No return type expected; return empty response - $handler->{{operationId}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - return new Response('', 204); - {{/returnType}} - {{#responses}} - } catch (HttpException $exception) { - // {{message}} - return $this->createErrorResponse($exception); - {{/responses}} + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); } catch (Exception $fallthrough) { return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); } @@ -195,7 +197,7 @@ class {{controllerName}} extends Controller */ public function getApiHandler() { - return $this->get('{{bundleAlias}}.api.api_server')->getApiHandler('{{pathPrefix}}'); + return $this->apiServer->getApiHandler('{{pathPrefix}}'); } } {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api_input_validation.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api_input_validation.mustache new file mode 100644 index 00000000000..0bcd3053485 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/api_input_validation.mustache @@ -0,0 +1,88 @@ +{{#allParams}} + $asserts = []; +{{#required}} + $asserts[] = new Assert\NotNull(); +{{/required}} +{{#isEnum}} + {{#isContainer}} + $asserts[] = new Assert\All([ + {{#items}} + new Assert\Choice([ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} ]) + {{/items}} + ]); + {{/isContainer}} + {{^isContainer}} + $asserts[] = new Assert\Choice([ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} ]); + {{/isContainer}} +{{/isEnum}} +{{#isContainer}} + $asserts[] = new Assert\All([ + {{#items}} + new Assert\Type("{{datatype}}") + {{/items}} + ]); +{{/isContainer}} +{{^isContainer}} + {{#isDate}} + $asserts[] = new Assert\Date(); + {{/isDate}} + {{#isDateTime}} + $asserts[] = new Assert\DateTime(); + {{/isDateTime}} + {{^isDate}} + {{^isDateTime}} + {{#isFile}} + $asserts[] = new Assert\File(); + {{/isFile}} + {{^isFile}} + $asserts[] = new Assert\Type("{{dataType}}"); + {{/isFile}} + {{/isDateTime}} + {{/isDate}} +{{/isContainer}} +{{#hasValidation}} + {{#maxLength}} + $asserts[] = new Assert\Length([ + 'max' => {{maxLength}} + ]); + {{/maxLength}} + {{#minLength}} + $asserts[] = new Assert\Length([ + 'min' => {{minLength}} + ]); + {{/minLength}} + {{#minimum}} + {{#exclusiveMinimum}} + $asserts[] = new Assert\GreaterThan({{minimum}}); + {{/exclusiveMinimum}} + {{^exclusiveMinimum}} + $asserts[] = new Assert\GreaterThanOrEqual({{minimum}}); + {{/exclusiveMinimum}} + {{/minimum}} + {{#maximum}} + {{#exclusiveMaximum}} + $asserts[] = new Assert\LessThan({{minimum}}); + {{/exclusiveMaximum}} + {{^exclusiveMaximum}} + $asserts[] = new Assert\LessThanOrEqual({{minimum}}); + {{/exclusiveMaximum}} + {{/maximum}} + {{#pattern}} + $asserts[] = new Assert\Regex("/{{pattern}}/"); + {{/pattern}} + {{#maxItems}} + $asserts[] = new Assert\Count([ + 'max' => {{maxItems}} + ]); + {{/maxItems}} + {{#minItems}} + $asserts[] = new Assert\Count([ + 'min' => {{minItems}} + ]); + {{/minItems}} +{{/hasValidation}} + $response = $this->validate(${{paramName}}, $asserts); + if ($response instanceof Response) { + return $response; + } +{{/allParams}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/api_test.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/api_test.mustache deleted file mode 100644 index c1f16c70cea..00000000000 --- a/modules/swagger-codegen/src/main/resources/php-symfony/api_test.mustache +++ /dev/null @@ -1,77 +0,0 @@ -partial_header}} -/** - * 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 endpoint. - */ - -namespace {{apiTestsPackage}}; - -use \{{invokerPackage}}\Configuration; -use \{{invokerPackage}}\ApiClient; -use \{{invokerPackage}}\ApiException; -use \{{invokerPackage}}\ObjectSerializer; - -/** - * {{classname}}Test Class Doc Comment - * - * @category Class - * @package {{apiTestsPackage}} - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen - */ -{{#operations}}class {{classname}}Test extends \PHPUnit_Framework_TestCase -{ - - /** - * 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 function tearDown() - { - } - - /** - * Clean up after running all test cases - */ - public static function tearDownAfterClass() - { - } - {{#operation}} - - /** - * Test case for {{{operationId}}} - * - * {{{summary}}}. - * - */ - public function test{{operationIdCamelCase}}() - { - } - {{/operation}} -} -{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache index eda7618bf65..5d6156df550 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache @@ -23,13 +23,17 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", + "symfony/validator": "*", + "jms/serializer-bundle": "*", "symfony/framework-bundle": "^2.3|^3.0" }, "require-dev": { "phpunit/phpunit": "~4.8", "satooshi/php-coveralls": "~1.0", "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" + "friendsofphp/php-cs-fixer": "~1.12", + "symfony/browser-kit": "*", + "hoa/regex": "~1.0" }, "autoload": { "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache index 6e865578075..02d96acb45f 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/model.mustache @@ -21,10 +21,9 @@ namespace {{modelPackage}}; -{{^isEnum}} -{{#useStatements}}use {{this}}; -{{/useStatements}} -{{/isEnum}} +use Symfony\Component\Validator\Constraints as Assert; +use JMS\Serializer\Annotation\Type; +use JMS\Serializer\Annotation\SerializedName; /** * Class representing the {{classname}} model. @@ -36,5 +35,5 @@ namespace {{modelPackage}}; * @package {{modelPackage}} * @author Swagger Codegen team */ -{{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} +{{>model_generic}} {{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache index 8e72f968406..8106055c854 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/model_generic.mustache @@ -1,49 +1,6 @@ -class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}implements ModelInterface, \ArrayAccess +class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} { - const DISCRIMINATOR = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; - - /** - * The original name of the model. - * @var string - */ - protected static $_name = '{{name}}'; - - /** - * Array of property to type mappings. Used for (de)serialization - * @var array[] - */ - protected static $_attributes = [{{#vars}} - '{{name}}' => ['{{baseName}}', '{{{vendorExtensions.x-fullType}}}', {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}, '{{setter}}', '{{getter}}'],{{/vars}} - ]; - {{#vars}}{{#isEnum}} - - /** - * Allowed values of {{name}} - */{{#allowableValues}}{{#enumVars}} - const {{enumName}}_{{{name}}} = {{{value}}};{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}} - - {{#vars}}{{#isEnum}} - /** - * Gets allowable values of the enum - * @return string[] - */ - public function {{getter}}AllowableValues() - { - return [ - {{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^-last}} - {{/-last}}{{/enumVars}}{{/allowableValues}} - ]; - } - {{/isEnum}}{{/vars}} - {{#vars}} - /**{{#description}} - * {{description}} - * - {{/description}} - * @var {{{datatype}}}{{^required}}|null{{/required}} - */ - protected ${{name}}; - + {{#vars}}{{>model_variables}} {{/vars}} /** * Constructor @@ -58,187 +15,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{#vars}} $this->{{name}} = isset($data['{{name}}']) ? $data['{{name}}'] : {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}; {{/vars}} - {{#discriminator}} - - // Initialize discriminator property with the model name. - foreach (self::$_attributes as $_name => $attribute) { - list($baseName) = $attribute; - if ('{{discriminator}}' === $baseName) { - $this->$_name = static::$_name; - } - } - {{/discriminator}} } - - /** - * show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - {{#parent}} - $invalid_properties = parent::listInvalidProperties(); - {{/parent}} - {{^parent}} - $invalid_properties = []; - {{/parent}} - - {{#vars}} - {{#required}} - if ($this->{{name}} === null) { - $invalid_properties[] = "'{{name}}' can't be null"; - } - {{/required}} - {{#isEnum}} - {{^isContainer}} - $allowedValues = $this->{{getter}}AllowableValues(); - if (!in_array($this->{{name}}, $allowedValues, true)) { - $invalid_properties[] = sprintf( - "invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - {{/isContainer}} - {{/isEnum}} - {{#hasValidation}} - {{#maxLength}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}(strlen($this->{{name}}) > {{maxLength}})) { - $invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; - } - - {{/maxLength}} - {{#minLength}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}(strlen($this->{{name}}) < {{minLength}})) { - $invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; - } - - {{/minLength}} - {{#maximum}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}($this->{{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { - $invalid_properties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}."; - } - - {{/maximum}} - {{#minimum}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}($this->{{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { - $invalid_properties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}."; - } - - {{/minimum}} - {{#pattern}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}!preg_match("{{{pattern}}}", $this->{{name}})) { - $invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}."; - } - - {{/pattern}} - {{#maxItems}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}(count($this->{{name}}) > {{maxItems}})) { - $invalid_properties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}."; - } - - {{/maxItems}} - {{#minItems}} - if ({{^required}}!is_null($this->{{name}}) && {{/required}}(count($this->{{name}}) < {{minItems}})) { - $invalid_properties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}."; - } - - {{/minItems}} - {{/hasValidation}} - {{/vars}} - return $invalid_properties; - } - - /** - * The original name of the model. - * - * @return string - */ - public function modelName() { - return self::$_name; - } - - /** - * Array of property to mappings. - * - * @return array[] - */ - public function modelAttributes() { - {{#parentSchema}}return array_merge(parent::$_attributes, self::$_attributes);{{/parentSchema}} - {{^parentSchema}}return self::$_attributes;{{/parentSchema}} - } - - /** - * Validate all the properties in the model - * - * Return true if all passed. - * - * @return bool True if all properties are valid - */ - public function isValid() - { - {{#parent}} - if (!parent::isValid()) { - return false; - } - - {{/parent}} - {{#vars}} - {{#required}} - if ($this->{{name}} === null) { - return false; - } - {{/required}} - {{#isEnum}} - {{^isContainer}} - $allowedValues = $this->{{getter}}AllowableValues(); - if (!in_array($this->{{name}}, $allowedValues)) { - return false; - } - {{/isContainer}} - {{/isEnum}} - {{#hasValidation}} - {{#maxLength}} - if (strlen($this->{{name}}) > {{maxLength}}) { - return false; - } - {{/maxLength}} - {{#minLength}} - if (strlen($this->{{name}}) < {{minLength}}) { - return false; - } - {{/minLength}} - {{#maximum}} - if ($this->{{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { - return false; - } - {{/maximum}} - {{#minimum}} - if ($this->{{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { - return false; - } - {{/minimum}} - {{#pattern}} - if (!preg_match("{{{pattern}}}", $this->{{name}})) { - return false; - } - {{/pattern}} - {{#maxItems}} - if (count($this->{{name}}) > {{maxItems}}) { - return false; - } - {{/maxItems}} - {{#minItems}} - if (count($this->{{name}}) < {{minItems}}) { - return false; - } - {{/minItems}} - {{/hasValidation}} - {{/vars}} - return true; - } - {{#vars}} /** @@ -258,109 +35,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple * * @return $this */ - public function {{setter}}({{#vendorExtensions.x-typeAnnotation}}{{vendorExtensions.x-typeAnnotation}} {{/vendorExtensions.x-typeAnnotation}}${{name}}{{^required}} = null{{/required}}) + public function {{setter}}({{#vendorExtensions.x-parameterType}}{{vendorExtensions.x-parameterType}} {{/vendorExtensions.x-parameterType}}${{name}}{{^required}} = null{{/required}}) { - {{#isEnum}} - $allowedValues = $this->{{getter}}AllowableValues(); - {{^isContainer}} - if ({{^required}}${{name}} !== null && {{/required}}!in_array(${{{name}}}, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - {{/isContainer}} - {{#isContainer}} - if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for '{{name}}', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - {{/isContainer}} - {{/isEnum}} - {{#hasValidation}} - {{#maxLength}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(strlen(${{name}}) > {{maxLength}})) { - throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); - }{{/maxLength}} - {{#minLength}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(strlen(${{name}}) < {{minLength}})) { - throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); - } - {{/minLength}} - {{#maximum}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { - throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); - } - {{/maximum}} - {{#minimum}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { - throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); - } - {{/minimum}} - {{#pattern}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(!preg_match("{{{pattern}}}", ${{name}}))) { - throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); - } - {{/pattern}} - {{#maxItems}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) > {{maxItems}})) { - throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); - }{{/maxItems}} - {{#minItems}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) < {{minItems}})) { - throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); - } - {{/minItems}} - {{/hasValidation}} $this->{{name}} = ${{name}}; return $this; } {{/vars}} - /** - * Returns true if offset exists. False otherwise. - * @param integer $offset Offset - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->$offset); - } - - /** - * Gets offset. - * @param integer $offset Offset - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->$offset) ? $this->$offset : null; - } - - /** - * Sets value based on offset. - * @param string $offset Offset - * @param mixed $value Value to be set - * @return void - */ - public function offsetSet($offset, $value) - { - $this->$offset = $value; - } - - /** - * Unsets offset. - * @param integer $offset Offset - * @return void - */ - public function offsetUnset($offset) - { - $this->$offset = null; - } } diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model_variables.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/model_variables.mustache new file mode 100644 index 00000000000..d0af5b8579e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/model_variables.mustache @@ -0,0 +1,91 @@ + /** + {{#description}} + * {{description}} + * + {{/description}} + * @var {{{datatype}}}{{^required}}|null{{/required}} + * @SerializedName("{{baseName}}") +{{#required}} + * @Assert\NotNull() +{{/required}} +{{#isEnum}} + {{#isContainer}} + * @Assert\All({ + {{#items}} + * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }) + {{/items}} + * }) + {{/isContainer}} + {{^isContainer}} + * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }) + {{/isContainer}} +{{/isEnum}} +{{#isContainer}} + * @Assert\All({ + {{#items}} + * @Assert\Type("{{datatype}}") + {{/items}} + * }) + {{#items}} + * @Type("array<{{datatype}}>") + {{/items}} +{{/isContainer}} +{{^isContainer}} + {{#isDate}} + * @Assert\Date() + * @Type("DateTime") + {{/isDate}} + {{#isDateTime}} + * @Assert\DateTime() + * @Type("DateTime") + {{/isDateTime}} + {{^isDate}} + {{^isDateTime}} + * @Assert\Type("{{datatype}}") + * @Type("{{datatype}}") + {{/isDateTime}} + {{/isDate}} +{{/isContainer}} +{{#hasValidation}} + {{#maxLength}} + * @Assert\Length( + * max = {{maxLength}} + * ) + {{/maxLength}} + {{#minLength}} + * @Assert\Length( + * min = {{minLength}} + * ) + {{/minLength}} + {{#minimum}} + {{#exclusiveMinimum}} + * @Assert\GreaterThan({{minimum}}) + {{/exclusiveMinimum}} + {{^exclusiveMinimum}} + * @Assert\GreaterThanOrEqual({{minimum}}) + {{/exclusiveMinimum}} + {{/minimum}} + {{#maximum}} + {{#exclusiveMaximum}} + * @Assert\LessThan({{minimum}}) + {{/exclusiveMaximum}} + {{^exclusiveMaximum}} + * @Assert\LessThanOrEqual({{minimum}}) + {{/exclusiveMaximum}} + {{/maximum}} + {{#pattern}} + * @Assert\Regex("/{{pattern}}/") + {{/pattern}} + {{#maxItems}} + * @Assert\Count( + * max = {{maxItems}} + * ) + {{/maxItems}} + {{#minItems}} + * @Assert\Count( + * min = {{minItems}} + * ) + {{/minItems}} +{{/hasValidation}} + */ + protected ${{name}}; diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/routing.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/routing.mustache index e91e9349c06..e0294a956d1 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/routing.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/routing.mustache @@ -11,7 +11,29 @@ path: {{path}} methods: [{{httpMethod}}] defaults: - _controller: {{bundleClassName}}:{{baseName}}:{{operationId}} + _controller: {{bundleAlias}}.controller.{{pathPrefix}}:{{operationId}}Action + {{#hasPathParams}} + requirements: + {{/hasPathParams}} + {{#pathParams}} + {{#pattern}} + {{paramName}}: '{{pattern}}' + {{/pattern}} + {{^pattern}} + {{#isLong}} + {{paramName}}: '\d+' + {{/isLong}} + {{#isInteger}} + {{paramName}}: '\d+' + {{/isInteger}} + {{#isString}} + {{paramName}}: '[a-z0-9]+' + {{/isString}} + {{#isBoolean}} + {{paramName}}: 'true|false' + {{/isBoolean}} + {{/pattern}} + {{/pathParams}} {{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/serialization/JmsSerializer.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/serialization/JmsSerializer.mustache new file mode 100644 index 00000000000..995e71ba023 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/serialization/JmsSerializer.mustache @@ -0,0 +1,91 @@ +serializer = SerializerBuilder::create() + ->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy)) + ->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy)) + ->build(); + } + + public function serialize($data, $format) + { + return SerializerBuilder::create()->build()->serialize($data, $this->convertFormat($format)); + } + + public function deserialize($data, $type, $format) + { + if ($format == 'string') { + return $this->deserializeString($data, $type); + } + + // If we end up here, let JMS serializer handle the deserialization + return $this->serializer->deserialize($data, $type, $this->convertFormat($format)); + } + + private function convertFormat($format) + { + switch ($format) { + case 'application/json': + return 'json'; + case 'application/xml': + return 'xml'; + } + + return null; + } + + private function deserializeString($data, $type) + { + switch ($type) { + case 'int': + case 'integer': + if (is_int($data)) { + return $data; + } + + if (is_numeric($data)) { + return $data + 0; + } + + break; + case 'string': + break; + case 'boolean': + case 'bool': + if (strtolower($data) === 'true') { + return true; + } + + if (strtolower($data) === 'false') { + return false; + } + + break; + case 'array': + return explode(',', $data); + case 'array': + return explode(' ', $data); + case 'array': + return explode("\t", $data); + case 'array': + return explode('|', $data); + } + + // If we end up here, just return data + return $data; + } +} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/serialization/SerializerInterface.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/serialization/SerializerInterface.mustache new file mode 100644 index 00000000000..60ad8724648 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/serialization/SerializerInterface.mustache @@ -0,0 +1,27 @@ +getCurrentPath()) > 0) { + $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath())); + } else { + $property = ''; + } + + return new static(sprintf( + 'Expected %s%s, but got %s: %s', + $property, + $expected_type, + gettype($actual_value), + json_encode($actual_value) + )); + } +} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/services.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/services.mustache index 89e2bb8a96b..f6aec0cc2e0 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/services.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/services.mustache @@ -2,9 +2,33 @@ # https://github.com/swagger-api/swagger-codegen # Do not edit the class manually. +parameters: + {{bundleAlias}}.serializer: '{{servicePackage}}\JmsSerializer' + {{bundleAlias}}.validator: '{{servicePackage}}\SymfonyValidator' + services: {{bundleAlias}}.api.api_server: class: {{apiPackage}}\ApiServer {{bundleAlias}}.model.model_serializer: class: {{modelPackage}}\ModelSerializer + + {{bundleAlias}}.service.serializer: + class: %{{bundleAlias}}.serializer% + + {{bundleAlias}}.service.validator: + class: %{{bundleAlias}}.validator% + +{{#apiInfo}} +{{#apis}} +{{#operations}} + {{bundleAlias}}.controller.{{pathPrefix}}: + class: {{controllerPackage}}\{{baseName}}Controller + calls: + - [setSerializer, ['@{{bundleAlias}}.service.serializer']] + - [setValidator, ['@{{bundleAlias}}.service.validator']] + - [setApiServer, ['@{{bundleAlias}}.api.api_server']] + +{{/operations}} +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/testing/AppKernel.php b/modules/swagger-codegen/src/main/resources/php-symfony/testing/AppKernel.php new file mode 100644 index 00000000000..631690bc978 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/AppKernel.php @@ -0,0 +1,21 @@ +load(__DIR__.'/test_config.yml'); + } +} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/testing/api_test.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/testing/api_test.mustache new file mode 100644 index 00000000000..d337c1e3df6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/api_test.mustache @@ -0,0 +1,116 @@ +partial_header}} +/** + * 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 endpoint. + */ + +namespace {{apiTestsPackage}}; + +use {{invokerPackage}}\Configuration; +use {{invokerPackage}}\ApiClient; +use {{invokerPackage}}\ApiException; +use {{invokerPackage}}\ObjectSerializer; +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +/** + * {{classname}}Test Class Doc Comment + * + * @category Class + * @package {{apiTestsPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +{{#operations}}class {{classname}}Test extends WebTestCase +{ + + /** + * 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 function tearDown() + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { + } + {{#operation}} + + /** + * Test case for {{{operationId}}} + * + * {{{summary}}}. + * + */ + public function test{{operationIdCamelCase}}() + { + $client = static::createClient(); + + $path = '{{path}}'; + {{#pathParams}} + {{=<% %>=}} + $pattern = '{<%paramName%>}'; + <%={{ }}=%> + {{#pattern}} + $data = $this->genTestData('{{pattern}}'); + {{/pattern}} + {{^pattern}} + {{#isLong}} + $data = $this->genTestData('\d+'); + {{/isLong}} + {{#isInteger}} + $data = $this->genTestData('\d+'); + {{/isInteger}} + {{#isString}} + $data = $this->genTestData('[a-z0-9]+'); + {{/isString}} + {{#isBoolean}} + $data = $this->genTestData('true|false'); + {{/isBoolean}} + {{/pattern}} + $path = str_replace($pattern, $data, $path); + {{/pathParams}} + + $crawler = $client->request('{{httpMethod}}', $path); + } + {{/operation}} + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/model_test.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/testing/model_test.mustache similarity index 95% rename from modules/swagger-codegen/src/main/resources/php-symfony/model_test.mustache rename to modules/swagger-codegen/src/main/resources/php-symfony/testing/model_test.mustache index 797f9a2af2a..b4b9cf012a3 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/model_test.mustache @@ -19,7 +19,7 @@ * Please update the test case below to test the model. */ -namespace {{modelTestsPackage}}; +namespace {{modelPackage}}; /** * {{classname}}Test Class Doc Comment @@ -67,6 +67,7 @@ class {{classname}}Test extends \PHPUnit_Framework_TestCase */ public function test{{classname}}() { + $test{{classname}} = new {{classname}}(); } {{#vars}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/phpunit.xml.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/testing/phpunit.xml.mustache similarity index 90% rename from modules/swagger-codegen/src/main/resources/php-symfony/phpunit.xml.mustache rename to modules/swagger-codegen/src/main/resources/php-symfony/testing/phpunit.xml.mustache index 5de6fea575c..bd5b2978ee0 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/phpunit.xml.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/phpunit.xml.mustache @@ -12,6 +12,10 @@ + + + + {{apiSrcPath}} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/testing/pom.xml b/modules/swagger-codegen/src/main/resources/php-symfony/testing/pom.xml new file mode 100644 index 00000000000..614b3d33f98 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.penneo + PhpSymfonyPetstoreServerTests + pom + 1.0-SNAPSHOT + PHP Symfony Swagger Petstore Server + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + composer + + install + + + + + bundle-test + integration-test + + exec + + + vendor/bin/phpunit + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/testing/test_config.yml b/modules/swagger-codegen/src/main/resources/php-symfony/testing/test_config.yml new file mode 100644 index 00000000000..10c88a274c9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/testing/test_config.yml @@ -0,0 +1,8 @@ +imports: + - { resource: "../Resources/config/services.yml" } + +framework: + secret: "testsecret" + test: ~ + router: + resource: "%kernel.root_dir%/../Resources/config/routing.yml" diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/validation/SymfonyValidator.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/validation/SymfonyValidator.mustache new file mode 100644 index 00000000000..3b6c5dd0ef6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/validation/SymfonyValidator.mustache @@ -0,0 +1,20 @@ +validator = Validation::createValidator(); + } + + public function validate($value, $constraints = null, $groups = null) + { + return $this->validator->validate($value, $constraints, $groups); + } +} diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/validation/ValidatorInterface.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/validation/ValidatorInterface.mustache new file mode 100644 index 00000000000..e2a0d9badc5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php-symfony/validation/ValidatorInterface.mustache @@ -0,0 +1,25 @@ +level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->setUsingCache(true) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) + ); diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml b/samples/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml new file mode 100644 index 00000000000..d77f3825f6f --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php new file mode 100644 index 00000000000..d26918e624f --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php @@ -0,0 +1,80 @@ +apis[$api])) { + throw new \InvalidArgumentException('API has already a handler: '.$api); + } + + $this->apis[$api] = $handler; + } + + /** + * Returns an API handler. + * + * @param string $api An API name of the handle + * @return mixed Returns a handler + * @throws \InvalidArgumentException When no such handler exists + */ + public function getApiHandler($api) + { + if (!isset($this->apis[$api])) { + throw new \InvalidArgumentException('No handler for '.$api.' implemented.'); + } + + return $this->apis[$api]; + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php new file mode 100644 index 00000000000..587f6d813a3 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php @@ -0,0 +1,172 @@ +validator = $validator; + } + + public function setSerializer(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function setApiServer($server) + { + $this->apiServer = $server; + } + + /** + * This will return a response with code 400. Usage example: + * return $this->createBadRequestResponse('Unable to access this page!'); + * + * @param string $message A message + * + * @return Response + */ + public function createBadRequestResponse($message = 'Bad Request.') + { + return new Response($message, 400); + } + + /** + * This will return an error response. Usage example: + * return $this->createErrorResponse(new UnauthorizedHttpException()); + * + * @param HttpException $exception An HTTP exception + * + * @return Response + */ + public function createErrorResponse(HttpException $exception) + { + $statusCode = $exception->getStatusCode(); + $headers = array_merge($exception->getHeaders(), ['Content-Type' => 'application/json']); + + $json = $this->exceptionToArray($exception); + $json['statusCode'] = $statusCode; + + return new Response(json_encode($json, 15, 512), $statusCode, $headers); + } + + /** + * Serializes data to a given type format. + * + * @param mixed $data The data to serialize. + * @param string $class The source data class. + * @param string $format The target serialization format. + * + * @return string A serialized data string. + */ + protected function serialize($data, $format) + { + return $this->serializer->serialize($data, $format); + } + + /** + * Deserializes data from a given type format. + * + * @param string $data The data to deserialize. + * @param string $class The target data class. + * @param string $format The source serialization format. + * + * @return mixed A deserialized data. + */ + protected function deserialize($data, $class, $format) + { + return $this->serializer->deserialize($data, $class, $format); + } + + protected function validate($data, $asserts = null) + { + $errors = $this->validator->validate($data, $asserts); + + if (count($errors) > 0) { + $errorsString = (string)$errors; + return $this->createBadRequestResponse($errorsString); + } + } + + /** + * Converts an exception to a serializable array. + * + * @param \Exception|null $exception + * + * @return array + */ + private function exceptionToArray(\Exception $exception = null) + { + if (null === $exception) { + return null; + } + + return [ + 'message' => $exception->getMessage(), + 'type' => get_class($exception), + 'previous' => $this->exceptionToArray($exception->getPrevious()), + ]; + } + + protected function getOutputFormat($accept, array $produced) + { + // Figure out what the client accepts + $accept = preg_split("/[\s,]+/", $accept); + + if (in_array('*/*', $accept) || in_array('application/*', $accept)) { + // Prefer JSON if the client has no preference + if (in_array('application/json', $produced)) { + return 'application/json'; + } + if (in_array('application/xml', $produced)) { + return 'application/xml'; + } + } + + if (in_array('application/json', $accept) && in_array('application/json', $produced)) { + return 'application/json'; + } + + if (in_array('application/xml', $accept) && in_array('application/xml', $produced)) { + return 'application/xml'; + } + + // If we reach this point, we don't have a common ground between server and client + return null; + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php new file mode 100644 index 00000000000..9362b82b123 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php @@ -0,0 +1,799 @@ +headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\Pet', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("Swagger\Server\Model\Pet"); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->addPet($body, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 405: + $message = 'Invalid input'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation deletePet + * + * Deletes a pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function deletePetAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $apiKey = $request->headers->get('apiKey'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $petId = $this->deserialize($petId, 'int', 'string'); + $apiKey = $request->headers->get('apiKey'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $apiKey = $this->deserialize($apiKey, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($apiKey, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deletePet($petId, $apiKey, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid pet value'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation findPetsByStatus + * + * Finds Pets by status + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function findPetsByStatusAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $status = $request->query->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $status = $this->deserialize($status, 'array', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Choice([ "available", "pending", "sold" ]) + ]); + $asserts[] = new Assert\All([ + new Assert\Type("string") + ]); + $response = $this->validate($status, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->findPetsByStatus($status, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid status value'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation findPetsByTags + * + * Finds Pets by tags + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function findPetsByTagsAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $tags = $request->query->get('tags'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $tags = $this->deserialize($tags, 'array', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("string") + ]); + $response = $this->validate($tags, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->findPetsByTags($tags, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid tag value'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getPetById + * + * Find pet by ID + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getPetByIdAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'api_key' required + // Set key with prefix in header + $securityapi_key = $request->headers->get('api_key'); + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $petId = $this->deserialize($petId, 'int', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'api_key' + $handler->setapi_key($securityapi_key); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getPetById($petId, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Pet not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updatePet + * + * Update an existing pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updatePetAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json', 'application/xml']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\Pet', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("Swagger\Server\Model\Pet"); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updatePet($body, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Pet not found'; + break; + case 405: + $message = 'Validation exception'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updatePetWithForm + * + * Updates a pet in the store with form data + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updatePetWithFormAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $name = $request->request->get('name'); + $status = $request->request->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $petId = $this->deserialize($petId, 'int', 'string'); + $name = $request->request->get('name'); + $status = $request->request->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $name = $this->deserialize($name, 'string', 'string'); + $name = $request->request->get('name'); + $status = $request->request->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $status = $this->deserialize($status, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($name, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($status, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updatePetWithForm($petId, $name, $status, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 405: + $message = 'Invalid input'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation uploadFile + * + * uploads an image + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function uploadFileAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $additionalMetadata = $request->request->get('additionalMetadata'); + $file = $request->files->get('file'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $petId = $this->deserialize($petId, 'int', 'string'); + $additionalMetadata = $request->request->get('additionalMetadata'); + $file = $request->files->get('file'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $additionalMetadata = $this->deserialize($additionalMetadata, 'string', 'string'); + $additionalMetadata = $request->request->get('additionalMetadata'); + $file = $request->files->get('file'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($additionalMetadata, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\File(); + $response = $this->validate($file, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->uploadFile($petId, $additionalMetadata, $file, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return PetApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('pet'); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php new file mode 100644 index 00000000000..304a847c6eb --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -0,0 +1,368 @@ +headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $orderId = $this->deserialize($orderId, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($orderId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deleteOrder($orderId, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Order not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getInventory + * + * Returns pet inventories by status + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getInventoryAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'api_key' required + // Set key with prefix in header + $securityapi_key = $request->headers->get('api_key'); + + // Read out all input parameter values into variables + + // Validate the input values + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'api_key' + $handler->setapi_key($securityapi_key); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getInventory($responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getOrderById + * + * Find purchase order by ID + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getOrderByIdAction(Request $request, $orderId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $orderId = $this->deserialize($orderId, 'int', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $asserts[] = new Assert\GreaterThanOrEqual(1); + $asserts[] = new Assert\LessThanOrEqual(1); + $response = $this->validate($orderId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getOrderById($orderId, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Order not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation placeOrder + * + * Place an order for a pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function placeOrderAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = []; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\Order', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("Swagger\Server\Model\Order"); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->placeOrder($body, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid Order'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return StoreApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('store'); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php new file mode 100644 index 00000000000..7f182bb1e61 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php @@ -0,0 +1,720 @@ +headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("Swagger\Server\Model\User"); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUser($body, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation createUsersWithArrayInput + * + * Creates list of users with given input array + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function createUsersWithArrayInputAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = []; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\User[]', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("Swagger\Server\Model\User[]") + ]); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUsersWithArrayInput($body, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation createUsersWithListInput + * + * Creates list of users with given input array + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function createUsersWithListInputAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = []; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\User[]', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("Swagger\Server\Model\User[]") + ]); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUsersWithListInput($body, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation deleteUser + * + * Delete user + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function deleteUserAction(Request $request, $username) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $username = $this->deserialize($username, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deleteUser($username, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid username supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getUserByName + * + * Get user by user name + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getUserByNameAction(Request $request, $username) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $username = $this->deserialize($username, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getUserByName($username, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid username supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation loginUser + * + * Logs user into the system + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function loginUserAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $username = $request->query->get('username'); + $password = $request->query->get('password'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $username = $this->deserialize($username, 'string', 'string'); + $username = $request->query->get('username'); + $password = $request->query->get('password'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + $password = $this->deserialize($password, 'string', 'string'); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($password, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->loginUser($username, $password, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid username/password supplied'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation logoutUser + * + * Logs out current logged in user session + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function logoutUserAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Validate the input values + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->logoutUser($responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updateUser + * + * Updated user + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updateUserAction(Request $request, $username) + { + // Make sure that the client is providing something that we can consume + $consumes = []; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat); + $body = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + + $body = $this->deserialize($body, 'Swagger\Server\Model\User', $inputFormat); + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("Swagger\Server\Model\User"); + $response = $this->validate($body, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updateUser($username, $body, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid user supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + $result?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-Swagger-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return UserApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('user'); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/SwaggerServerApiPass.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/SwaggerServerApiPass.php new file mode 100644 index 00000000000..7ac5898d143 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/SwaggerServerApiPass.php @@ -0,0 +1,70 @@ +has('swagger_server.api.api_server')) { + return; + } + + $definition = $container->findDefinition('swagger_server.api.api_server'); + + // find all service IDs with the swagger_server.api tag + $taggedServices = $container->findTaggedServiceIds('swagger_server.api'); + + foreach ($taggedServices as $id => $tags) { + foreach ($tags as $tag) { + // add the transport service to the ChainTransport service + $definition->addMethodCall('addApiHandler', [$tag['api'], new Reference($id)]); + } + } + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/SwaggerServerExtension.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/SwaggerServerExtension.php new file mode 100644 index 00000000000..2f12f034cce --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/SwaggerServerExtension.php @@ -0,0 +1,57 @@ +load('services.yml'); + } + + public function getAlias() + { + return 'swagger_server'; + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php new file mode 100644 index 00000000000..5a00e41be2d --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php @@ -0,0 +1,154 @@ +code = isset($data['code']) ? $data['code'] : null; + $this->type = isset($data['type']) ? $data['type'] : null; + $this->message = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets code. + * + * @return int|null + */ + public function getCode() + { + return $this->code; + } + + /** + * Sets code. + * + * @param int|null $code + * + * @return $this + */ + public function setCode($code = null) + { + $this->code = $code; + + return $this; + } + + /** + * Gets type. + * + * @return string|null + */ + public function getType() + { + return $this->type; + } + + /** + * Sets type. + * + * @param string|null $type + * + * @return $this + */ + public function setType($type = null) + { + $this->type = $type; + + return $this; + } + + /** + * Gets message. + * + * @return string|null + */ + public function getMessage() + { + return $this->message; + } + + /** + * Sets message. + * + * @param string|null $message + * + * @return $this + */ + public function setMessage($message = null) + { + $this->message = $message; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php new file mode 100644 index 00000000000..e59ecdbe7c4 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php @@ -0,0 +1,121 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php new file mode 100644 index 00000000000..65a7ead3cf2 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php @@ -0,0 +1,256 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->petId = isset($data['petId']) ? $data['petId'] : null; + $this->quantity = isset($data['quantity']) ? $data['quantity'] : null; + $this->shipDate = isset($data['shipDate']) ? $data['shipDate'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + $this->complete = isset($data['complete']) ? $data['complete'] : false; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets petId. + * + * @return int|null + */ + public function getPetId() + { + return $this->petId; + } + + /** + * Sets petId. + * + * @param int|null $petId + * + * @return $this + */ + public function setPetId($petId = null) + { + $this->petId = $petId; + + return $this; + } + + /** + * Gets quantity. + * + * @return int|null + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Sets quantity. + * + * @param int|null $quantity + * + * @return $this + */ + public function setQuantity($quantity = null) + { + $this->quantity = $quantity; + + return $this; + } + + /** + * Gets shipDate. + * + * @return \DateTime|null + */ + public function getShipDate() + { + return $this->shipDate; + } + + /** + * Sets shipDate. + * + * @param \DateTime|null $shipDate + * + * @return $this + */ + public function setShipDate(\DateTime $shipDate = null) + { + $this->shipDate = $shipDate; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status Order Status + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } + + /** + * Gets complete. + * + * @return bool|null + */ + public function isComplete() + { + return $this->complete; + } + + /** + * Sets complete. + * + * @param bool|null $complete + * + * @return $this + */ + public function setComplete($complete = null) + { + $this->complete = $complete; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php new file mode 100644 index 00000000000..ac3fba47a7d --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php @@ -0,0 +1,262 @@ +") + */ + protected $photoUrls; + + /** + * @var Swagger\Server\Model\Tag[]|null + * @SerializedName("tags") + * @Assert\All({ + * @Assert\Type("Swagger\Server\Model\Tag") + * }) + * @Type("array") + */ + protected $tags; + + /** + * pet status in the store + * + * @var string|null + * @SerializedName("status") + * @Assert\Choice({ "available", "pending", "sold" }) + * @Assert\Type("string") + * @Type("string") + */ + protected $status; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->id = isset($data['id']) ? $data['id'] : null; + $this->category = isset($data['category']) ? $data['category'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + $this->photoUrls = isset($data['photoUrls']) ? $data['photoUrls'] : null; + $this->tags = isset($data['tags']) ? $data['tags'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets category. + * + * @return Swagger\Server\Model\Category|null + */ + public function getCategory() + { + return $this->category; + } + + /** + * Sets category. + * + * @param Swagger\Server\Model\Category|null $category + * + * @return $this + */ + public function setCategory(Category $category = null) + { + $this->category = $category; + + return $this; + } + + /** + * Gets name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Gets photoUrls. + * + * @return string[] + */ + public function getPhotoUrls() + { + return $this->photoUrls; + } + + /** + * Sets photoUrls. + * + * @param string[] $photoUrls + * + * @return $this + */ + public function setPhotoUrls(array $photoUrls) + { + $this->photoUrls = $photoUrls; + + return $this; + } + + /** + * Gets tags. + * + * @return Swagger\Server\Model\Tag[]|null + */ + public function getTags() + { + return $this->tags; + } + + /** + * Sets tags. + * + * @param Swagger\Server\Model\Tag[]|null $tags + * + * @return $this + */ + public function setTags(array $tags = null) + { + $this->tags = $tags; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status pet status in the store + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php new file mode 100644 index 00000000000..ffe2ef4fb4f --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php @@ -0,0 +1,121 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php new file mode 100644 index 00000000000..5f69763a525 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php @@ -0,0 +1,321 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->username = isset($data['username']) ? $data['username'] : null; + $this->firstName = isset($data['firstName']) ? $data['firstName'] : null; + $this->lastName = isset($data['lastName']) ? $data['lastName'] : null; + $this->email = isset($data['email']) ? $data['email'] : null; + $this->password = isset($data['password']) ? $data['password'] : null; + $this->phone = isset($data['phone']) ? $data['phone'] : null; + $this->userStatus = isset($data['userStatus']) ? $data['userStatus'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets username. + * + * @return string|null + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets username. + * + * @param string|null $username + * + * @return $this + */ + public function setUsername($username = null) + { + $this->username = $username; + + return $this; + } + + /** + * Gets firstName. + * + * @return string|null + */ + public function getFirstName() + { + return $this->firstName; + } + + /** + * Sets firstName. + * + * @param string|null $firstName + * + * @return $this + */ + public function setFirstName($firstName = null) + { + $this->firstName = $firstName; + + return $this; + } + + /** + * Gets lastName. + * + * @return string|null + */ + public function getLastName() + { + return $this->lastName; + } + + /** + * Sets lastName. + * + * @param string|null $lastName + * + * @return $this + */ + public function setLastName($lastName = null) + { + $this->lastName = $lastName; + + return $this; + } + + /** + * Gets email. + * + * @return string|null + */ + public function getEmail() + { + return $this->email; + } + + /** + * Sets email. + * + * @param string|null $email + * + * @return $this + */ + public function setEmail($email = null) + { + $this->email = $email; + + return $this; + } + + /** + * Gets password. + * + * @return string|null + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets password. + * + * @param string|null $password + * + * @return $this + */ + public function setPassword($password = null) + { + $this->password = $password; + + return $this; + } + + /** + * Gets phone. + * + * @return string|null + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Sets phone. + * + * @param string|null $phone + * + * @return $this + */ + public function setPhone($phone = null) + { + $this->phone = $phone; + + return $this; + } + + /** + * Gets userStatus. + * + * @return int|null + */ + public function getUserStatus() + { + return $this->userStatus; + } + + /** + * Sets userStatus. + * + * @param int|null $userStatus User Status + * + * @return $this + */ + public function setUserStatus($userStatus = null) + { + $this->userStatus = $userStatus; + + return $this; + } +} + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md new file mode 100644 index 00000000000..d4375c06941 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md @@ -0,0 +1,182 @@ +# SwaggerServer +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. + +This [Symfony](https://symfony.com/) bundle is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- Build package: io.swagger.codegen.languages.SymfonyServerCodegen + +## Requirements + +PHP 5.4.0 and later + +## Installation & Usage + +To install the dependencies via [Composer](http://getcomposer.org/), add the following repository to `composer.json` of your Symfony project: + +```json +{ + "repositories": [{ + "type": "path", + "url": "//Path to your generated swagger bundle" + }], +} +``` + +Then run: + +``` +composer require swagger/server-bundle:dev-master +``` + +to add the generated swagger bundle as a dependency. + +## Tests + +To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands: + +``` +composer install +./vendor/bin/phpunit +``` + + +## Getting Started + +Step 1: Please follow the [installation procedure](#installation--usage) first. + +Step 2: Enable the bundle in the kernel: + +```php + addPet($body) + +Add a new pet to the store + + + +### Example Implementation +```php + deletePet($petId, $apiKey) + +Deletes a pet + + + +### Example Implementation +```php + Swagger\Server\Model\Pet[] findPetsByStatus($status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example Implementation +```php + Swagger\Server\Model\Pet[] findPetsByTags($tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example Implementation +```php + Swagger\Server\Model\Pet getPetById($petId) + +Find pet by ID + +Returns a single pet + +### Example Implementation +```php + updatePet($body) + +Update an existing pet + + + +### Example Implementation +```php + updatePetWithForm($petId, $name, $status) + +Updates a pet in the store with form data + + + +### Example Implementation +```php + Swagger\Server\Model\ApiResponse uploadFile($petId, $additionalMetadata, $file) + +uploads an image + + + +### Example Implementation +```php + deleteOrder($orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example Implementation +```php + int[] getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example Implementation +```php + Swagger\Server\Model\Order getOrderById($orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example Implementation +```php + Swagger\Server\Model\Order placeOrder($body) + +Place an order for a pet + + + +### Example Implementation +```php + createUser($body) + +Create user + +This can only be done by the logged in user. + +### Example Implementation +```php + createUsersWithArrayInput($body) + +Creates list of users with given input array + + + +### Example Implementation +```php + createUsersWithListInput($body) + +Creates list of users with given input array + + + +### Example Implementation +```php + deleteUser($username) + +Delete user + +This can only be done by the logged in user. + +### Example Implementation +```php + Swagger\Server\Model\User getUserByName($username) + +Get user by user name + + + +### Example Implementation +```php + string loginUser($username, $password) + +Logs user into the system + + + +### Example Implementation +```php + logoutUser() + +Logs out current logged in user session + + + +### Example Implementation +```php + updateUser($username, $body) + +Updated user + +This can only be done by the logged in user. + +### Example Implementation +```php +serializer = SerializerBuilder::create() + ->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy)) + ->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy)) + ->build(); + } + + public function serialize($data, $format) + { + return SerializerBuilder::create()->build()->serialize($data, $this->convertFormat($format)); + } + + public function deserialize($data, $type, $format) + { + if ($format == 'string') { + return $this->deserializeString($data, $type); + } + + // If we end up here, let JMS serializer handle the deserialization + return $this->serializer->deserialize($data, $type, $this->convertFormat($format)); + } + + private function convertFormat($format) + { + switch ($format) { + case 'application/json': + return 'json'; + case 'application/xml': + return 'xml'; + } + + return null; + } + + private function deserializeString($data, $type) + { + switch ($type) { + case 'int': + case 'integer': + if (is_int($data)) { + return $data; + } + + if (is_numeric($data)) { + return $data + 0; + } + + break; + case 'string': + break; + case 'boolean': + case 'bool': + if (strtolower($data) === 'true') { + return true; + } + + if (strtolower($data) === 'false') { + return false; + } + + break; + case 'array': + return explode(',', $data); + case 'array': + return explode(' ', $data); + case 'array': + return explode("\t", $data); + case 'array': + return explode('|', $data); + } + + // If we end up here, just return data + return $data; + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php new file mode 100644 index 00000000000..bf8bc1896f6 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php @@ -0,0 +1,27 @@ +validator = Validation::createValidator(); + } + + public function validate($value, $constraints = null, $groups = null) + { + return $this->validator->validate($value, $constraints, $groups); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php new file mode 100644 index 00000000000..97a8f2e3197 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php @@ -0,0 +1,52 @@ +getCurrentPath()) > 0) { + $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath())); + } else { + $property = ''; + } + + return new static(sprintf( + 'Expected %s%s, but got %s: %s', + $property, + $expected_type, + gettype($actual_value), + json_encode($actual_value) + )); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php new file mode 100644 index 00000000000..a85241e81f6 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php @@ -0,0 +1,25 @@ +addCompilerPass(new SwaggerServerApiPass()); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php new file mode 100644 index 00000000000..ca0c3b8ec26 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php @@ -0,0 +1,217 @@ +request('POST', $path); + } + + /** + * Test case for deletePet + * + * Deletes a pet. + * + */ + public function testDeletePet() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for findPetsByStatus + * + * Finds Pets by status. + * + */ + public function testFindPetsByStatus() + { + $client = static::createClient(); + + $path = '/pet/findByStatus'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for findPetsByTags + * + * Finds Pets by tags. + * + */ + public function testFindPetsByTags() + { + $client = static::createClient(); + + $path = '/pet/findByTags'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for getPetById + * + * Find pet by ID. + * + */ + public function testGetPetById() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for updatePet + * + * Update an existing pet. + * + */ + public function testUpdatePet() + { + $client = static::createClient(); + + $path = '/pet'; + + $crawler = $client->request('PUT', $path); + } + + /** + * Test case for updatePetWithForm + * + * Updates a pet in the store with form data. + * + */ + public function testUpdatePetWithForm() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for uploadFile + * + * uploads an image. + * + */ + public function testUploadFile() + { + $client = static::createClient(); + + $path = '/pet/{petId}/uploadImage'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('POST', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php new file mode 100644 index 00000000000..2162289d8dd --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php @@ -0,0 +1,151 @@ +genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for getInventory + * + * Returns pet inventories by status. + * + */ + public function testGetInventory() + { + $client = static::createClient(); + + $path = '/store/inventory'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for getOrderById + * + * Find purchase order by ID. + * + */ + public function testGetOrderById() + { + $client = static::createClient(); + + $path = '/store/order/{orderId}'; + $pattern = '{orderId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for placeOrder + * + * Place an order for a pet. + * + */ + public function testPlaceOrder() + { + $client = static::createClient(); + + $path = '/store/order'; + + $crawler = $client->request('POST', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php new file mode 100644 index 00000000000..9074d020f30 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php @@ -0,0 +1,214 @@ +request('POST', $path); + } + + /** + * Test case for createUsersWithArrayInput + * + * Creates list of users with given input array. + * + */ + public function testCreateUsersWithArrayInput() + { + $client = static::createClient(); + + $path = '/user/createWithArray'; + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for createUsersWithListInput + * + * Creates list of users with given input array. + * + */ + public function testCreateUsersWithListInput() + { + $client = static::createClient(); + + $path = '/user/createWithList'; + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for deleteUser + * + * Delete user. + * + */ + public function testDeleteUser() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for getUserByName + * + * Get user by user name. + * + */ + public function testGetUserByName() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for loginUser + * + * Logs user into the system. + * + */ + public function testLoginUser() + { + $client = static::createClient(); + + $path = '/user/login'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for logoutUser + * + * Logs out current logged in user session. + * + */ + public function testLogoutUser() + { + $client = static::createClient(); + + $path = '/user/logout'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for updateUser + * + * Updated user. + * + */ + public function testUpdateUser() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('PUT', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php new file mode 100644 index 00000000000..631690bc978 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php @@ -0,0 +1,21 @@ +load(__DIR__.'/test_config.yml'); + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php new file mode 100644 index 00000000000..47970cb5c0b --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php @@ -0,0 +1,101 @@ +=5.4", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "symfony/validator": "*", + "jms/serializer-bundle": "*", + "symfony/framework-bundle": "^2.3|^3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0", + "squizlabs/php_codesniffer": "~2.6", + "friendsofphp/php-cs-fixer": "~1.12", + "symfony/browser-kit": "*", + "hoa/regex": "~1.0" + }, + "autoload": { + "psr-4": { "Swagger\\Server\\" : "./" } + } +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh new file mode 100644 index 00000000000..792320114fb --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +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." + 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 + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist new file mode 100644 index 00000000000..ec07d2081c9 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist @@ -0,0 +1,25 @@ + + + + + ./Tests/Api + ./Tests/Model + + + + + + + + + + ././Api + ././Model + + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/pom.xml b/samples/server/petstore/php-symfony/SymfonyBundle-php/pom.xml new file mode 100644 index 00000000000..614b3d33f98 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.penneo + PhpSymfonyPetstoreServerTests + pom + 1.0-SNAPSHOT + PHP Symfony Swagger Petstore Server + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + composer + + install + + + + + bundle-test + integration-test + + exec + + + vendor/bin/phpunit + + + + + + + + From fe5c2e627bc8e63a9b66b4277f4c9d46c35904fd Mon Sep 17 00:00:00 2001 From: tgifford-webfirst Date: Mon, 23 Oct 2017 11:35:11 -0400 Subject: [PATCH 195/197] Allow using help command with run-in-docker.sh (#6706) --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 556b6ff2f63..ca6b8d4e361 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -11,7 +11,7 @@ codegen="${cli}/target/swagger-codegen-cli.jar" cmdsrc="${cli}/src/main/java/io/swagger/codegen/cmd" pattern="@Command(name = \"$1\"" -if expr "x$1" : 'x[a-z][a-z-]*$' > /dev/null && fgrep -qe "$pattern" "$cmdsrc"/*.java; then +if expr "x$1" : 'x[a-z][a-z-]*$' > /dev/null && fgrep -qe "$pattern" "$cmdsrc"/*.java || expr "$1" = 'help' > /dev/null; then # If ${GEN_DIR} has been mapped elsewhere from default, and that location has not been built if [[ ! -f "${codegen}" ]]; then (cd "${GEN_DIR}" && exec mvn -am -pl "modules/swagger-codegen-cli" -Duser.home=$(dirname MAVEN_CONFIG) package) From 3b9ecc1a6f02eb88d68498b8fb7356780ce6b593 Mon Sep 17 00:00:00 2001 From: tzimisce012 Date: Mon, 23 Oct 2017 18:40:41 +0200 Subject: [PATCH 196/197] Change version --- modules/swagger-codegen-cli/pom.xml | 2 +- modules/swagger-codegen-maven-plugin/pom.xml | 2 +- modules/swagger-codegen/pom.xml | 2 +- modules/swagger-generator/pom.xml | 2 +- pom.xml | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 87780115964..34c1e5d95e7 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.0-SNAPSHOT + 2.3.0-SNAPSHOT+baikal14 ../.. 4.0.0 diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index 96424dcc063..e39d734922d 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -6,7 +6,7 @@ io.swagger swagger-codegen-project - 2.3.0-SNAPSHOT + 2.3.0-SNAPSHOT+baikal14 ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index f745c673b8c..36e98a622a5 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.3.0-SNAPSHOT + 2.3.0-SNAPSHOT+baikal14 ../.. 4.0.0 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 0225e12b988..19f5949bad2 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.3.0-SNAPSHOT + 2.3.0-SNAPSHOT+baikal14 ../.. swagger-generator diff --git a/pom.xml b/pom.xml index d063b8780d4..0f1d4a896d4 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.3.0-SNAPSHOT + 2.3.0-SNAPSHOT+baikal14 https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -942,7 +942,7 @@ - 1.0.32 + 1.0.32+baikal 2.11.1 3.3.0 1.5.16 From c1e18e4a7b336effcfd886ce61a80704b9834afa Mon Sep 17 00:00:00 2001 From: tzimisce012 Date: Mon, 23 Oct 2017 18:42:57 +0200 Subject: [PATCH 197/197] Add baikal repositories --- pom.xml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 0f1d4a896d4..7460a495a0f 100644 --- a/pom.xml +++ b/pom.xml @@ -932,13 +932,20 @@ + + + baikal-internal + s3://4pf-internal-dependencies/snapshots + + + baikal-internal + s3://4pf-internal-dependencies/snapshots + + - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - + baikal-internal + s3://4pf-internal-dependencies/snapshots